Author: thomas.diesler(a)jboss.com
Date: 2007-05-31 15:40:02 -0400 (Thu, 31 May 2007)
New Revision: 3347
Modified:
trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
Log:
Fix test regression
Modified:
trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/integration/native/src/main/resources/jbossws-native42.sar/jbossws.beans/META-INF/jboss-beans.xml 2007-05-31
19:40:02 UTC (rev 3347)
@@ -29,7 +29,9 @@
<bean name="WSEndpointRegistry"
class="org.jboss.wsf.stack.jbws.ManagedEndpointRegistry"/>
<!-- A subscription manager for WS-Eventing -->
- <bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
+ <bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager">
+ <property name="bindAddress">${jboss.bind.address}</property>
+ </bean>
<!-- Bind Service objects in client environment context -->
<!-- The bean name is compiled into the server. Changeit with the next release.
-->
Modified:
trunk/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml
===================================================================
---
trunk/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml 2007-05-31
19:40:02 UTC (rev 3347)
@@ -29,7 +29,9 @@
<bean name="WSEndpointRegistry"
class="org.jboss.wsf.stack.jbws.ManagedEndpointRegistry"/>
<!-- A subscription manager for WS-Eventing -->
- <bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
+ <bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager">
+ <property name="bindAddress">${jboss.bind.address}</property>
+ </bean>
<!-- Bind Service objects in client environment context -->
<!-- The bean name is compiled into the server. Changeit with the next release.
-->
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -316,6 +316,8 @@
SerializerSupport ser = serFactory.getSerializer();
Result result = ser.serialize(xmlName, xmlType, faultObject, serContext, null);
XMLFragment xmlFragment = new XMLFragment(result);
+ String xmlStr = xmlFragment.toXMLString();
+ log.debug("Fault detail: " + xmlStr);
Element domElement = xmlFragment.toElement();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherDelegate.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -1,12 +1,10 @@
package org.jboss.ws.extensions.eventing.mgmt;
import java.net.URI;
-import java.util.Properties;
import javax.management.MBeanServerConnection;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
-import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.Reference;
@@ -62,11 +60,8 @@
try
{
ObjectName objectName = SubscriptionManager.OBJECT_NAME;
- subscriptionManager = (SubscriptionManagerMBean)
- MBeanServerInvocationHandler.newProxyInstance(
- getServer(), objectName,
- SubscriptionManagerMBean.class, false
- );
+ subscriptionManager =
(SubscriptionManagerMBean)MBeanServerInvocationHandler.newProxyInstance(getServer(),
objectName, SubscriptionManagerMBean.class,
+ false);
}
catch (Exception e)
{
@@ -80,20 +75,11 @@
private MBeanServerConnection getServer() throws NamingException
{
// todo: bypass rmi adapter when used locally
- InitialContext iniCtx = getInitialContext();
+ InitialContext iniCtx = new InitialContext();
MBeanServerConnection server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
return server;
}
- private InitialContext getInitialContext() throws NamingException
- {
- Properties env = new Properties();
- env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
- env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
- env.setProperty(Context.PROVIDER_URL,
"jnp://"+hostname+":1099");
- return new InitialContext(env);
- }
-
void setHostname(String hostname)
{
if (null == hostname)
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/DispatcherFactory.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -1,24 +1,24 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ws.extensions.eventing.mgmt;
import java.util.Hashtable;
@@ -36,9 +36,10 @@
* @author Heiko Braun, <heiko(a)openj.net>
* @since 11-Jan-2006
*/
-public class DispatcherFactory implements ObjectFactory {
- public Object getObjectInstance(Object object, Name name, Context context,
Hashtable<?, ?> hashtable) throws Exception {
-
+public class DispatcherFactory implements ObjectFactory
+{
+ public Object getObjectInstance(Object object, Name name, Context context,
Hashtable<?, ?> hashtable) throws Exception
+ {
Reference ref = (Reference)object;
String hostname =
(String)ref.get(DispatcherDelegate.MANAGER_HOSTNAME).getContent();
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/EventingBuilder.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -11,24 +11,28 @@
* @author Heiko Braun, <heiko(a)openj.net>
* @since 24-Jan-2006
*/
-public class EventingBuilder {
+public class EventingBuilder
+{
- private EventingBuilder() {
+ private EventingBuilder()
+ {
}
- public static EventingBuilder createEventingBuilder() {
+ public static EventingBuilder createEventingBuilder()
+ {
return new EventingBuilder();
}
- public EventSource newEventSource(EventingEndpointDeployment desc) {
+ public EventSource newEventSource(EventingEndpointDeployment desc)
+ {
URI eventSourceNS = newEventSourceURI(desc.getName());
EventSource eventSource = new EventSource(desc.getName(), eventSourceNS,
desc.getSchema(), desc.getNotificationRootElementNS());
eventSource.getSupportedFilterDialects().add(EventingConstants.getDefaultFilterDialect());
return eventSource;
}
-
- public URI newEventSourceURI(String name) {
+ public URI newEventSourceURI(String name)
+ {
try
{
return new URI(name);
@@ -39,5 +43,4 @@
}
}
-
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManager.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -26,8 +26,10 @@
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
+import java.net.InetAddress;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -41,7 +43,6 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.xml.bind.JAXBElement;
@@ -61,7 +62,6 @@
import org.jboss.ws.extensions.eventing.jaxws.ReferenceParametersType;
import org.jboss.wsf.spi.utils.DOMUtils;
import org.jboss.wsf.spi.utils.DOMWriter;
-import org.jboss.wsf.spi.utils.ObjectNameFactory;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -94,56 +94,60 @@
*/
public class SubscriptionManager implements SubscriptionManagerMBean, EventDispatcher
{
-
private static final Logger log = Logger.getLogger(SubscriptionManager.class);
- /**
- * Maps event source namespaces to event source instances.
- */
+ // Maps event source namespaces to event source instances.
private ConcurrentMap<URI, EventSource> eventSourceMapping = new
ConcurrentHashMap<URI, EventSource>();
-
- /**
- * Maps subscriptions to event sources
- */
+ // Maps subscriptions to event sources
private ConcurrentMap<URI, List<Subscription>> subscriptionMapping = new
ConcurrentHashMap<URI, List<Subscription>>();
-
- /**
- * Buffers notifications. FIFO ordering.
- */
+ // Buffers notifications. FIFO ordering.
private BlockingQueue<Runnable> eventQueue = new
LinkedBlockingQueue<Runnable>();
-
- /**
- * Event dispatcher thread pool.
- */
+ // Event dispatcher thread pool.
private ThreadPoolExecutor threadPool;
-
+ // True force validation of every notification message against its schema
+ private boolean validateNotifications = false;
+ // subscription watchdog that maintains expirations
+ private WatchDog watchDog;
+ // True if dispatcher is bound to JNDI
private boolean isDispatcherBound = false;
+ // List containing all errors occured during notification since service startup
+ // TODO: save this list and made possible to resend failed notification using jms
instead of list
+ private List<NotificationFailure> notificationFailures = new
ArrayList<NotificationFailure>();
+ // The host that the dispatcher is bound to
+ private String bindAddress;
- /**
- * subscription watchdog that maintains expirations
- */
- private WatchDog watchDog;
-
private static EventingBuilder builder = EventingBuilder.createEventingBuilder();
+ public String getBindAddress()
+ {
+ if (bindAddress == null)
+ {
+ try
+ {
+ InetAddress localHost = InetAddress.getLocalHost();
+ log.debug("BindAddress not set, using host: " +
localHost.getHostName());
+ bindAddress = localHost.getHostName();
+ }
+ catch (UnknownHostException e)
+ {
+ log.debug("BindAddress not set, using: 'localhost'");
+ bindAddress = "localhost";
+ }
+ }
+ return bindAddress;
+ }
- /**
- * List containing all errors occured during notification since service startup
- * todo: save this list and made possible to resend failed notification using jms
instead of list
- */
- private List<NotificationFailure> notificationFailures = new
ArrayList<NotificationFailure>();
+ public void setBindAddress(String bindAddress)
+ {
+ this.bindAddress = bindAddress;
+ }
- /**
- * True force validation of every notification message against its schema
- */
- private boolean validateNotifications = false;
-
public void create() throws Exception
{
MBeanServer server = getJMXServer();
if (server != null)
{
- if(log.isDebugEnabled()) log.debug("Create subscription manager");
+ log.debug("Create subscription manager");
server.registerMBean(this, OBJECT_NAME);
}
}
@@ -153,19 +157,19 @@
MBeanServer server = getJMXServer();
if (server != null)
{
- if(log.isDebugEnabled()) log.debug("Destroy subscription manager");
+ log.debug("Destroy subscription manager");
server.unregisterMBean(OBJECT_NAME);
}
}
public void start() throws Exception
{
- if(log.isDebugEnabled()) log.debug("Start subscription manager");
+ log.debug("Start subscription manager");
// setup thread pool
threadPool = new ThreadPoolExecutor(5, 15, // core/max num threads
- 5000, TimeUnit.MILLISECONDS, // 5 seconds keepalive
- eventQueue);
+ 5000, TimeUnit.MILLISECONDS, // 5 seconds keepalive
+ eventQueue);
// start the subscription watchdog
watchDog = new WatchDog(subscriptionMapping);
@@ -174,7 +178,7 @@
public void stop()
{
- if(log.isDebugEnabled()) log.debug("Stop subscription manager");
+ log.debug("Stop subscription manager");
try
{
// remove event dispatcher
@@ -224,7 +228,7 @@
updateManagerAddress(deploymentInfo, eventSource);
eventSource.setState(EventSource.State.CREATED);
- if(log.isDebugEnabled()) log.debug("Created: " + eventSource);
+ log.debug("Created: " + eventSource);
}
else
{
@@ -233,18 +237,18 @@
subscriptionMapping.put(eventSource.getNameSpace(), new
CopyOnWriteArrayList<Subscription>());
eventSource.setState(EventSource.State.STARTED);
- if(log.isDebugEnabled()) log.debug("Started: " + eventSource);
+ log.debug("Started: " + eventSource);
}
}
private void lazyBindEventDispatcher()
{
- if(!isDispatcherBound)
+ if (!isDispatcherBound)
{
try
{
// bind dispatcher to JNDI
- Util.rebind(new InitialContext(), EventingConstants.DISPATCHER_JNDI_NAME, new
DispatcherDelegate("localhost"));
+ Util.rebind(new InitialContext(), EventingConstants.DISPATCHER_JNDI_NAME, new
DispatcherDelegate(getBindAddress()));
log.info("Bound event dispatcher to java:/" +
EventingConstants.DISPATCHER_JNDI_NAME);
isDispatcherBound = true;
}
@@ -264,10 +268,10 @@
private static void updateManagerAddress(EventingEndpointDeployment deploymentInfo,
EventSource eventSource)
{
String addr = null;
-
if(deploymentInfo.getPortName().getLocalPart().equals("SubscriptionManagerPort"))
+ if
(deploymentInfo.getPortName().getLocalPart().equals("SubscriptionManagerPort"))
addr = deploymentInfo.getEndpointAddress();
- if(addr!=null)
+ if (addr != null)
eventSource.setManagerAddress(addr);
}
@@ -283,18 +287,18 @@
subscriptions.clear();
eventSourceMapping.remove(eventSourceNS);
- if(log.isDebugEnabled()) log.debug("Event source " + eventSourceNS +
" removed");
+ log.debug("Event source " + eventSourceNS + " removed");
}
}
/**
* Subscribe to an event source.
*/
- public SubscriptionTicket subscribe(URI eventSourceNS, EndpointReferenceType notifyTo,
EndpointReferenceType endTo, Date expires, Filter filter) throws SubscriptionError
+ public SubscriptionTicket subscribe(URI eventSourceNS, EndpointReferenceType notifyTo,
EndpointReferenceType endTo, Date expires, Filter filter)
+ throws SubscriptionError
{
+ log.debug("Subscription request for " + eventSourceNS);
- if(log.isDebugEnabled()) log.debug("Subscription request for " +
eventSourceNS);
-
EventSource eventSource = eventSourceMapping.get(eventSourceNS);
if (null == eventSource)
throw new SubscriptionError(EventingConstants.CODE_UNABLE_TO_PROCESS,
"EventSource '" + eventSourceNS + "' not registered");
@@ -337,18 +341,16 @@
attrURI.setValue(eventSource.getManagerAddress().toString());
epr.setAddress(attrURI);
ReferenceParametersType refParam = new ReferenceParametersType();
- JAXBElement idqn = new JAXBElement(
- new
QName("http://schemas.xmlsoap.org/ws/2004/08/eventing",
"Identifier"),
- String.class, generateSubscriptionID().toString()
- );
+ JAXBElement idqn = new JAXBElement(new
QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Identifier"),
String.class, generateSubscriptionID().toString());
refParam.getAny().add(idqn);
epr.setReferenceParameters(refParam);
Subscription subscription = new Subscription(eventSource.getNameSpace(), epr,
notifyTo, endTo, expires, filter);
subscriptionMapping.get(eventSourceNS).add(subscription);
- if(log.isDebugEnabled()) log.debug("Registered subscription " +
subscription.getIdentifier());
+ log.debug("Registered subscription " + subscription.getIdentifier());
+
return new SubscriptionTicket(epr, subscription.getExpires());
}
@@ -412,7 +414,7 @@
if (identifier.equals(s.getIdentifier()))
{
subscriptions.remove(s);
- if(log.isDebugEnabled()) log.debug("Removed subscription " +
s);
+ log.debug("Removed subscription " + s);
break;
}
}
@@ -484,7 +486,8 @@
public void dispatch(URI eventSourceNS, Element payload)
{
DispatchJob dispatchJob = new DispatchJob(eventSourceNS, payload,
subscriptionMapping);
- if (validateNotifications &&
!this.validateMessage(DOMWriter.printNode(payload,false),eventSourceNS)) {
+ if (validateNotifications &&
!this.validateMessage(DOMWriter.printNode(payload, false), eventSourceNS))
+ {
throw new DispatchException("Notification message validation
failed!");
}
threadPool.execute(dispatchJob);
@@ -500,18 +503,20 @@
return notificationFailures;
}
- private boolean validateMessage(String msg, URI eventSourceNS) {
+ private boolean validateMessage(String msg, URI eventSourceNS)
+ {
try
{
EventSource es = eventSourceMapping.get(eventSourceNS);
- log.info(new StringBuffer("Validating message: \n\n").append(msg)
- .append("\n\nagainst the following schema(s): \n").toString());
- for (int i=0;i<es.getNotificationSchema().length;i++) {
+ log.info(new StringBuffer("Validating message:
\n\n").append(msg).append("\n\nagainst the following schema(s):
\n").toString());
+ for (int i = 0; i < es.getNotificationSchema().length; i++)
+ {
log.info(es.getNotificationSchema()[i]);
}
Element rootElement = DOMUtils.parse(msg);
- if
(!es.getNotificationRootElementNS().equalsIgnoreCase(rootElement.getNamespaceURI())) {
- log.error("Root element expected namespace:
"+es.getNotificationRootElementNS());
+ if
(!es.getNotificationRootElementNS().equalsIgnoreCase(rootElement.getNamespaceURI()))
+ {
+ log.error("Root element expected namespace: " +
es.getNotificationRootElementNS());
return false;
}
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
@@ -521,8 +526,9 @@
String[] notificationSchemas = es.getNotificationSchema();
InputSource[] is = new InputSource[notificationSchemas.length];
- for (int i=0; i<notificationSchemas.length; i++) {
- is[i] = new InputSource(new
StringReader(notificationSchemas[notificationSchemas.length-1-i]));
+ for (int i = 0; i < notificationSchemas.length; i++)
+ {
+ is[i] = new InputSource(new
StringReader(notificationSchemas[notificationSchemas.length - 1 - i]));
//is[i] = new InputSource(new StringReader(notificationSchemas[i]));
}
@@ -534,7 +540,8 @@
log.info("Document validated!");
return true;
}
- catch (Exception e) {
+ catch (Exception e)
+ {
log.error(e);
log.info("Cannot validate and/or parse the document!");
return false;
@@ -585,11 +592,13 @@
threadPool.setKeepAliveTime(millies, TimeUnit.MILLISECONDS);
}
- public boolean isValidateNotifications() {
+ public boolean isValidateNotifications()
+ {
return this.validateNotifications;
}
- public void setValidateNotifications(boolean validateNotifications) {
+ public void setValidateNotifications(boolean validateNotifications)
+ {
this.validateNotifications = validateNotifications;
}
@@ -660,14 +669,21 @@
}
- private class Validator extends DefaultErrorHandler {
- public void error(SAXParseException exception) throws SAXException {
+ private class Validator extends DefaultErrorHandler
+ {
+ public void error(SAXParseException exception) throws SAXException
+ {
throw new SAXException(exception);
}
- public void fatalError(SAXParseException exception) throws SAXException {
+
+ public void fatalError(SAXParseException exception) throws SAXException
+ {
throw new SAXException(exception);
}
- public void warning(SAXParseException exception) throws SAXException { }
+
+ public void warning(SAXParseException exception) throws SAXException
+ {
+ }
}
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerMBean.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -44,38 +44,32 @@
static final String BEAN_NAME = "WSSubscriptionManager";
+ String getBindAddress();
+
+ void setBindAddress(String bindAddress);
+
/**
* Returns the core number of threads.
- *
- * @return long
*/
int getCorePoolSize();
/**
* Returns the maximum allowed number of threads.
- *
- * @return int
*/
int getMaximumPoolSize();
/**
* Returns the largest number of threads that have ever simultaneously been in the
pool.
- *
- * @return int
*/
int getLargestPoolSize();
/**
* Returns the approximate number of threads that are actively executing tasks.
- *
- * @return int
*/
int getActiveCount();
/**
* Returns the approximate total number of tasks that have completed execution.
- *
- * @return long
*/
long getCompletedTaskCount();
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -66,6 +66,8 @@
import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
+import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -94,9 +96,6 @@
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.api.TypeReference;
-import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
-import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
-
/**
* Abstract class that represents a JAX-WS metadata builder.
*
@@ -264,53 +263,48 @@
return handlerChainsMetaData;
}
- private void addFault(OperationMetaData omd, Class<?> exception)
+ private void addFault(OperationMetaData opMetaData, Class<?> exception)
{
- if (omd.isOneWay())
+ if (opMetaData.isOneWay())
throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is
REQUIRED to report an error if an operation marked "
+ "@Oneway has a return value, declares any checked exceptions or has
any INOUT or OUT parameters.");
- WebFault annotation = exception.getAnnotation(WebFault.class);
+ WebFault anWebFault = exception.getAnnotation(WebFault.class);
- String name;
- String namespace;
- String faultBeanName = null;
-
// Only the element name is effected by @WebFault, the type uses the same
convention
- QName xmlType = new QName(omd.getQName().getNamespaceURI(),
exception.getSimpleName());
+ QName xmlType = new QName(opMetaData.getQName().getNamespaceURI(),
exception.getSimpleName());
+ String name = xmlType.getLocalPart();
+ String namespace = xmlType.getNamespaceURI();
+
+ String faultBean = null;
+ Class faultBeanClass = getFaultInfo(exception);
+ if (faultBeanClass != null)
+ faultBean = faultBeanClass.getName();
+
/*
* If @WebFault is present, and the exception contains getFaultInfo, the
* return value should be used. Otherwise we need to generate the bean.
*/
- boolean generate = true;
- if (annotation != null)
+ if (anWebFault != null)
{
- name = annotation.name();
- namespace = annotation.targetNamespace();
- if (namespace.length() == 0)
- namespace = omd.getQName().getNamespaceURI();
+ if (anWebFault.name().length() > 0)
+ name = anWebFault.name();
- Class<?> faultBean = getFaultInfo(exception);
- if (faultBean != null)
- {
- generate = false;
- faultBeanName = faultBean.getName();
- }
+ if (anWebFault.targetNamespace().length() > 0)
+ namespace = anWebFault.targetNamespace();
+
+ if (anWebFault.faultBean().length() > 0)
+ faultBean = anWebFault.faultBean();
}
- else
- {
- name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
- }
- if (faultBeanName == null)
- faultBeanName =
JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
+ if (faultBean == null)
+ faultBean =
JavaUtils.getPackageName(opMetaData.getEndpointMetaData().getServiceEndpointInterface()) +
".jaxws." + exception.getSimpleName() + "Bean";
QName xmlName = new QName(namespace, name);
- FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
- fmd.setFaultBeanName(faultBeanName);
+ FaultMetaData fmd = new FaultMetaData(opMetaData, xmlName, xmlType,
exception.getName());
+ fmd.setFaultBeanName(faultBean);
if (fmd.loadFaultBean() == null)
wrapperGenerator.generate(fmd);
@@ -318,7 +312,7 @@
javaTypes.add(fmd.getFaultBean());
typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
- omd.addFault(fmd);
+ opMetaData.addFault(fmd);
}
private String convertToVariable(String localName)
@@ -407,12 +401,12 @@
return retMetaData;
}
- private Class<?> getFaultInfo(Class<?> exception)
+ private Class getFaultInfo(Class exception)
{
try
{
Method method = exception.getMethod("getFaultInfo");
- Class<?> returnType = method.getReturnType();
+ Class returnType = method.getReturnType();
if (returnType == void.class)
return null;
@@ -590,7 +584,7 @@
// Build parameter meta data
// Attachment annotations on SEI parameters
List<AttachmentScanResult> scanResult =
ReflectiveAttachmentRefScanner.scanMethod(method);
-
+
Class[] parameterTypes = method.getParameterTypes();
Type[] genericTypes = method.getGenericParameterTypes();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
@@ -715,8 +709,8 @@
// insert at the beginning just for prettiness
wrappedOutputParameters.add(0, wrapped);
-
- processAttachmentAnnotationsWrapped(scanResult, -1, wrapped);
+
+ processAttachmentAnnotationsWrapped(scanResult, -1, wrapped);
}
else
{
@@ -796,12 +790,11 @@
private void processAttachmentAnnotationsWrapped(List<AttachmentScanResult>
scanResult, int i, WrappedParameter wrappedParameter)
{
AttachmentScanResult asr =
ReflectiveAttachmentRefScanner.getResultByIndex(scanResult, i);
- if(asr!=null)
+ if (asr != null)
{
- if(AttachmentScanResult.Type.SWA_REF == asr.getType())
+ if (AttachmentScanResult.Type.SWA_REF == asr.getType())
wrappedParameter.setSwaRef(true);
- else
- wrappedParameter.setXOP(true);
+ else wrappedParameter.setXOP(true);
}
}
@@ -814,12 +807,11 @@
private void processAttachmentAnnotations(List<AttachmentScanResult> scanResult,
int i, ParameterMetaData parameter)
{
AttachmentScanResult asr =
ReflectiveAttachmentRefScanner.getResultByIndex(scanResult, i);
- if(asr!=null)
+ if (asr != null)
{
- if(AttachmentScanResult.Type.SWA_REF == asr.getType())
+ if (AttachmentScanResult.Type.SWA_REF == asr.getType())
parameter.setSwaRef(true);
- else
- parameter.setXOP(true);
+ else parameter.setXOP(true);
}
}
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -66,7 +66,7 @@
private Hello getPort() throws Exception
{
- URL wsdlURL = new
File("WSProvideTask/resources/jaxws/samples/wssecurityAnnotatedpolicy/HelloService.wsdl").toURL();
+ URL wsdlURL = new
File("wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy/HelloService.wsdl").toURL();
QName serviceName = new
QName("http://org.jboss.ws/samples/wssecurityAnnotatedpolicy",
"HelloService");
Modified:
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
===================================================================
---
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2007-05-31
17:11:33 UTC (rev 3346)
+++
trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2007-05-31
19:40:02 UTC (rev 3347)
@@ -88,7 +88,7 @@
catch (SOAPFaultException e)
{
String faultString = e.getFault().getFaultString();
- assertTrue(faultString.indexOf("oh no, a runtime exception occured.")
> 0);
+ assertTrue(faultString.indexOf("oh no, a runtime exception occured.")
>= 0);
}
}