Author: thomas.diesler(a)jboss.com
Date: 2007-07-27 05:29:58 -0400 (Fri, 27 Jul 2007)
New Revision: 4020
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicService.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Service.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.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/JAXWSProviderMetaDataBuilder.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/umdm/OperationMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java
Log:
Make Endpoint mandatory in ServerEndpointMetaData
Modified:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicService.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicService.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicService.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -69,6 +69,23 @@
return endpoints;
}
+ public Endpoint getEndpointByName(String shortName)
+ {
+ if (shortName == null)
+ throw new IllegalArgumentException("shortName cannot be null");
+
+ Endpoint retEndpoint = null;
+ for (Endpoint ep : endpoints)
+ {
+ if (ep.getShortName().equals(shortName))
+ {
+ retEndpoint = ep;
+ break;
+ }
+ }
+ return retEndpoint;
+ }
+
public String getContextRoot()
{
return contextRoot;
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Service.java
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -47,6 +47,9 @@
/** Get the list of endpoints */
List<Endpoint> getEndpoints();
+ /** Get an endpoint by name */
+ Endpoint getEndpointByName(String simpleName);
+
/** Get the context root for this service */
String getContextRoot();
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -45,7 +45,6 @@
import org.jboss.ws.core.server.HttpServer;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.w3c.dom.Element;
@@ -74,7 +73,7 @@
public EndpointImpl(String bindingId, Object implementor)
{
- if(log.isDebugEnabled()) log.debug("new EndpointImpl(bindingId=" +
bindingId + ",implementor=" + implementor + ")");
+ log.debug("new EndpointImpl(bindingId=" + bindingId +
",implementor=" + implementor + ")");
if (implementor == null)
throw new IllegalArgumentException("Implementor cannot be null");
@@ -105,7 +104,7 @@
@Override
public void publish(String address)
{
- if(log.isDebugEnabled()) log.debug("publish: " + address);
+ log.debug("publish: " + address);
URI addrURI;
try
@@ -142,7 +141,7 @@
@Override
public void publish(Object context)
{
- if(log.isDebugEnabled()) log.debug("publish: " + context);
+ log.debug("publish: " + context);
if (isDestroyed)
throw new IllegalStateException("Endpoint already destroyed");
@@ -155,7 +154,7 @@
try
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ServerConfig serverConfig =
spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
isStandalone = false;
}
catch (Exception ex)
@@ -179,8 +178,8 @@
@Override
public void stop()
{
- if(log.isDebugEnabled()) log.debug("stop");
-
+ log.debug("stop");
+
if (serverContext == null || isPublished == false)
log.error("Endpoint not published");
@@ -245,7 +244,6 @@
properties = map;
}
-
private void checkPublishEndpointPermission()
{
// 5.10 Conformance (Checking publishEndpoint Permission): When any of the publish
methods defined
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -138,7 +138,7 @@
String linkName = sepMetaData.getLinkName();
if (linkName != null)
{
- Endpoint endpoint = getEndpointByName(dep, linkName);
+ Endpoint endpoint = dep.getService().getEndpointByName(linkName);
if (endpoint != null)
urlPattern = endpoint.getURLPattern();
}
@@ -175,23 +175,6 @@
sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath));
}
- private Endpoint getEndpointByName(Deployment dep, String shortName)
- {
- if (shortName == null)
- throw new IllegalArgumentException("shortName cannot be null");
-
- Endpoint retEndpoint = null;
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- if (ep.getShortName().equals(shortName))
- {
- retEndpoint = ep;
- break;
- }
- }
- return retEndpoint;
- }
-
public static ObjectName createServiceEndpointID(Deployment dep,
ServerEndpointMetaData sepMetaData)
{
String linkName = sepMetaData.getLinkName();
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-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -43,6 +43,7 @@
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
@@ -111,6 +112,7 @@
PortComponentMetaData[] pcMetaDataArr = wsdMetaData.getPortComponents();
for (PortComponentMetaData pcMetaData : pcMetaDataArr)
{
+ String linkName = pcMetaData.getEjbLink() != null ?
pcMetaData.getEjbLink() : pcMetaData.getServletLink();
QName portName = pcMetaData.getWsdlPort();
// JBWS-722
@@ -131,9 +133,9 @@
serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getName());
QName interfaceQName = wsdlEndpoint.getInterface().getName();
- ServerEndpointMetaData sepMetaData = new
ServerEndpointMetaData(serviceMetaData, portName, interfaceQName, Type.JAXRPC);
+ Endpoint ep = dep.getService().getEndpointByName(linkName);
+ ServerEndpointMetaData sepMetaData = new
ServerEndpointMetaData(serviceMetaData, ep, portName, interfaceQName, Type.JAXRPC);
sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
- String linkName = pcMetaData.getEjbLink() != null ?
pcMetaData.getEjbLink() : pcMetaData.getServletLink();
sepMetaData.setLinkName(linkName);
serviceMetaData.addEndpoint(sepMetaData);
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -49,6 +49,7 @@
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
/**
* A server side meta data builder that is based on JSR-181 annotations
@@ -99,7 +100,9 @@
// Setup the ServerEndpointMetaData
QName portQName = new QName(targetNS, portName);
QName portTypeQName = new QName(targetNS, name);
- ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData,
portQName, portTypeQName, Type.JAXWS);
+
+ Endpoint ep = dep.getService().getEndpointByName(linkName);
+ ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData,
ep, portQName, portTypeQName, Type.JAXWS);
sepMetaData.setLinkName(linkName);
sepMetaData.setStyle(Style.DOCUMENT);
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-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -60,6 +60,7 @@
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
@@ -104,7 +105,7 @@
{
try
{
- EndpointResult result = processWebService(dep, wsMetaData, sepClass);
+ EndpointResult result = processWebService(dep, wsMetaData, sepClass, linkName);
// Clear the java types, etc.
resetMetaDataBuilder(dep.getInitialClassLoader());
@@ -275,13 +276,14 @@
}
}
- private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData,
Class<?> sepClass)
- throws ClassNotFoundException, IOException
+ private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData,
Class<?> sepClass, String linkName) throws ClassNotFoundException, IOException
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
if (anWebService == null)
throw new WSException("Cannot obtain @WebService annotation from: " +
sepClass.getName());
+ Endpoint ep = dep.getService().getEndpointByName(linkName);
+
Class<?> seiClass = null;
String seiName;
WSDLUtils wsdlUtils = WSDLUtils.getInstance();
@@ -340,11 +342,11 @@
EndpointResult result = new EndpointResult();
result.serviceMetaData = new ServiceMetaData(wsMetaData, new QName(serviceNS,
serviceName));
- result.sepMetaData = new ServerEndpointMetaData(result.serviceMetaData, portQName,
portTypeQName, EndpointMetaData.Type.JAXWS);
+ result.sepMetaData = new ServerEndpointMetaData(result.serviceMetaData, ep,
portQName, portTypeQName, EndpointMetaData.Type.JAXWS);
result.epClass = (seiClass != null ? seiClass : sepClass);
result.serviceMetaData.addEndpoint(result.sepMetaData);
wsMetaData.addService(result.serviceMetaData);
-
+
if (dep instanceof ArchiveDeployment)
result.wsdlLocation =
((ArchiveDeployment)dep).getMetaDataFileURL(wsdlLocation);
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-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -68,14 +68,6 @@
private List<FaultMetaData> faults = new ArrayList<FaultMetaData>();
private ParameterMetaData returnParam;
- public OperationMetaData(QName qname, String javaName)
- {
- 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);
- }
-
public OperationMetaData(EndpointMetaData epMetaData, QName qname, String javaName)
{
log.trace("new OperationMetaData: [xmlName=" + qname +
",javaName=" + javaName + "]");
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -73,11 +73,12 @@
// The optional secure wsdl access
private boolean secureWSDLAccess;
- public ServerEndpointMetaData(ServiceMetaData service, QName portName, QName
portTypeName, Type type)
+ public ServerEndpointMetaData(ServiceMetaData service, Endpoint endpoint, QName
portName, QName portTypeName, Type type)
{
super(service, portName, portTypeName, type);
+ this.endpoint = endpoint;
+
super.configName = ConfigurationProvider.DEFAULT_ENDPOINT_CONFIG_NAME;
-
if (type == Type.JAXRPC)
configFile = ConfigurationProvider.DEFAULT_JAXRPC_ENDPOINT_CONFIG_FILE;
else
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java
===================================================================
---
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java 2007-07-27
06:52:56 UTC (rev 4019)
+++
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java 2007-07-27
09:29:58 UTC (rev 4020)
@@ -63,7 +63,7 @@
ServiceMetaData serviceMetaData = new ServiceMetaData(umd, serviceName);
QName portName = new QName("http://org.jboss.ws/jaxws/endpoint",
"EndpointInterfacePort");
QName portTypeName = new QName("http://org.jboss.ws/jaxws/endpoint",
"EndpointInterface");
- EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData, portName,
portTypeName, Type.JAXWS);
+ EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData, null,
portName, portTypeName, Type.JAXWS);
Map<String, Class> map = new HashMap<String, Class>();
map.put("http://schemas.xmlsoap.org/ws/2005/02/rm/policy",
NopAssertionDeployer.class);
@@ -112,7 +112,7 @@
UnifiedMetaData umd = new UnifiedMetaData(vfRoot);
ServiceMetaData serviceMetaData = new ServiceMetaData(umd, new
QName("dummyServiceName"));
umd.addService(serviceMetaData);
- EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData, new
QName("dummyPortName"), new QName("dummyPortTypeName"), Type.JAXWS);
+ EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData, null, new
QName("dummyPortName"), new QName("dummyPortTypeName"), Type.JAXWS);
serviceMetaData.addEndpoint(epMetaData);
builder.processPolicyAnnotations(epMetaData, TestMultipleEndpointPolicy.class);