JBossWS SVN: r14968 - in common/trunk/src/main/java/org/jboss/ws/common: integration and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-09-10 08:45:18 -0400 (Sat, 10 Sep 2011)
New Revision: 14968
Added:
common/trunk/src/main/java/org/jboss/ws/common/integration/EndpointTypeFilterImpl.java
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java
common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
Log:
[JBWS-3349] code review
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -36,8 +36,8 @@
import org.jboss.ws.common.injection.PreDestroyHolder;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.wsf.spi.deployment.EndpointState;
+import org.jboss.wsf.spi.deployment.EndpointType;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
@@ -62,6 +62,7 @@
protected String targetBean;
protected Class<?> targetBeanClass;
protected EndpointState state;
+ protected EndpointType type;
protected RequestHandler requestHandler;
protected InvocationHandler invocationHandler;
protected LifecycleHandler lifecycleHandler;
@@ -69,7 +70,6 @@
protected String address;
protected List<RecordProcessor> recordProcessors = new Vector<RecordProcessor>();
protected SecurityDomainContext securityDomainContext;
- protected EndpointType type;
AbstractDefaultEndpoint(String targetBean)
{
@@ -169,6 +169,16 @@
this.state = state;
}
+ public EndpointType getType()
+ {
+ return type;
+ }
+
+ public void setType(EndpointType type)
+ {
+ this.type = type;
+ }
+
public RequestHandler getRequestHandler()
{
return requestHandler;
@@ -297,13 +307,5 @@
{
this.securityDomainContext = securityDomainContext;
}
- public void setType(EndpointType type)
- {
- this.type = type;
- }
-
- public EndpointType getType()
- {
- return this.type;
- }
+
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -45,7 +45,7 @@
private static final ResourceBundle bundle = BundleUtils.getBundle(ContextRootDeploymentAspect.class);
@Override
public void start(Deployment dep)
- {
+ {
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
{
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -23,6 +23,8 @@
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentState;
+import org.jboss.wsf.spi.deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Service;
/**
@@ -39,6 +41,8 @@
private String simpleName;
// A deployment has one service
private Service service;
+ // The type of this deployment
+ private DeploymentType type;
// The state for this deployment
private DeploymentState state;
// The deployment class loader
@@ -105,4 +109,13 @@
this.state = deploymentState;
}
+ public DeploymentType getType()
+ {
+ return type;
+ }
+
+ public void setType(DeploymentType deploymentType)
+ {
+ this.type = deploymentType;
+ }
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -25,6 +25,7 @@
import javax.naming.Context;
+import org.jboss.wsf.spi.deployment.EndpointType;
import org.jboss.wsf.spi.deployment.JMSEndpoint;
import org.jboss.wsf.spi.management.EndpointMetrics;
@@ -106,4 +107,5 @@
{
}
+
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -26,7 +26,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
+import org.jboss.wsf.spi.deployment.EndpointState;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
import org.jboss.wsf.spi.invocation.InvocationHandler;
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -22,12 +22,12 @@
package org.jboss.ws.common.deployment;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
+import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -71,9 +71,9 @@
{
return endpoints;
}
-
-
- public List<Endpoint> getEndpoints(EndpointTypeFilter filter)
+
+ @Override
+ public List<Endpoint> getEndpoints(final EndpointTypeFilter filter)
{
List<Endpoint> result = new LinkedList<Endpoint>();
for (Endpoint endpoint : endpoints)
@@ -84,8 +84,7 @@
}
}
return result;
- }
-
+ }
public Endpoint getEndpointByName(String shortName)
{
@@ -129,6 +128,6 @@
public void setVirtualHosts(List<String> virtualHosts)
{
this.virtualHosts = virtualHosts;
- }
+ }
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -29,7 +29,7 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
+import org.jboss.wsf.spi.deployment.DeploymentState;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -21,6 +21,10 @@
*/
package org.jboss.ws.common.deployment;
+import static org.jboss.ws.common.integration.WSHelper.isJaxrpcDeployment;
+import static org.jboss.ws.common.integration.WSHelper.isJaxwsJseEndpoint;
+import static org.jboss.ws.common.integration.WSHelper.isJaxwsEjbEndpoint;
+
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -34,7 +38,6 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
@@ -118,10 +121,12 @@
}
}
- protected boolean isConfidentialTransportGuarantee(Deployment dep, Endpoint ep)
+ protected boolean isConfidentialTransportGuarantee(final Deployment dep, final Endpoint ep)
{
+ if (isJaxrpcDeployment(dep)) return false;
+
String transportGuarantee = null;
- if (EndpointType.JAXWS_JSE == ep.getType())
+ if (isJaxwsJseEndpoint(ep))
{
JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
if (webMetaData != null)
@@ -152,10 +157,10 @@
}
}
}
- else if (EndpointType.JAXWS_EJB3 == ep.getType())
+ else if (isJaxwsEjbEndpoint(ep))
{
//TODO Unify annotation scans
- Class implClass = ep.getTargetBeanClass();
+ Class<?> implClass = ep.getTargetBeanClass();
WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
if (anWebContext != null)
{
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -26,7 +26,6 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
import org.jboss.wsf.spi.invocation.InvocationHandler;
@@ -34,15 +33,12 @@
import org.jboss.wsf.spi.invocation.InvocationType;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.invocation.RequestHandlerFactory;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
/**
- * A deployer that assigns the handlers to the Endpoint
+ * An aspect that assigns the handlers to the Endpoint.
*
* @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class EndpointHandlerDeploymentAspect extends AbstractDeploymentAspect
{
@@ -50,62 +46,34 @@
public EndpointHandlerDeploymentAspect()
{
- super();
spiProvider = SPIProviderResolver.getInstance().getProvider();
}
@Override
- public void start(Deployment dep)
+ public void start(final Deployment dep)
{
- for (Endpoint ep : dep.getService().getEndpoints())
+ for (final Endpoint ep : dep.getService().getEndpoints())
{
- // Associate a request handler
ep.setRequestHandler(getRequestHandler(dep));
-
- // Associate a lifecycle handler
ep.setLifecycleHandler(getLifecycleHandler(dep));
-
- // Associate an invocation handler
- // Invocation handlers are assigned per container or per stack
- InvocationHandler invocationHandler = getInvocationHandler(ep);
- if (invocationHandler != null)
- ep.setInvocationHandler(invocationHandler);
-
+ ep.setInvocationHandler(getInvocationHandler(ep));
}
}
- private RequestHandler getRequestHandler(Deployment dep)
+ private RequestHandler getRequestHandler(final Deployment dep)
{
return spiProvider.getSPI(RequestHandlerFactory.class).newRequestHandler();
}
- private LifecycleHandler getLifecycleHandler(Deployment dep)
+ private LifecycleHandler getLifecycleHandler(final Deployment dep)
{
return spiProvider.getSPI(LifecycleHandlerFactory.class).newLifecycleHandler();
}
- private InvocationHandler getInvocationHandler(Endpoint ep)
+ private InvocationHandler getInvocationHandler(final Endpoint ep)
{
-
- String key = ep.getType().toString();
-
- // Use a special key for MDB endpoints
- EJBArchiveMetaData uapp = ep.getService().getDeployment().getAttachment(EJBArchiveMetaData.class);
- if (uapp != null)
- {
- EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
- if (ep.getType() == EndpointType.JAXRPC_EJB21 && bmd instanceof MDBMetaData)
- {
- key = InvocationType.JAXRPC_MDB21.toString();
- }
- else if (ep.getType() == EndpointType.JAXWS_EJB3 && bmd instanceof MDBMetaData)
- {
- key = InvocationType.JAXWS_MDB3.toString();
- }
- }
-
- InvocationType type = InvocationType.valueOf(key);
- InvocationHandler invocationHandler = spiProvider.getSPI(InvocationHandlerFactory.class).newInvocationHandler(type);
- return invocationHandler;
+ final InvocationType invocationType = InvocationType.valueOf(ep.getType().toString());
+ return spiProvider.getSPI(InvocationHandlerFactory.class).newInvocationHandler(invocationType);
}
+
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -28,45 +28,32 @@
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
/**
* A deployer that assigns the complete name to the Endpoint
*
* @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
+ * @since <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class EndpointNameDeploymentAspect extends AbstractDeploymentAspect
{
+
private static final ResourceBundle bundle = BundleUtils.getBundle(EndpointNameDeploymentAspect.class);
+
@Override
public void start(Deployment dep)
{
- String contextRoot = dep.getService().getContextRoot();
+ final String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null || contextRoot.startsWith("/") == false)
throw new IllegalStateException(BundleUtils.getMessage(bundle, "CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH", contextRoot));
for (Endpoint ep : dep.getService().getEndpoints())
{
- StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":");
+ final StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":");
name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot.substring(1) + ",");
name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ep.getShortName());
-
- // Append the JMS destination, for an MDB endpoint
- EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class);
- if (uapp != null)
- {
- EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
- if (bmd instanceof MDBMetaData)
- {
- String destName = ((MDBMetaData)bmd).getDestinationJndiName();
- name.append(",jms=" + destName);
- }
- }
-
ep.setName(ObjectNameFactory.create(name.toString()));
}
}
+
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -107,7 +107,7 @@
try {
introsConfigStream.close();
} catch (IOException e) {
- logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService().getContextRoot()), e);
+ logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService().getContextRoot() ), e);
}
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common.deployment;
+import static org.jboss.ws.common.integration.WSHelper.isEjbEndpoint;
+import static org.jboss.ws.common.integration.WSHelper.isJseEndpoint;
+
import java.util.ResourceBundle;
import java.util.StringTokenizer;
@@ -31,7 +34,6 @@
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
@@ -78,7 +80,7 @@
// #1 For JSE lookup the url-pattern from the servlet mappings
JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
- if (webMetaData != null && (ep.getType() == EndpointType.JAXWS_JSE || ep.getType() == EndpointType.JAXRPC_JSE))
+ if (webMetaData != null && isJseEndpoint(ep))
{
String epName = ep.getShortName();
urlPattern = webMetaData.getServletMappings().get(epName);
@@ -88,7 +90,7 @@
// #2 Use the explicit urlPattern from port-component/port-component-uri
EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
- if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null && (ep.getType() == EndpointType.JAXWS_EJB3 || ep.getType() == EndpointType.JAXRPC_EJB21))
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null && isEjbEndpoint(ep))
{
EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
urlPattern = bmd.getPortComponentURI();
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -22,6 +22,8 @@
package org.jboss.ws.common.deployment;
+import static org.jboss.ws.common.integration.WSHelper.isJaxwsEjbDeployment;
+
import java.util.Arrays;
import java.util.List;
import java.util.ResourceBundle;
@@ -29,7 +31,6 @@
import org.jboss.ws.api.annotation.WebContext;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
-import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -46,7 +47,7 @@
@Override
public void start(Deployment dep)
{
- if (WSHelper.isEjbDeployment(dep) && !WSHelper.isJaxwsJseDeployment(dep))
+ if (isJaxwsEjbDeployment(dep))
{
dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
}
@@ -59,7 +60,7 @@
// Use the virtual hosts from @WebContext.virtualHosts
for (Endpoint ep : dep.getService().getEndpoints())
{
- Class implClass = ep.getTargetBeanClass();
+ Class<?> implClass = ep.getTargetBeanClass();
WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
if (anWebContext != null && anWebContext.virtualHosts() != null && anWebContext.virtualHosts().length > 0)
{
Added: common/trunk/src/main/java/org/jboss/ws/common/integration/EndpointTypeFilterImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/integration/EndpointTypeFilterImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/integration/EndpointTypeFilterImpl.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.common.integration;
+
+import org.jboss.wsf.spi.deployment.EndpointType;
+import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
+
+/**
+ * Endpoint type filter implementation.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class EndpointTypeFilterImpl implements EndpointTypeFilter
+{
+
+ private final EndpointType type;
+
+ EndpointTypeFilterImpl( final EndpointType type )
+ {
+ this.type = type;
+ }
+
+ @Override
+ public boolean accept( final EndpointType type ) {
+ return this.type == type;
+ }
+
+}
Modified: common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -23,10 +23,17 @@
import java.util.ResourceBundle;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXRPC_EJB21;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXRPC_JSE;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_EJB3;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_JSE;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXRPC;
+
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
/**
@@ -36,26 +43,30 @@
*/
public final class WSHelper
{
+
private static final ResourceBundle bundle = BundleUtils.getBundle(WSHelper.class);
-
- /** Logger. */
private static final Logger LOG = Logger.getLogger( WSHelper.class );
+ private static final EndpointTypeFilter JAXRPC_EJB_ENDPOINT_FILTER = new EndpointTypeFilterImpl( JAXRPC_EJB21 );
+ private static final EndpointTypeFilter JAXRPC_JSE_ENDPOINT_FILTER = new EndpointTypeFilterImpl( JAXRPC_JSE );
+ private static final EndpointTypeFilter JAXWS_EJB_ENDPOINT_FILTER = new EndpointTypeFilterImpl( JAXWS_EJB3 );
+ private static final EndpointTypeFilter JAXWS_JSE_ENDPOINT_FILTER = new EndpointTypeFilterImpl( JAXWS_JSE );
+
/**
* Forbidden constructor.
*/
private WSHelper()
{
- super();
+ // forbidden inheritance
}
/**
* Returns required attachment value from webservice deployment.
- *
+ *
* @param <A> expected value
* @param dep webservice deployment
* @param key attachment key
- * @return required attachment
+ * @return required attachment
* @throws IllegalStateException if attachment value is null
*/
public static <A> A getRequiredAttachment( final Deployment dep, final Class< A > key )
@@ -66,13 +77,12 @@
LOG.error(BundleUtils.getMessage(bundle, "CAN_NOT_FIND_ATTACHMENT", key ));
throw new IllegalStateException();
}
-
return value;
}
-
+
/**
* Returns optional attachment value from webservice deployment or null if not bound.
- *
+ *
* @param <A> expected value
* @param dep webservice deployment
* @param key attachment key
@@ -85,7 +95,7 @@
/**
* Returns true if webservice deployment have attachment value associated with the <b>key</b>.
- *
+ *
* @param dep webservice deployment
* @param key attachment key
* @return true if contains attachment, false otherwise
@@ -96,78 +106,49 @@
}
/**
- * Returns true if deployment represents JAXRPC EJB deployment.
+ * Returns true if deployment represents JAXWS JSE deployment.
*
* @param dep webservice deployment
- * @return true if JAXRPC EJB deployment, false otherwise
+ * @return true if JAXWS JSE deployment, false otherwise
*/
- public static boolean isJaxrpcEjbDeployment( final Deployment dep )
+ public static boolean isJaxwsJseDeployment( final Deployment dep )
{
- return dep.getService().getEndpoints(new EndpointTypeFilter() {
- public boolean accept(EndpointType type) {
- if (type == EndpointType.JAXRPC_EJB21) {
- return true;
- }
- return false;
- }
- }).size() > 0;
+ return isJaxwsDeployment( dep ) && dep.getService().getEndpoints( JAXWS_JSE_ENDPOINT_FILTER ).size() > 0;
}
/**
- * Returns true if deployment represents JAXRPC JSE deployment.
+ * Returns true if deployment represents JAXWS EJB deployment.
*
* @param dep webservice deployment
- * @return true if JAXRPC JSE deployment, false otherwise
+ * @return true if JAXWS EJB deployment, false otherwise
*/
- public static boolean isJaxrpcJseDeployment( final Deployment dep )
+ public static boolean isJaxwsEjbDeployment( final Deployment dep )
{
- return dep.getService().getEndpoints(new EndpointTypeFilter() {
- public boolean accept(EndpointType type) {
- if (type == EndpointType.JAXRPC_JSE) {
- return true;
- }
- return false;
- }
- }).size() > 0;
+ return isJaxwsDeployment( dep ) && dep.getService().getEndpoints( JAXWS_EJB_ENDPOINT_FILTER ).size() > 0;
}
/**
- * Returns true if deployment represents JAXWS EJB deployment.
+ * Returns true if deployment represents JAXRPC JSE deployment.
*
* @param dep webservice deployment
- * @return true if JAXWS EJB deployment, false otherwise
+ * @return true if JAXRPC JSE deployment, false otherwise
*/
- public static boolean isJaxwsEjbDeployment( final Deployment dep )
+ public static boolean isJaxrpcJseDeployment( final Deployment dep )
{
- return dep.getService().getEndpoints(new EndpointTypeFilter() {
- public boolean accept(EndpointType type) {
- if (type == EndpointType.JAXWS_EJB3) {
- return true;
- }
- return false;
- }
-
- }).size() > 0;
+ return isJaxrpcDeployment( dep ) && dep.getService().getEndpoints( JAXRPC_JSE_ENDPOINT_FILTER ).size() > 0;
}
/**
- * Returns true if deployment represents JAXWS JSE deployment.
+ * Returns true if deployment represents JAXRPC EJB deployment.
*
* @param dep webservice deployment
- * @return true if JAXWS JSE deployment, false otherwise
+ * @return true if JAXRPC EJB deployment, false otherwise
*/
- public static boolean isJaxwsJseDeployment( final Deployment dep )
+ public static boolean isJaxrpcEjbDeployment( final Deployment dep )
{
- return dep.getService().getEndpoints(new EndpointTypeFilter() {
- public boolean accept(EndpointType type) {
- if (type == EndpointType.JAXWS_JSE || type == EndpointType.JAXWS_JMS) {
- return true;
- }
- return false;
- }
- }).size() > 0;
+ return isJaxrpcDeployment( dep ) && dep.getService().getEndpoints( JAXRPC_EJB_ENDPOINT_FILTER ).size() > 0;
}
-
+
/**
* Returns true if deployment represents either JAXWS JSE or JAXRPC JSE deployment.
*
@@ -176,10 +157,7 @@
*/
public static boolean isJseDeployment( final Deployment dep )
{
- final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment( dep );
- final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment( dep );
-
- return isJaxwsJse || isJaxrpcJse;
+ return isJaxwsJseDeployment( dep ) || isJaxrpcJseDeployment( dep );
}
/**
@@ -190,10 +168,7 @@
*/
public static boolean isEjbDeployment( final Deployment dep )
{
- final boolean isJaxwsEjb = WSHelper.isJaxwsEjbDeployment( dep );
- final boolean isJaxrpcEjb = WSHelper.isJaxrpcEjbDeployment( dep );
-
- return isJaxwsEjb || isJaxrpcEjb;
+ return isJaxwsEjbDeployment( dep ) || isJaxrpcEjbDeployment( dep );
}
/**
@@ -204,10 +179,7 @@
*/
public static boolean isJaxwsDeployment( final Deployment dep )
{
- final boolean isJaxwsEjb = WSHelper.isJaxwsEjbDeployment( dep );
- final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment( dep );
-
- return isJaxwsEjb || isJaxwsJse;
+ return JAXWS == dep.getType();
}
/**
@@ -218,9 +190,95 @@
*/
public static boolean isJaxrpcDeployment( final Deployment dep )
{
- final boolean isJaxrpcEjb = WSHelper.isJaxrpcEjbDeployment( dep );
- final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment( dep );
+ return JAXRPC == dep.getType();
+ }
- return isJaxrpcEjb || isJaxrpcJse;
+ /**
+ * Returns true if endpoint represents JAXWS JSE endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if either JAXWS JSE endpoint, false otherwise
+ */
+ public static boolean isJaxwsJseEndpoint( final Endpoint ep )
+ {
+ return JAXWS_JSE == ep.getType();
}
+
+ /**
+ * Returns true if endpoint represents JAXWS EJB3 endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if JAXWS EJB3 endpoint, false otherwise
+ */
+ public static boolean isJaxwsEjbEndpoint( final Endpoint ep )
+ {
+ return JAXWS_EJB3 == ep.getType();
+ }
+
+ /**
+ * Returns true if endpoint represents JAXRPC JSE endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if JAXRPC JSE endpoint, false otherwise
+ */
+ public static boolean isJaxrpcJseEndpoint( final Endpoint ep )
+ {
+ return JAXRPC_JSE == ep.getType();
+ }
+
+ /**
+ * Returns true if endpoint represents JAXRPC EJB21 endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if JAXRPC EJB21 endpoint, false otherwise
+ */
+ public static boolean isJaxrpcEjbEndpoint( final Endpoint ep )
+ {
+ return JAXRPC_EJB21 == ep.getType();
+ }
+
+ /**
+ * Returns true if endpoint represents either JAXWS JSE or JAXRPC JSE endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if either JAXWS JSE or JAXRPC JSE endpoint, false otherwise
+ */
+ public static boolean isJseEndpoint( final Endpoint ep )
+ {
+ return isJaxwsJseEndpoint( ep ) || isJaxrpcJseEndpoint( ep );
+ }
+
+ /**
+ * Returns true if endpoint represents either JAXWS EJB3 or JAXRPC EJB21 endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if either JAXWS EJB3 or JAXRPC EJB21 endpoint, false otherwise
+ */
+ public static boolean isEjbEndpoint( final Endpoint ep )
+ {
+ return isJaxwsEjbEndpoint( ep ) || isJaxrpcEjbEndpoint( ep );
+ }
+
+ /**
+ * Returns true if endpoint represents either JAXWS JSE or JAXWS EJB3 endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if either JAXWS JSE or JAXWS EJB3 endpoint, false otherwise
+ */
+ public static boolean isJaxwsEndpoint( final Endpoint ep )
+ {
+ return isJaxwsJseEndpoint( ep ) || isJaxwsEjbEndpoint( ep );
+ }
+
+ /**
+ * Returns true if endpoint represents either JAXRPC JSE or JAXRPC EJB21 endpoint.
+ *
+ * @param ep webservice endpoint
+ * @return true if either JAXRPC JSE or JAXRPC EJB21 endpoint, false otherwise
+ */
+ public static boolean isJaxrpcEndpoint( final Endpoint ep )
+ {
+ return isJaxrpcJseEndpoint( ep ) || isJaxrpcEjbEndpoint( ep );
+ }
+
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.common.servlet;
+import static org.jboss.ws.common.integration.WSHelper.isJseDeployment;
+
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -36,7 +38,6 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
-import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -167,10 +168,8 @@
private void setRuntimeLoader()
{
final Deployment dep = endpoint.getService().getDeployment();
- final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment(dep);
- final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment(dep);
- if (isJaxrpcJse || isJaxwsJse)
+ if (isJseDeployment(dep))
{
ClassLoader classLoader = getContextClassLoader();
dep.setRuntimeClassLoader(classLoader);
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2011-09-10 12:43:38 UTC (rev 14967)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2011-09-10 12:45:18 UTC (rev 14968)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.common.utils;
+import static org.jboss.ws.common.integration.WSHelper.isJseDeployment;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
@@ -39,7 +41,6 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.IOUtils;
-import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -77,7 +78,7 @@
serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
}
- if (WSHelper.isJseDeployment(dep))
+ if (isJseDeployment(dep))
{
expLocation = "WEB-INF/wsdl/";
}
13 years, 3 months
JBossWS SVN: r14967 - in spi/trunk/src/main/java/org/jboss/wsf/spi: invocation and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-09-10 08:43:38 -0400 (Sat, 10 Sep 2011)
New Revision: 14967
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentType.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointState.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointType.java
Removed:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/MDBMetaData.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointTypeFilter.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
Log:
[JBWS-3346] code review
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -21,7 +21,6 @@
*/
package org.jboss.wsf.spi.deployment;
-
/**
* A general web service deployment dep.
*
@@ -31,12 +30,6 @@
*/
public interface Deployment extends Extensible
{
-
- public enum DeploymentState
- {
- UNDEFINED, STARTED, STOPPED
- };
-
/** Get the identifier for this deployment */
String getSimpleName();
@@ -55,7 +48,12 @@
/** Set the runtime class loader for this deployment */
void setRuntimeClassLoader(ClassLoader loader);
+ /** Get the deployment type */
+ DeploymentType getType();
+ /** Set the deployment type */
+ void setType(DeploymentType type);
+
/** Get the current deployment state */
DeploymentState getState();
@@ -67,4 +65,4 @@
/** Set the service associated with this deployment */
void setService(Service service);
-}
\ No newline at end of file
+}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -31,7 +31,7 @@
*/
public abstract class DeploymentAspectManagerFactory implements SPIView
{
- //public abstract DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType);
+ public abstract DeploymentAspectManager getDeploymentAspectManager(DeploymentType deploymentType);
/**
* Get a named instance of a deployment aspect manager
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentState.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.spi.deployment;
+
+/**
+ * WebService deployment state.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public enum DeploymentState
+{
+ UNDEFINED, STARTED, STOPPED
+}
\ No newline at end of file
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentType.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentType.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/DeploymentType.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.spi.deployment;
+
+/**
+ * WebService deployment type.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public enum DeploymentType
+{
+ JAXWS, JAXRPC,
+}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -41,22 +41,13 @@
*/
public interface Endpoint extends Extensible
{
+
static final String SEPID_DOMAIN = "jboss.ws";
static final String SEPID_PROPERTY_CONTEXT = "context";
static final String SEPID_PROPERTY_ENDPOINT = "endpoint";
static final String SEPID_DOMAIN_ENDPOINT = SEPID_DOMAIN + "." + SEPID_PROPERTY_ENDPOINT;
-
- public enum EndpointType
- {
- JAXRPC_JSE, JAXRPC_EJB21, JAXWS_JSE, JAXWS_EJB3, JAXWS_JMS;
- };
- public enum EndpointState
- {
- UNDEFINED, STARTED, STOPPED
- };
-
/** Get the service this endpoint belongs to */
Service getService();
@@ -81,6 +72,12 @@
/** Set the current state for this endpoint */
void setState(EndpointState state);
+ /** Get endpoint type */
+ EndpointType getType();
+
+ /** Set endpoint type */
+ void setType(EndpointType type);
+
/** Get the endpoint implementation bean */
String getTargetBeanName();
@@ -137,12 +134,5 @@
/** Set security domain context */
void setSecurityDomainContext(SecurityDomainContext context);
-
-
- /** Set endpoint type */
- void setType(EndpointType type);
-
- /** get endpoint type */
- EndpointType getType();
-
+
}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointState.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointState.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointState.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.spi.deployment;
+
+/**
+ * WebService endpoint state.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public enum EndpointState {
+ UNDEFINED, STARTED, STOPPED
+}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointType.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointType.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointType.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.spi.deployment;
+
+/**
+ * WebService endpoint type.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public enum EndpointType
+{
+ JAXRPC_JSE, JAXRPC_EJB21, JAXWS_JSE, JAXWS_EJB3
+}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointTypeFilter.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointTypeFilter.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/EndpointTypeFilter.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -1,9 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.spi.deployment;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
-
+/**
+ * WebService endpoint type filter.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
public interface EndpointTypeFilter
{
boolean accept(EndpointType type);
-
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -23,8 +23,6 @@
import java.util.List;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
-
/**
* A general service deployment.
*
@@ -35,6 +33,7 @@
*/
public interface Service extends Extensible
{
+
/** Get the deployment this service belongs to */
Deployment getDeployment();
@@ -44,25 +43,25 @@
/** Add an endpoint to the service */
void addEndpoint(Endpoint endpoint);
- /** Get the list of endpoints*/
+ /** Get the list of endpoints */
List<Endpoint> getEndpoints();
- /** Get the list of endpoints with EndpointTypeFilter*/
+ /** Get the list of endpoints */
List<Endpoint> getEndpoints(EndpointTypeFilter filter);
-
+
/** Get an endpoint by name */
Endpoint getEndpointByName(String simpleName);
- /** Get the virtual hosts for this service */
- List<String> getVirtualHosts();
-
- /** Set the virtual hosts for this service */
- void setVirtualHosts(List<String> virtualHosts);
-
/** Get the context root for this service */
String getContextRoot();
/** Set the context root for this service */
void setContextRoot(String contextRoot);
+ /** Get the virtual hosts for this service */
+ List<String> getVirtualHosts();
+
+ /** Set the virtual hosts for this service */
+ void setVirtualHosts(List<String> virtualHosts);
+
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -25,8 +25,9 @@
* Known invocation types.
*
* @author Heiko.Braun(a)jboss.com
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public enum InvocationType
{
- JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_MDB21, JAXWS_JSE, JAXWS_EJB3, JAXWS_MDB3
+ JAXWS_JSE, JAXWS_EJB3, JAXRPC_JSE, JAXRPC_EJB21,
}
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/MDBMetaData.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/MDBMetaData.java 2011-09-09 22:08:35 UTC (rev 14966)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/MDBMetaData.java 2011-09-10 12:43:38 UTC (rev 14967)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.wsf.spi.metadata.j2ee;
-
-/**
- * The container independent metadata of a message driven bean.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class MDBMetaData extends EJBMetaData
-{
- private String destinationJndiName;
-
- public String getDestinationJndiName()
- {
- return destinationJndiName;
- }
-
- public void setDestinationJndiName(String destinationJndiName)
- {
- this.destinationJndiName = destinationJndiName;
- }
-}
13 years, 3 months
JBossWS SVN: r14964 - common/tags.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-09 04:37:33 -0400 (Fri, 09 Sep 2011)
New Revision: 14964
Added:
common/tags/jbossws-common-2.0.0.Beta7/
Log:
Tag jbossws-common-2.0.0.Beta7
13 years, 3 months
JBossWS SVN: r14962 - spi/tags.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-09 03:19:28 -0400 (Fri, 09 Sep 2011)
New Revision: 14962
Added:
spi/tags/jbossws-spi-2.0.0.Beta8/
Log:
jbossws-spi-2.0.0.Beta8
13 years, 3 months
JBossWS SVN: r14961 - in stack/native/trunk/modules/core/src/main/java/org/jboss: ws/core/server and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-09 01:59:20 -0400 (Fri, 09 Sep 2011)
New Revision: 14961
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointInvokerDeploymentAspect.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java
Log:
[JBWS-3359]:Refactor to deploy ejb ws in a war file in native stack
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -44,9 +44,9 @@
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect;
import org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect;
@@ -185,9 +185,9 @@
endpoint.setShortName(this.getEndpointRegistryPath(epImpl));
((HttpEndpoint)endpoint).setURLPattern(epImpl.getPathWithoutContext());
dep.getService().addEndpoint(endpoint);
+ endpoint.setType(EndpointType.JAXWS_JSE);
dep.setRootFile(new ResourceLoaderAdapter(loader));
- dep.setRuntimeClassLoader(loader);
- dep.setType(DeploymentType.JAXWS_JSE);
+ dep.setRuntimeClassLoader(loader);
dep.getService().setContextRoot(contextRoot);
// TODO: remove this properties hack
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -73,8 +73,8 @@
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.InvocationHandler;
@@ -324,8 +324,7 @@
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext instanceof SOAPMessageContextJAXWS)
{
- final DeploymentType deploymentType = ep.getService().getDeployment().getType();
- if ((DeploymentType.JAXWS_JSE == deploymentType) || (DeploymentType.JAXWS_EJB3 == deploymentType))
+ if ((EndpointType.JAXWS_JSE == ep.getType()) || (EndpointType.JAXWS_EJB3 == ep.getType()))
{
if (msgContext.get(MessageContext.SERVLET_REQUEST) != null)
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -46,6 +46,7 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
import org.jboss.ws.core.soap.Use;
import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
@@ -72,6 +73,7 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -202,7 +204,8 @@
// Add JMS destination JNDI name for MDB endpoints
EJBArchiveMetaData apMetaData = dep.getAttachment(EJBArchiveMetaData.class);
- if (apMetaData != null)
+ if (apMetaData != null
+ && (EndpointType.JAXWS_EJB3 == sepMetaData.getEndpoint().getType() || EndpointType.JAXRPC_EJB21 == sepMetaData.getEndpoint().getType()))
{
String ejbName = sepMetaData.getLinkName();
if (ejbName == null)
@@ -289,7 +292,8 @@
{
String transportGuarantee = null;
JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
- if (webMetaData != null)
+ if (webMetaData != null
+ && (EndpointType.JAXWS_JSE == sepMetaData.getEndpoint().getType() || EndpointType.JAXRPC_JSE == sepMetaData.getEndpoint().getType()))
{
Map<String, String> servletMappings = webMetaData.getServletMappings();
String urlPattern = servletMappings.get(servletLink);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -139,7 +139,7 @@
serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getName());
QName interfaceQName = wsdlEndpoint.getInterface().getName();
- Endpoint ep = dep.getService().getEndpointByName(linkName);
+ Endpoint ep = dep.getService().getEndpointByName(linkName);
ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, ep, portName, interfaceQName, Type.JAXRPC);
sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
sepMetaData.setLinkName(linkName);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -60,14 +60,18 @@
log.debug("START buildMetaData: [name=" + dep.getCanonicalName() + "]");
try
{
- UnifiedMetaData wsMetaData = new UnifiedMetaData(dep.getRootFile());
- wsMetaData.setDeploymentName(dep.getCanonicalName());
+ UnifiedMetaData wsMetaData = dep.getAttachment(UnifiedMetaData.class);
+ if (wsMetaData == null)
+ {
+ wsMetaData = new UnifiedMetaData(dep.getRootFile());
+ wsMetaData.setDeploymentName(dep.getCanonicalName());
- ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
- if(null == runtimeClassLoader)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "RUNTIME_LOADER_CANNOT_BE_NULL"));
- wsMetaData.setClassLoader(new DelegateClassLoader(runtimeClassLoader, SecurityActions.getContextClassLoader()));
-
+ ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
+ if (null == runtimeClassLoader)
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "RUNTIME_LOADER_CANNOT_BE_NULL"));
+ wsMetaData.setClassLoader(new DelegateClassLoader(runtimeClassLoader, SecurityActions
+ .getContextClassLoader()));
+ }
// The container objects below provide access to all of the ejb metadata
EJBArchiveMetaData apMetaData = dep.getAttachment(EJBArchiveMetaData.class);
Iterator<EJBMetaData> it = apMetaData.getEnterpriseBeans();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -30,6 +30,8 @@
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
/**
* A server side meta data builder that is based on JSR-181 annotations
@@ -62,9 +64,12 @@
// For every bean
for (Endpoint ep : dep.getService().getEndpoints())
{
- String shortName = ep.getShortName();
- Class beanClass = ep.getTargetBeanClass();
- JAXWSServerMetaDataBuilder.setupProviderOrWebService(dep, wsMetaData, beanClass, shortName);
+ if (EndpointType.JAXWS_JSE == ep.getType())
+ {
+ String shortName = ep.getShortName();
+ Class beanClass = ep.getTargetBeanClass();
+ JAXWSServerMetaDataBuilder.setupProviderOrWebService(dep, wsMetaData, beanClass, shortName);
+ }
}
if (log.isDebugEnabled())
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -29,11 +29,11 @@
import org.jboss.ws.api.annotation.EndpointConfig;
import org.jboss.ws.api.annotation.WebContext;
import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
@@ -104,7 +104,7 @@
if (anWebContext == null)
return;
- boolean isJSEEndpoint = (dep.getType() == DeploymentType.JAXWS_JSE);
+ boolean isJSEEndpoint = WSHelper.isJaxwsJseDeployment(dep);
// context-root
if (anWebContext.contextRoot().length() > 0)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointInvokerDeploymentAspect.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointInvokerDeploymentAspect.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/ServiceEndpointInvokerDeploymentAspect.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -24,9 +24,9 @@
import org.jboss.ws.core.server.ServiceEndpointInvoker;
import org.jboss.ws.core.server.ServiceEndpointInvokerEJB21;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
/**
* A deployer that associates the ServiceEndpointInvoker with the endpoint
@@ -44,8 +44,8 @@
ServiceEndpointInvoker epInvoker = ep.getAttachment(ServiceEndpointInvoker.class);
if (epInvoker == null)
{
- DeploymentType depType = ep.getService().getDeployment().getType();
- if (depType == DeploymentType.JAXRPC_EJB21)
+
+ if (WSHelper.isJaxrpcEjbDeployment(dep))
{
epInvoker = new ServiceEndpointInvokerEJB21();
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java 2011-09-09 05:35:43 UTC (rev 14960)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java 2011-09-09 05:59:20 UTC (rev 14961)
@@ -25,6 +25,7 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3;
import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE;
@@ -34,7 +35,6 @@
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
/**
@@ -52,31 +52,27 @@
UnifiedMetaData umd = dep.getAttachment(UnifiedMetaData.class);
if (umd == null)
{
- if (dep.getType() == DeploymentType.JAXRPC_JSE)
+ if (WSHelper.isJaxwsJseDeployment(dep))
{
- JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
+ JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
umd = builder.buildMetaData((ArchiveDeployment)dep);
+ dep.addAttachment(UnifiedMetaData.class, umd);
}
- else if (dep.getType() == DeploymentType.JAXRPC_EJB21)
+ if (WSHelper.isJaxwsEjbDeployment(dep))
{
- JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
+ JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
umd = builder.buildMetaData((ArchiveDeployment)dep);
}
- else if (dep.getType() == DeploymentType.JAXWS_JSE)
+ if (WSHelper.isJaxrpcJseDeployment(dep) && !WSHelper.isJaxwsJseDeployment(dep) && !WSHelper.isJaxwsEjbDeployment(dep))
{
- JAXWSMetaDataBuilderJSE builder = new JAXWSMetaDataBuilderJSE();
+ JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
umd = builder.buildMetaData((ArchiveDeployment)dep);
}
- else if (dep.getType() == DeploymentType.JAXWS_EJB3)
+ else if (WSHelper.isJaxrpcEjbDeployment(dep) && !WSHelper.isJaxwsJseDeployment(dep) && !WSHelper.isJaxwsEjbDeployment(dep))
{
- JAXWSMetaDataBuilderEJB3 builder = new JAXWSMetaDataBuilderEJB3();
+ JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
umd = builder.buildMetaData((ArchiveDeployment)dep);
}
- else
- {
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "INVALID_DEPLOYMENT_TYPE", dep.getType()));
- }
-
dep.addAttachment(UnifiedMetaData.class, umd);
}
13 years, 3 months
JBossWS SVN: r14960 - in stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf: transport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-09 01:35:43 -0400 (Fri, 09 Sep 2011)
New Revision: 14960
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
Log:
[JBWS-3346]:Remove deploymentType in cxf stack
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-09-09 05:25:04 UTC (rev 14959)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2011-09-09 05:35:43 UTC (rev 14960)
@@ -31,9 +31,9 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.integration.WSConstants;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.metadata.MetadataBuilder;
@@ -92,15 +92,14 @@
*/
private URL getCXFConfigFromDeployment(Deployment dep)
{
- DeploymentType depType = dep.getType();
String metadir;
- if (depType == DeploymentType.JAXWS_EJB3)
+ if (WSHelper.isJaxwsEjbDeployment(dep))
{
// expected resource location for EJB3 deployments
metadir = "META-INF";
}
- else if (depType == DeploymentType.JAXWS_JSE)
+ if (WSHelper.isJaxwsJseDeployment(dep))
{
// expected resource location for POJO deployments
metadir = "WEB-INF";
@@ -108,7 +107,7 @@
else
{
// only POJO and EJB3 deployments are supported
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "UNSUPPORTED_DEPLOYMENT_TYPE", depType));
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "UNSUPPORTED_DEPLOYMENT_TYPE"));
}
URL cxfURL = null;
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2011-09-09 05:25:04 UTC (rev 14959)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2011-09-09 05:35:43 UTC (rev 14960)
@@ -1 +1 @@
-UNSUPPORTED_DEPLOYMENT_TYPE=Unsupported deployment type: {0}
+UNSUPPORTED_DEPLOYMENT_TYPE=JAXRPC_JSE or JAXRPC_EJB21 endpoint is not supported
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-09-09 05:25:04 UTC (rev 14959)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2011-09-09 05:35:43 UTC (rev 14960)
@@ -51,8 +51,8 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointRegistry;
@@ -141,8 +141,7 @@
ServerFactoryBean factory = endpoint.getAttachment(ServerFactoryBean.class);
if (factory != null)
{
- if (DeploymentType.JAXWS_EJB3 != endpoint.getService().getDeployment().getType()
- && factory.getServiceBean() != null)
+ if (EndpointType.JAXWS_EJB3 != endpoint.getType() && factory.getServiceBean() != null)
{
InjectionHelper.callPreDestroyMethod(factory.getServiceBean());
}
13 years, 3 months
JBossWS SVN: r14959 - in container/jboss60/branches/jbossws-jboss610: src/main/java/org/jboss/webservices/integration/deployers and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-09 01:25:04 -0400 (Fri, 09 Sep 2011)
New Revision: 14959
Modified:
container/jboss60/branches/jbossws-jboss610/
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss60/branches/jbossws-jboss610/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-3351]:Refactor AS610 integraiton layer to build and deploy EJB3 endpoint in a war file
Property changes on: container/jboss60/branches/jbossws-jboss610
___________________________________________________________________
Added: svn:mergeinfo
+ /container/jboss60/branches/jbossws-jboss610-JBWS-3343:14926-14951
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.deployers;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-
-/**
- * This deployer initializes JBossWS deployment meta data.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class WSDeploymentDeployer extends AbstractRealDeployer
-{
- /**
- * Constructor.
- */
- public WSDeploymentDeployer()
- {
- super();
-
- // inputs
- this.addInput(JBossWebMetaData.class);
- this.addInput(DeploymentType.class);
-
- // outputs
- this.addOutput(JBossWebMetaData.class);
- this.addOutput(Deployment.class);
- }
-
- /**
- * Creates new Web Service deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- * @throws DeploymentException if any error occurs
- */
- @Override
- protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
- {
- this.log.trace("Building JBoss agnostic webservices meta data model");
- WSDeploymentBuilder.getInstance().build(unit);
- }
-}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -26,9 +26,11 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.webservices.integration.WebServiceDeployment;
+import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.webservices.integration.WebServiceDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
/**
@@ -51,8 +53,8 @@
this.addInput(WebServiceDeployment.class);
// outputs
- this.addOutput(DeploymentType.class);
this.addOutput(JBossWebMetaData.class);
+ this.addOutput(Deployment.class);
}
/**
@@ -64,25 +66,26 @@
@Override
protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
{
+
if (this.isJaxwsJseDeployment(unit))
{
this.log.debug("Detected JAXWS JSE deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXWS_JSE);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_JSE);
}
- else if (this.isJaxwsEjbDeployment(unit))
+ if (this.isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXWS EJB3 deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXWS_EJB3);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_EJB3);
}
- else if (this.isJaxrpcJseDeployment(unit))
+ if (this.isJaxrpcJseDeployment(unit) && !isJaxwsJseDeployment(unit) && !isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXRPC JSE deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXRPC_JSE);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_JSE);
}
- else if (this.isJaxrpcEjbDeployment(unit))
+ if (this.isJaxrpcEjbDeployment(unit) && !isJaxwsJseDeployment(unit) && !isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXRPC EJB21 deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXRPC_EJB21);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_EJB21);
}
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -39,9 +39,9 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -80,12 +80,26 @@
*/
public final void newDeploymentModel(final DeploymentUnit unit)
{
- final ArchiveDeployment dep = this.newDeployment(unit);
+ final ArchiveDeployment dep;
+ if (unit.getAttachment(Deployment.class) != null)
+ {
+ dep = (ArchiveDeployment) unit.getAttachment(Deployment.class);
+ }
+ else
+ {
+ try
+ {
+ dep = this.newDeployment(unit);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ dep.addAttachment(DeploymentUnit.class, unit);
+ unit.addAttachment(Deployment.class, dep);
+ }
this.build(dep, unit);
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
}
/**
@@ -104,7 +118,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep, final EndpointType endpointType)
{
if (endpointName == null)
{
@@ -118,6 +132,7 @@
final Endpoint endpoint = this.deploymentModelFactory.newHttpEndpoint(endpointClass);
endpoint.setShortName(endpointName);
+ endpoint.setType(endpointType);
dep.getService().addEndpoint(endpoint);
return endpoint;
@@ -131,7 +146,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final Deployment dep, EndpointType endpointType)
{
if (endpointName == null)
{
@@ -145,6 +160,7 @@
final Endpoint endpoint = this.deploymentModelFactory.newJMSEndpoint(endpointClass);
endpoint.setShortName(endpointName);
+ endpoint.setType(endpointType);
dep.getService().addEndpoint(endpoint);
return endpoint;
@@ -193,9 +209,6 @@
dep.setRootFile(new ResourceLoaderAdapter(unit.getClassLoader()));
}
dep.setRuntimeClassLoader(unit.getClassLoader());
- final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, DeploymentType.class);
- dep.setType(deploymentType);
-
return dep;
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -25,6 +25,7 @@
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.webservices.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
@@ -69,7 +70,7 @@
final String ejbClass = beanMetaData.getEjbClass();
this.log.debug("EJB21 class: " + ejbClass);
- this.newHttpEndpoint(ejbClass, ejbName, dep);
+ this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXRPC_EJB21);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -26,6 +26,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -68,7 +69,7 @@
final String servletClass = ASHelper.getEndpointName(servletMD);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep);
+ this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXRPC_JSE);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -26,6 +26,7 @@
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -64,7 +65,7 @@
final String ejbClass = container.getComponentClassName();
this.log.debug("EJB3 class: " + ejbClass);
- final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep);
+ final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXWS_EJB3);
ep.setProperty(ASHelper.CONTAINER_NAME, container.getContainerName());
}
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointMetaData;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
@@ -63,7 +64,7 @@
{
endpoint.setName(endpoint.getImplementor());
}
- this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep);
+ this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep, EndpointType.JAXWS_JMS);
}
}
}
\ No newline at end of file
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
/**
* Creates new JAXWS JSE deployment.
@@ -64,7 +65,7 @@
final String servletClass = ASHelper.getEndpointName(servlet);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep);
+ this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXWS_JSE);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -26,7 +26,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
/**
* JBossWS deployment model builder.
@@ -39,14 +39,15 @@
private static final WSDeploymentBuilder SINGLETON = new WSDeploymentBuilder();
/** Builders registry. */
- private static final Map<DeploymentType, DeploymentModelBuilder> builders = new HashMap<DeploymentType, DeploymentModelBuilder>();;
+ private static final Map<EndpointType, DeploymentModelBuilder> builders = new HashMap<EndpointType, DeploymentModelBuilder>();;
static
{
- WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JSE());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_JSE, new DeploymentModelBuilderJAXRPC_JSE());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_EJB3, new DeploymentModelBuilderJAXWS_EJB3());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_EJB21, new DeploymentModelBuilderJAXRPC_EJB21());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JSE());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JMS());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXRPC_JSE, new DeploymentModelBuilderJAXRPC_JSE());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_EJB3, new DeploymentModelBuilderJAXWS_EJB3());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXRPC_EJB21, new DeploymentModelBuilderJAXRPC_EJB21());
}
/**
@@ -72,13 +73,11 @@
*
* @param unit deployment unit
*/
- public void build(final DeploymentUnit unit)
+ public void build(final DeploymentUnit unit, final EndpointType endpointType)
{
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- if (deploymentType != null)
+ if (endpointType != null)
{
- WSDeploymentBuilder.builders.get(deploymentType).newDeploymentModel(unit);
+ WSDeploymentBuilder.builders.get(endpointType).newDeploymentModel(unit);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-09 05:25:04 UTC (rev 14959)
@@ -38,7 +38,7 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -74,118 +74,10 @@
*/
public static boolean isWebServiceDeployment(final DeploymentUnit unit)
{
- return ASHelper.getOptionalAttachment(unit, DeploymentType.class) != null;
+ return ASHelper.getOptionalAttachment(unit, Deployment.class) != null;
}
/**
- * Returns true if unit contains JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC EJB deployment, false otherwise
- */
- public static boolean isJaxrpcEjbDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXRPC_EJB21.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcJseDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXRPC_JSE.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXWS EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS EJB deployment, false otherwise
- */
- public static boolean isJaxwsEjbDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXWS_EJB3.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsJseDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXWS_JSE.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains either JAXWS JSE or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
- */
- public static boolean isJseDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment(unit);
- final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment(unit);
-
- return isJaxwsJse || isJaxrpcJse;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
- */
- public static boolean isEjbDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment(unit);
- final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment(unit);
-
- return isJaxwsEjb || isJaxrpcEjb;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment(unit);
- final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment(unit);
-
- return isJaxwsEjb || isJaxwsJse;
- }
-
- /**
- * Returns true if unit contains either JAXRPC EJB or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment(unit);
- final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment(unit);
-
- return isJaxrpcEjb || isJaxrpcJse;
- }
-
- /**
* Gets list of JAXWS servlets meta data.
*
* @param unit deployment unit
Modified: container/jboss60/branches/jbossws-jboss610/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-09 03:26:32 UTC (rev 14958)
+++ container/jboss60/branches/jbossws-jboss610/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-09 05:25:04 UTC (rev 14959)
@@ -62,8 +62,6 @@
<bean name="WSTypeDeployer" class="org.jboss.webservices.integration.deployers.WSTypeDeployer"/>
- <bean name="WSDeploymentDeployer" class="org.jboss.webservices.integration.deployers.WSDeploymentDeployer"/>
-
<!-- WSDeploymentAspectDeployers factory -->
<bean name="WSAspectizedDeployersFactory" class="org.jboss.webservices.integration.deployers.WSAspectizedDeployersFactory">
<constructor>
13 years, 3 months