Author: thomas.diesler(a)jboss.com
Date: 2007-01-26 08:37:04 -0500 (Fri, 26 Jan 2007)
New Revision: 2136
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/DefaultFileAdapter.java
Modified:
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceExt.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/ConfigurationProvider.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpoint.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java
Log:
Fix NPE with null configFile
Modified:
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/JBossServiceEndpointServlet.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -23,19 +23,14 @@
// $Id$
-import java.util.List;
-
import javax.servlet.ServletContext;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.config.ConfigurationProvider;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
* A servlet that is installed for every web service endpoint.
@@ -68,8 +63,7 @@
ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
ConfigurationProvider configProvider = (ConfigurationProvider)sepMetaData;
- configProvider.setConfigName(configName);
- configProvider.setConfigFile(configFile);
+ configProvider.setConfigName(configName, configFile);
// configure handler chain
configProvider.configure(sepMetaData);
Modified:
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -23,15 +23,15 @@
// $Id$
+import javax.servlet.ServletContext;
+
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.config.ConfigurationProvider;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import javax.servlet.ServletContext;
-
/**
* A servlet that is installed for every web service endpoint.
*
@@ -42,13 +42,13 @@
{
// provide logging
private static final Logger log =
Logger.getLogger(JBossServiceEndpointServlet.class);
-
+
/** Initialize the service endpoint
*/
protected void initServiceEndpoint(String contextPath)
{
super.initServiceEndpoint(contextPath);
-
+
ServiceEndpoint wsEndpoint = epManager.getServiceEndpointByID(sepId);
if (wsEndpoint == null)
throw new WSException("Cannot obtain endpoint for: " + sepId);
@@ -63,8 +63,7 @@
ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
ConfigurationProvider configProvider = (ConfigurationProvider)sepMetaData;
- configProvider.setConfigName(configName);
- configProvider.setConfigFile(configFile);
+ configProvider.setConfigName(configName, configFile);
// configure handler chain
configProvider.configure(sepMetaData);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-26
11:12:01 UTC (rev 2135)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -54,7 +54,13 @@
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.metadata.umdm.*;
+import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -185,17 +191,16 @@
{
if (epMetaData == null)
{
- ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ ResourceLoaderAdapter vfsRoot = new ResourceLoaderAdapter();
+ UnifiedMetaData wsMetaData = new UnifiedMetaData(vfsRoot);
+ wsMetaData.setClassLoader(ctxLoader);
- DefaultFileAdapter vfsRoot = new DefaultFileAdapter();
- vfsRoot.setLoader(contextClassLoader);
- UnifiedMetaData wsMetaData = new UnifiedMetaData( vfsRoot );
- wsMetaData.setClassLoader(contextClassLoader);
-
ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new
QName(Constants.NS_JBOSSWS_URI, "AnonymousService"));
wsMetaData.addService(serviceMetaData);
- epMetaData = new ClientEndpointMetaData(serviceMetaData, new
QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"), new
QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXRPC);
+ epMetaData = new ClientEndpointMetaData(serviceMetaData, new
QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"),
+ new QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXRPC);
epMetaData.setStyle(Style.RPC);
serviceMetaData.addEndpoint(epMetaData);
@@ -251,7 +256,7 @@
// Bind the request message
SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData,
epInv, unboundHeaders);
-
+
// Add possible attachment parts
addAttachmentParts(reqMessage);
@@ -333,7 +338,7 @@
// BP-1.0 R1027
if (handlerPass)
- HandlerChainBaseImpl.checkMustUnderstand(msgContext, new String[]{});
+ HandlerChainBaseImpl.checkMustUnderstand(msgContext, new String[] {});
// Check if protocol handlers modified the payload
if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
@@ -486,7 +491,7 @@
{
return unboundHeaders.keySet().iterator();
}
-
+
/**
* Adds the given AttachmentPart object to the outgoing SOAPMessage.
* An AttachmentPart object must be created before it can be added to a message.
@@ -526,17 +531,16 @@
return epMetaData.getConfigName();
}
- public abstract void setConfigName(String configName);
-
- public String getConfigFile()
+ public void setConfigName(String configName)
{
- EndpointMetaData epMetaData = getEndpointMetaData();
- return epMetaData.getConfigFile();
+ setConfigName(configName, null);
}
- public void setConfigFile(String configFile)
+ public abstract void setConfigName(String configName, String configFile);
+
+ public String getConfigFile()
{
EndpointMetaData epMetaData = getEndpointMetaData();
- epMetaData.setConfigFile(configFile);
+ return epMetaData.getConfigFile();
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java 2007-01-26
11:12:01 UTC (rev 2135)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/ConfigProvider.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -37,11 +37,6 @@
String getConfigFile();
/**
- * Set the port configuration file
- */
- void setConfigFile(String configFile);
-
- /**
* Get the port configuration name
*/
String getConfigName();
@@ -50,4 +45,9 @@
* Set the port configuration name
*/
void setConfigName(String configName);
+
+ /**
+ * Set the port configuration name and file
+ */
+ void setConfigName(String configName, String configFile);
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2007-01-26
11:12:01 UTC (rev 2135)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -615,13 +615,12 @@
}
@Override
- public void setConfigName(String configName)
+ public void setConfigName(String configName, String configFile)
{
EndpointMetaData epMetaData = getEndpointMetaData();
- epMetaData.setConfigName(configName);
+ epMetaData.setConfigName(configName, configFile);
// Reinitialize the client handler chain
- // TODO: is this necessary?
jaxrpcService.setupHandlerChain(epMetaData);
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2007-01-26
11:12:01 UTC (rev 2135)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -47,7 +47,13 @@
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
-import org.jboss.ws.metadata.umdm.*;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
@@ -83,7 +89,7 @@
*/
ServiceImpl(QName serviceName)
{
- UnifiedMetaData wsMetaData = new UnifiedMetaData(new DefaultFileAdapter());
+ UnifiedMetaData wsMetaData = new UnifiedMetaData(new ResourceLoaderAdapter());
serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
handlerRegistry = new HandlerRegistryImpl(serviceMetaData);
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -88,9 +88,7 @@
public List<Handler> getHandlerChain()
{
log.debug("getHandlerChain: " + jaxwsHandlerChain);
- List<Handler> handlerChain = new ArrayList<Handler>();
- handlerChain.addAll(jaxwsHandlerChain);
- return handlerChain;
+ return Collections.unmodifiableList(jaxwsHandlerChain);
}
public void setHandlerChain(List<Handler> handlerChain)
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -24,7 +24,6 @@
// $Id$
import java.rmi.RemoteException;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Observable;
@@ -323,9 +322,9 @@
throw new NotImplementedException();
}
- public void setConfigName(String configName)
+ public void setConfigName(String configName, String configFile)
{
ConfigurationProvider configProvider =
(ConfigurationProvider)getEndpointMetaData();
- configProvider.setConfigName(configName);
+ configProvider.setConfigName(configName, configFile);
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceExt.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceExt.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceExt.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -60,27 +60,28 @@
}
/**
- * Set the port configuration file for newly created ports
+ * Get the port configuration name for newly created ports
*/
- public void setConfigFile(String configFile)
+ public String getConfigName()
{
- this.configFile = configFile;
+ return configName;
}
/**
- * Get the port configuration name for newly created ports
+ * Set the port configuration name for newly created ports
*/
- public String getConfigName()
+ public void setConfigName(String configName)
{
- return configName;
+ this.configName = configName;
}
/**
* Set the port configuration name for newly created ports
*/
- public void setConfigName(String configName)
+ public void setConfigName(String configName, String configFile)
{
this.configName = configName;
+ this.configFile = configFile;
}
@Override
@@ -126,9 +127,7 @@
private void configurePort(Object port)
{
ConfigProvider cp = (ConfigProvider)port;
- if (configFile != null)
- cp.setConfigFile(configFile);
if (configName != null)
- cp.setConfigName(configName);
+ cp.setConfigName(configName, configFile);
}
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/ServiceObjectFactory.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -218,10 +218,8 @@
log.debug("Configure Service: [configName=" + configName +
",configFile=" + configFile + "]");
ConfigProvider cp = (ConfigProvider)service;
- if (configFile != null)
- cp.setConfigFile(configFile);
if (configName != null)
- cp.setConfigName(configName);
+ cp.setConfigName(configName, configFile);
}
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -97,7 +97,7 @@
if(usRef!=null)
vfsRoot = usRef.getRootFile();
else
- vfsRoot = new DefaultFileAdapter();
+ vfsRoot = new ResourceLoaderAdapter();
if (wsdlURL != null)
{
@@ -390,10 +390,8 @@
log.debug("No matching port configuration for: [portName=" + portName
+ ",seiName=" + seiName + "]");
log.debug("Configure Stub: [configName=" + configName +
",configFile=" + configFile + "]");
- if (configFile != null)
- stub.setConfigFile(configFile);
if (configName != null)
- stub.setConfigName(configName);
+ stub.setConfigName(configName, configFile);
}
@Override
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -100,7 +100,7 @@
if(null == serviceMetaData.getSecurityConfiguration()) // might be set through
ServiceObjectFactory
{
- UnifiedVirtualFile vfsRoot = serviceMetaData.getUnifiedMetaData().getVfsRoot();
+ UnifiedVirtualFile vfsRoot =
serviceMetaData.getUnifiedMetaData().getRootFile();
boolean successful = false;
WSSecurityConfiguration config = null;
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -94,7 +94,7 @@
if(null == serviceMetaData.getSecurityConfiguration()) // might be set through
ServiceObjectFactory
{
- UnifiedVirtualFile vfsRoot = serviceMetaData.getUnifiedMetaData().getVfsRoot();
+ UnifiedVirtualFile vfsRoot =
serviceMetaData.getUnifiedMetaData().getRootFile();
boolean successful = false;
WSSecurityConfiguration config = null;
try
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -101,8 +101,7 @@
log.debug("START buildMetaData: [service=" + serviceQName +
"]");
try
{
- DefaultFileAdapter vfsRoot = new DefaultFileAdapter();
- vfsRoot.setLoader(loader);
+ ResourceLoaderAdapter vfsRoot = new ResourceLoaderAdapter(loader);
UnifiedMetaData wsMetaData = new UnifiedMetaData(vfsRoot);
wsMetaData.setClassLoader(loader);
@@ -127,7 +126,7 @@
if (securityConfig != null)
{
serviceMetaData.setSecurityConfiguration(securityConfig);
- setupSecurity(securityConfig, wsMetaData.getVfsRoot());
+ setupSecurity(securityConfig, wsMetaData.getRootFile());
}
buildMetaDataInternal(serviceMetaData, wsdlDefinitions, javaWsdlMapping,
serviceRefMetaData);
@@ -185,13 +184,10 @@
// config-name, config-file
if (serviceRefMetaData != null)
{
- String configName = serviceRefMetaData.getConfigName();
- if (configName != null)
- epMetaData.setConfigName(configName);
-
+ String configName= serviceRefMetaData.getConfigName();
String configFile = serviceRefMetaData.getConfigFile();
- if (configFile != null)
- epMetaData.setConfigFile(configFile);
+ if (configName != null)
+ epMetaData.setConfigName(configName, configFile);
}
// Init the endpoint binding
@@ -224,8 +220,11 @@
private void setupHandlers(UnifiedServiceRefMetaData serviceRefMetaData, QName
portName, EndpointMetaData epMetaData)
{
// Add pre handlers
+ UnifiedVirtualFile vfsRoot = epMetaData.getRootFile();
+ String configName = epMetaData.getConfigName();
+ String configFile = epMetaData.getConfigFile();
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- ClientConfigJAXRPC jaxrpcConfig =
(ClientConfigJAXRPC)factory.getConfig(epMetaData.getConfigName(),
epMetaData.getConfigFile());
+ ClientConfigJAXRPC jaxrpcConfig = (ClientConfigJAXRPC)factory.getConfig(vfsRoot,
configName, configFile);
epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.PRE));
// Setup the endpoint handlers
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -24,6 +24,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedVirtualFile;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
import org.jboss.ws.metadata.j2ee.*;
@@ -100,7 +101,7 @@
// Assign the WS-Security configuration,
WSSecurityConfigFactory wsseConfFactory =
WSSecurityConfigFactory.newInstance();
WSSecurityConfiguration securityConfiguration =
wsseConfFactory.createConfiguration(
- wsMetaData.getVfsRoot(), WSSecurityOMFactory.SERVER_RESOURCE_NAME
+ wsMetaData.getRootFile(), WSSecurityOMFactory.SERVER_RESOURCE_NAME
);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
@@ -154,13 +155,10 @@
throw new WSException("Cannot obtain UnifiedBeanMetaData for:
" + linkName);
String configName = apMetaData.getConfigName();
+ String configFile = apMetaData.getConfigFile();
if (configName != null)
- sepMetaData.setConfigName(configName);
+ sepMetaData.setConfigName(configName, configFile);
- String configFile = apMetaData.getConfigFile();
- if (configFile != null)
- sepMetaData.setConfigFile(configFile);
-
UnifiedEjbPortComponentMetaData bpcMetaData =
beanMetaData.getPortComponent();
if (bpcMetaData != null)
{
@@ -192,13 +190,10 @@
serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
String configName = webMetaData.getConfigName();
+ String configFile = webMetaData.getConfigFile();
if (configName != null)
- sepMetaData.setConfigName(configName);
+ sepMetaData.setConfigName(configName, configFile);
- String configFile = webMetaData.getConfigFile();
- if (configFile != null)
- sepMetaData.setConfigFile(configFile);
-
initTransportGuaranteeJSE(udi, sepMetaData, linkName);
}
@@ -222,8 +217,11 @@
setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
// Add pre handlers
+ UnifiedVirtualFile vfsRoot = sepMetaData.getRootFile();
+ String configName = sepMetaData.getConfigName();
+ String configFile = sepMetaData.getConfigFile();
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- EndpointConfigJAXRPC jaxrpcConfig =
(EndpointConfigJAXRPC)factory.getConfig(sepMetaData.getConfigName(),
sepMetaData.getConfigFile());
+ EndpointConfigJAXRPC jaxrpcConfig =
(EndpointConfigJAXRPC)factory.getConfig(vfsRoot, configName, configFile);
sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData,
HandlerType.PRE));
// Setup the endpoint handlers
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -97,7 +97,7 @@
*/
public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL)
{
- return buildMetaData(serviceName, wsdlURL, new DefaultFileAdapter());
+ return buildMetaData(serviceName, wsdlURL, new ResourceLoaderAdapter());
}
private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions
wsdlDefinitions) throws IOException
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -34,7 +34,7 @@
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.DefaultFileAdapter;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
/**
* A server side meta data builder that is based on JSR-181 annotations
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -29,7 +29,7 @@
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.DefaultFileAdapter;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
/**
* A server side meta data builder that is based on JSR-181 annotations
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -62,19 +62,17 @@
if (anEndpointConfig== null)
return;
- // setup config name
+ String configName = null;
+ String configFile = null;
+
if (anEndpointConfig.configName().length() > 0)
- {
- String configName = anEndpointConfig.configName();
- sepMetaData.setConfigName(configName);
- }
+ configName = anEndpointConfig.configName();
- // setup config file
if (anEndpointConfig.configFile().length() > 0)
- {
- String configFile = anEndpointConfig.configFile();
- sepMetaData.setConfigFile(configFile);
- }
+ configFile = anEndpointConfig.configFile();
+
+ if (configName != null)
+ sepMetaData.setConfigName(configName, configFile);
}
protected void processWebContext(UnifiedDeploymentInfo udi, Class<?> wsClass,
String linkName, ServerEndpointMetaData sepMetaData)
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -90,7 +90,7 @@
// Assign the WS-Security configuration,
WSSecurityConfigFactory wsseConfFactory =
WSSecurityConfigFactory.newInstance();
WSSecurityConfiguration securityConfiguration =
wsseConfFactory.createConfiguration(
- wsMetaData.getVfsRoot(), WSSecurityOMFactory.SERVER_RESOURCE_NAME
+ wsMetaData.getRootFile(), WSSecurityOMFactory.SERVER_RESOURCE_NAME
);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/ConfigurationProvider.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/ConfigurationProvider.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/ConfigurationProvider.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -52,9 +52,9 @@
String getConfigFile();
- void setConfigFile(String configFile);
-
String getConfigName();
void setConfigName(String configName);
+
+ void setConfigName(String configName, String configFile);
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -23,22 +23,23 @@
//$Id$
+import java.io.IOException;
+import java.net.URL;
+
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.UnifiedVirtualFile;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.config.binding.OMFactoryJAXRPC;
import org.jboss.ws.metadata.config.binding.OMFactoryJAXWS;
import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.w3c.dom.Element;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
/**
* A factory for the JBossWS endpoint/client configuration
*
@@ -50,8 +51,8 @@
// provide logging
private final Logger log = Logger.getLogger(JBossWSConfigFactory.class);
- private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
- private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
+ private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
+ private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
// Hide constructor
private JBossWSConfigFactory()
@@ -95,7 +96,8 @@
{
throw new WSException("Error while parsing configuration", e);
}
- catch (IOException e) {
+ catch (IOException e)
+ {
throw new WSException("Failed to read config file: " + configURL, e);
}
@@ -118,17 +120,21 @@
/**
* @return config - cannot be null
*/
- public CommonConfig getConfig(String configName, String configFile)
+ public CommonConfig getConfig(UnifiedVirtualFile vfsRoot, String configName, String
configFile)
{
- CommonConfig config;
-
log.debug("getConfig: [name=" + configName + ",url=" +
configFile + "]");
+ if (configName == null)
+ throw new IllegalArgumentException("Config name cannot be null");
+ if (configFile == null)
+ throw new IllegalArgumentException("Config file cannot be null");
+
// Get the config root
- URL configURL = filenameToURL(configFile);
+ URL configURL = filenameToURL(vfsRoot, configFile);
Object configRoot = parse(configURL);
// Get the endpoint config
+ CommonConfig config;
if (configRoot instanceof ConfigRootJAXRPC)
{
config = ((ConfigRootJAXRPC)configRoot).getConfigByName(configName);
@@ -141,31 +147,37 @@
if (config == null)
throw new WSException("Cannot obtain config: " + configName);
-
return config;
}
- private static URL filenameToURL(String configFile) {
+ private URL filenameToURL(UnifiedVirtualFile vfsRoot, String configFile)
+ {
URL configURL = null;
try
{
- configURL = new URL(configFile);
+ configURL = vfsRoot.findChild(configFile).toURL();
}
- catch (MalformedURLException ex)
+ catch (IOException ex)
{
// ignore
}
-
+
// Try to get the URL as resource
if (configURL == null)
{
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- configURL = cl.getResource(configFile);
- if (configURL == null)
- throw new WSException("Cannot get resource: " + configFile);
+ try
+ {
+ configURL = new ResourceLoaderAdapter().findChild(configFile).toURL();
+ }
+ catch (IOException ex)
+ {
+ // ignore
+ }
}
-
+
+ if (configURL == null)
+ throw new WSException("Cannot find configFile: " + configFile);
+
return configURL;
}
-
}
Deleted:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/DefaultFileAdapter.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/DefaultFileAdapter.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/DefaultFileAdapter.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -1,118 +0,0 @@
-/*
- * 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.metadata.umdm;
-
-import org.jboss.ws.core.server.UnifiedVirtualFile;
-
-import java.io.IOException;
-import java.io.File;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-/**
- * The default file adapter loads resources through an associated classloader.
- * If no classload is set, the the thread context classloader will be used.
- *
- * @author Heiko.Braun(a)jboss.org
- * @version $Id$
- * @since 25.01.2007
- */
-public class DefaultFileAdapter implements UnifiedVirtualFile {
-
- private URL location;
- private ClassLoader loader;
-
- public DefaultFileAdapter(URL location) {
- this.location = location;
- }
-
- public DefaultFileAdapter() {
- }
-
- public UnifiedVirtualFile findChild(String child) throws IOException
- {
-
- URL loc = null;
- if (child != null)
- {
- // Try the child as URL
- try
- {
- loc = new URL(child);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (loc == null)
- {
- try
- {
- File file = new File(child);
- if (file.exists())
- loc = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (loc == null)
- {
- try
- {
- loc = getLoader().getResource(child);
- }
- catch (Exception ex)
- {
- // ignore
- }
- }
-
- }
-
- if (loc == null)
- throw new IllegalArgumentException("Cannot get URL for: " + child);
-
- return new DefaultFileAdapter(loc);
- }
-
- public URL toURL() {
- if(null == this.location)
- throw new IllegalStateException("UnifiedVirtualFile not
initialized");
- return location;
- }
-
- public void setLoader(ClassLoader loader) {
- this.loader = loader;
- }
-
- public ClassLoader getLoader() {
- if(null == this.loader)
- loader = Thread.currentThread().getContextClassLoader();
- return loader;
- }
-}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -52,6 +52,7 @@
import org.jboss.ws.core.jaxrpc.binding.SOAPArraySerializerFactory;
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
+import org.jboss.ws.core.server.UnifiedVirtualFile;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.config.Configurable;
@@ -66,8 +67,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 12-May-2005
*/
-public abstract class EndpointMetaData extends ExtensibleMetaData
- implements ConfigurationProvider, Configurable
+public abstract class EndpointMetaData extends ExtensibleMetaData implements
ConfigurationProvider, Configurable
{
// provide logging
private static Logger log = Logger.getLogger(EndpointMetaData.class);
@@ -169,10 +169,8 @@
public void setBindingId(String bindingId)
{
- if (!Constants.SOAP11HTTP_BINDING.equals(bindingId)
- && !Constants.SOAP12HTTP_BINDING.equals(bindingId)
- && !Constants.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
- && !Constants.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
+ if (!Constants.SOAP11HTTP_BINDING.equals(bindingId) &&
!Constants.SOAP12HTTP_BINDING.equals(bindingId) &&
!Constants.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
+ && !Constants.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
{
throw new WSException("Unsupported binding: " + bindingId);
}
@@ -399,10 +397,10 @@
boolean doesMatch = aux.getJavaMethod().equals(method);
// fallback for async methods
- if(!doesMatch &&
method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ if (!doesMatch &&
method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
{
String name = method.getName();
- name = name.substring(0, name.length()-5);
+ name = name.substring(0, name.length() - 5);
doesMatch = aux.getJavaName().equals(name);
}
@@ -530,7 +528,8 @@
List<Class> types = typeMapping.getJavaTypes(xmlType);
boolean registered = false;
- for (Class current : types) {
+ for (Class current : types)
+ {
if (current.getName().equals(javaTypeName))
{
registered = true;
@@ -584,28 +583,29 @@
*
* @param configurable
*/
- public void configure(Configurable configurable) {
+ public void configure(Configurable configurable)
+ {
// emit notificatins when the config changes
registerConfigObserver(configurable);
- if(null == config)
+ if (null == config)
{
- log.trace("Create new config: " +
getConfigFile()+":"+getConfigName());
+ log.trace("Create new config: " + getConfigFile() + ":" +
getConfigName());
JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- config = factory.getConfig(getConfigName(), getConfigFile());
+ config = factory.getConfig(getRootFile(), getConfigName(), getConfigFile());
}
else
{
- log.trace("Reusing cached config. Current should be: " +
getConfigFile()+":"+getConfigName());
+ log.trace("Reusing cached config. Current should be: " +
getConfigFile() + ":" + getConfigName());
}
// SOAPBinding configuration
- if(configurable instanceof CommonBindingProvider)
+ if (configurable instanceof CommonBindingProvider)
{
log.debug("Configure SOAPBinding");
- if(config.hasFeature(EndpointFeature.MTOM))
+ if (config.hasFeature(EndpointFeature.MTOM))
{
CommonBindingProvider provider = (CommonBindingProvider)configurable;
((CommonSOAPBinding)provider.getCommonBinding()).setMTOMEnabled(true);
@@ -614,7 +614,7 @@
}
// Configure EndpointMetaData
- else if(configurable instanceof EndpointMetaData)
+ else if (configurable instanceof EndpointMetaData)
{
log.debug("Configure EndpointMetaData");
@@ -636,11 +636,16 @@
log.debug("Added " + preHandlers.size() + " PRE handlers");
log.debug("Added " + postHandlers.size() + " POST
handlers");
}
+ }
+ public UnifiedVirtualFile getRootFile()
+ {
+ return getServiceMetaData().getUnifiedMetaData().getRootFile();
}
- public void registerConfigObserver(Configurable observer) {
- this.configObservable.addObserver(observer);
+ public void registerConfigObserver(Configurable observer)
+ {
+ this.configObservable.addObserver(observer);
}
public String getConfigFile()
@@ -648,12 +653,6 @@
return this.configFile;
}
- public void setConfigFile(String configFile)
- {
- this.configFile = configFile;
- this.config = null;
- }
-
public String getConfigName()
{
return this.configName;
@@ -661,32 +660,48 @@
public void setConfigName(String configName)
{
- if(null == configName)
- throw new IllegalArgumentException("Invalid config name: " +
configName);
+ setConfigNameInternal(configName, null);
+ }
- if( !configName.equals(this.configName) )
+ public void setConfigName(String configName, String configFile)
+ {
+ setConfigNameInternal(configName, configFile);
+ }
+
+ private void setConfigNameInternal(String configName, String configFile)
+ {
+ if (configName == null)
+ throw new IllegalArgumentException("Config name cannot be null");
+
+ if (configFile != null)
+ this.configFile = configFile;
+
+ if (configName.equals(this.configName) == false)
{
this.configName = configName;
this.config = null;
// notify observers
- log.debug("Reconfiguration forced, new config is
'"+configName+"'");
+ log.debug("Reconfiguration forced, new config is '" + configName +
"'");
this.configObservable.doNotify(configName);
}
}
-
+
public List<Class> getRegisteredTypes()
{
return Collections.unmodifiableList(registeredTypes);
}
- public void update(Observable observable, Object object) {
+ public void update(Observable observable, Object object)
+ {
log.trace("Ingore configuration change notification");
}
- class ConfigObservable extends Observable {
+ class ConfigObservable extends Observable
+ {
- public void doNotify(Object object) {
+ public void doNotify(Object object)
+ {
setChanged();
notifyObservers(object);
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -69,7 +69,7 @@
public OperationMetaData(QName qname, String javaName)
{
- UnifiedMetaData umd = new UnifiedMetaData(new DefaultFileAdapter());
+ UnifiedMetaData umd = new UnifiedMetaData(new ResourceLoaderAdapter());
ServiceMetaData smd = new ServiceMetaData(umd, new
QName("mock-service"));
ServerEndpointMetaData epmd = new ServerEndpointMetaData(smd, new
QName("mock-endpoint"), new QName("mock-interface"), Type.JAXRPC);
initOperationMetaData(epmd, qname, javaName);
Copied:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
(from rev 2131,
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/DefaultFileAdapter.java)
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
(rev 0)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -0,0 +1,122 @@
+/*
+ * 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.metadata.umdm;
+
+// $Id: $
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.ws.core.server.UnifiedVirtualFile;
+
+/**
+ * The default file adapter loads resources through an associated classloader.
+ * If no classload is set, the the thread context classloader will be used.
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @since 25.01.2007
+ */
+public class ResourceLoaderAdapter implements UnifiedVirtualFile
+{
+ private URL location;
+ private ClassLoader loader;
+
+ public ResourceLoaderAdapter()
+ {
+ this(Thread.currentThread().getContextClassLoader());
+ }
+
+ public ResourceLoaderAdapter(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ private ResourceLoaderAdapter(ClassLoader loader, URL location)
+ {
+ this.location = location;
+ this.loader = loader;
+ }
+
+ public UnifiedVirtualFile findChild(String resourcePath) throws IOException
+ {
+ URL resourceURL = null;
+ if (resourcePath != null)
+ {
+ // Try the child as URL
+ try
+ {
+ resourceURL = new URL(resourcePath);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (resourceURL == null)
+ {
+ try
+ {
+ File file = new File(resourcePath);
+ if (file.exists())
+ resourceURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (resourceURL == null)
+ {
+ try
+ {
+ resourceURL = loader.getResource(resourcePath);
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (resourceURL == null)
+ throw new IOException("Cannot get URL for: " + resourcePath);
+
+ return new ResourceLoaderAdapter(loader, resourceURL);
+ }
+
+ public URL toURL()
+ {
+ if (null == this.location)
+ throw new IllegalStateException("UnifiedVirtualFile not
initialized");
+ return location;
+ }
+
+ public ClassLoader getResourceLoader()
+ {
+ return loader;
+ }
+}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/UnifiedMetaData.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -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.metadata.umdm;
// $Id$
@@ -79,11 +79,11 @@
// Used by validate
private boolean validated;
- public UnifiedMetaData(UnifiedVirtualFile vfsRoot) {
+ public UnifiedMetaData(UnifiedVirtualFile vfsRoot)
+ {
+ if (vfsRoot == null)
+ throw new IllegalArgumentException("VFS root cannot be null");
- if(null==vfsRoot)
- throw new IllegalArgumentException("VFS root cannot be null");
-
this.vfsRoot = vfsRoot;
this.classLoader = Thread.currentThread().getContextClassLoader();
}
@@ -91,12 +91,13 @@
public ClassLoader getClassLoader()
{
if (classLoader == null)
- throw new IllegalStateException ("Class loader not available");
-
+ throw new IllegalStateException("Class loader not available");
+
return classLoader;
}
- public UnifiedVirtualFile getVfsRoot() {
+ public UnifiedVirtualFile getRootFile()
+ {
return vfsRoot;
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsUnifiedMetaDataBuilder.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -35,7 +35,7 @@
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.DefaultFileAdapter;
+import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.tools.Configuration.OperationConfig;
@@ -85,8 +85,7 @@
throw new WSException("A service endpoint interface should extend
Remote");
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- DefaultFileAdapter vfsRoot = new DefaultFileAdapter();
- vfsRoot.setLoader(contextClassLoader);
+ ResourceLoaderAdapter vfsRoot = new ResourceLoaderAdapter();
um = new UnifiedMetaData(vfsRoot);
um.setClassLoader(contextClassLoader);
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/ClientHandler.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -21,24 +21,18 @@
*/
package org.jboss.test.ws.jaxws.binding;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
/**
- * A client side handler for the ws-addressing
+ * A client side handler
*
* @author Thomas.Diesler(a)jboss.org
* @since 24-Nov-2005
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -24,6 +24,7 @@
// $Id: $
import java.net.URL;
+import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
@@ -58,8 +59,10 @@
SOAPEndpoint port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
BindingProvider provider = (BindingProvider)port;
- List<Handler> handlerChain = provider.getBinding().getHandlerChain();
+ List<Handler> handlerChain = new ArrayList<Handler>();
+ handlerChain.addAll(provider.getBinding().getHandlerChain());
handlerChain.add(new ClientHandler());
+ provider.getBinding().setHandlerChain(handlerChain);
String nsURI = port.namespace();
assertEquals(Constants.NS_SOAP12_ENV + ":" + Constants.NS_SOAP12_ENV,
nsURI);
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpoint.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpoint.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpoint.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -21,13 +21,13 @@
*/
package org.jboss.test.ws.jaxws.binding;
-import javax.jws.WebMethod;
+//$Id: $
+
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.ws.BindingType;
-// $Id: $
@WebService(name = "SOAPEndpoint", targetNamespace =
"http://org.jboss.ws/jaxws/binding")
@SOAPBinding(style = Style.RPC)
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java 2007-01-26
11:12:01 UTC (rev 2135)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java 2007-01-26
13:37:04 UTC (rev 2136)
@@ -24,21 +24,18 @@
// $Id: $
import javax.annotation.Resource;
-import javax.jws.WebMethod;
import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.Style;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingType;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import org.jboss.logging.Logger;
-@WebService(name="SOAPEndpoint",
targetNamespace="http://org.jboss.ws/jaxws/binding", endpointInterface =
"org.jboss.test.ws.jaxws.binding.SOAPEndpoint")
+@WebService(name="SOAPEndpoint",
targetNamespace="http://org.jboss.ws/jaxws/binding",
+ endpointInterface = "org.jboss.test.ws.jaxws.binding.SOAPEndpoint")
public class SOAPEndpointBean implements SOAPEndpoint
{
private static Logger log = Logger.getLogger(SOAPEndpointBean.class);