Author: thomas.diesler(a)jboss.com
Date: 2007-05-15 10:01:18 -0400 (Tue, 15 May 2007)
New Revision: 3099
Added:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java
Removed:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java
Modified:
branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries
branches/tdiesler/trunk/integration/jboss50/.classpath
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/.classpath
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java
Log:
restructure
Modified: branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries
===================================================================
--- branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries 2007-05-15 12:42:40 UTC
(rev 3098)
+++ branches/tdiesler/trunk/build/eclipse/jbossws.userlibraries 2007-05-15 14:01:18 UTC
(rev 3099)
@@ -17,6 +17,13 @@
<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/ejb3.deployer/jboss-ejb3.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/lib/jboss-common.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/lib/jboss-j2ee.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/jboss-bean.deployer/jboss-dependency.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/deploy/jboss-bean.deployer/jboss-microcontainer.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/lib/jboss-xml-binding.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/lib/servlet-api.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.GA/server/default/lib/jbosssx.jar"/>
</library>
<library name="jboss-5.0.x" systemlibrary="false">
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-aop-jdk50.jar"/>
@@ -29,7 +36,13 @@
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss.jar"
source="/home/tdiesler/svn/jbossas/trunk/server/src/main"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jnpserver.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-logging-spi.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-xml-binding.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/client/jboss-ejb3-client.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-common-core.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jbosssx.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-annotations-ejb3.jar"/>
-<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3.jar"
source="/home/tdiesler/svn/jbossas/branches/Branch_4_2/ejb3/src/main"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/antlr.jar"/>
</library>
</eclipse-userlibraries>
Modified: branches/tdiesler/trunk/integration/jboss50/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/.classpath 2007-05-15 12:42:40 UTC (rev
3098)
+++ branches/tdiesler/trunk/integration/jboss50/.classpath 2007-05-15 14:01:18 UTC (rev
3099)
@@ -2,9 +2,9 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
<classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="lib"
path="/spi/thirdparty/jaxws-api.jar"/>
<classpathentry kind="lib"
path="/spi/thirdparty/jsr181-api.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified:
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java
===================================================================
---
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerHookEJB21.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -27,10 +27,8 @@
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
Modified: branches/tdiesler/trunk/integration/jbws-jboss42/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jbws-jboss42/.classpath 2007-05-15 12:42:40 UTC
(rev 3098)
+++ branches/tdiesler/trunk/integration/jbws-jboss42/.classpath 2007-05-15 14:01:18 UTC
(rev 3099)
@@ -2,9 +2,9 @@
<classpath>
<classpathentry excluding="org/jboss/ws/integration/jboss42/jms/"
kind="src" path="src/main/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
<classpathentry combineaccessrules="false" kind="src"
path="/jbossws"/>
<classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry combineaccessrules="false" kind="src"
path="/jboss42"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/AbstractDeployerHook.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -33,7 +33,10 @@
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanProxyCreationException;
import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.DeployerManager;
+import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.WSDeploymentException;
import org.jboss.ws.integration.jboss42.DeployerHook;
import org.jboss.ws.integration.jboss42.DeployerInterceptorMBean;
@@ -52,12 +55,72 @@
protected DeployerManager deployerManager;
private List<ObjectName> phaseOneInterceptors;
private List<ObjectName> phaseTwoInterceptors;
+ private String deploymentClass;
+ private String serviceClass;
+ private String endpointClass;
public void setDeployerManager(DeployerManager deploymentManager)
{
this.deployerManager = deploymentManager;
}
+ public void setDeploymentClass(String deploymentClass)
+ {
+ this.deploymentClass = deploymentClass;
+ }
+
+ public void setEndpointClass(String endpointClass)
+ {
+ this.endpointClass = endpointClass;
+ }
+
+ public void setServiceClass(String serviceClass)
+ {
+ this.serviceClass = serviceClass;
+ }
+
+ public Deployment createDeployment()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(deploymentClass);
+ return (Deployment)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + deploymentClass);
+ }
+ }
+
+ public Service createService()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(serviceClass);
+ return (Service)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + serviceClass);
+ }
+ }
+
+ public Endpoint createEndpoint()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> clazz = loader.loadClass(endpointClass);
+ return (Endpoint)clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ throw new WSDeploymentException("Cannot load: " + endpointClass);
+ }
+ }
+
public void setPhaseOneInterceptors(List<ObjectName> phaseOneInterceptors)
{
this.phaseOneInterceptors = phaseOneInterceptors;
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB21.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -73,9 +73,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
server = MBeanServerLocator.locateJBoss();
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/InvocationHandlerEJB3.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -66,9 +66,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
if (sepMetaData == null)
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookEJB21.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -27,10 +27,8 @@
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
@@ -55,7 +53,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeploymentImpl();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.ucl);
@@ -92,11 +90,14 @@
Class<?> epBean = loader.loadClass(ejbClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbLink;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXRPCDeployerHookJSE.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -29,10 +29,8 @@
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
@@ -61,7 +59,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new BasicDeployment();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.annotationsCl);
@@ -94,7 +92,7 @@
{
ClassLoader loader = dep.getClassLoader();
Class<?> epBean = loader.loadClass(servletClass.trim());
-
+
// If this is a servlet we defer the the bean creation
if (javax.servlet.Servlet.class.isAssignableFrom(epBean))
{
@@ -102,11 +100,14 @@
}
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletLink;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -31,10 +31,8 @@
import org.jboss.ejb3.Ejb3ModuleMBean;
import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -56,7 +54,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new UnifiedMetaDataDeployment();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.ucl);
@@ -74,11 +72,14 @@
Class epBean = container.getBeanClass();
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
}
}
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -23,7 +23,6 @@
//$Id$
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -36,12 +35,8 @@
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.BasicEndpoint;
-import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
import org.jboss.ws.utils.ObjectNameFactory;
@@ -63,7 +58,7 @@
@Override
public Deployment createDeployment(DeploymentInfo unit)
{
- Deployment dep = new JSEDeployment();
+ Deployment dep = createDeployment();
dep.setType(getDeploymentType());
dep.setClassLoader(unit.annotationsCl);
@@ -88,11 +83,14 @@
Class<?> epBean = loader.loadClass(servletClass.trim());
// Create the endpoint
- Endpoint endpoint = new BasicEndpoint(service, epBean);
+ Endpoint ep = createEndpoint();
+ ep.setService(service);
+ ep.setEndpointImpl(epBean);
+
String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ ep.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(ep);
}
catch (ClassNotFoundException ex)
{
Copied:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java
(from rev 3097,
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java)
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java
(rev 0)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB21.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42.jbossws;
+
+//$Id$
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.metadata.AssemblyDescriptorMetaData;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class SecurityRolesHandlerEJB21 implements SecurityRolesHandler
+{
+ // logging support
+ protected Logger log = Logger.getLogger(SecurityRolesHandlerEJB21.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
+ ApplicationMetaData applMetaData =
(ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
+ AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
+ if (assemblyDescriptor != null)
+ {
+ Map securityRoles = assemblyDescriptor.getSecurityRoles();
+ if (securityRoles != null)
+ {
+ Iterator it = securityRoles.keySet().iterator();
+ while (it.hasNext())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
+ }
+ }
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java
(from rev 3097,
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java)
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java
(rev 0)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/SecurityRolesHandlerEJB3.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42.jbossws;
+
+//$Id$
+
+import javax.annotation.security.RolesAllowed;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
+import org.jboss.ws.integration.deployment.SecurityRolesHandler;
+import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
+import org.jboss.ws.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Generate a service endpoint deployment for EJB endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class SecurityRolesHandlerEJB3 implements SecurityRolesHandler
+{
+ // logging support
+ protected Logger log = Logger.getLogger(SecurityRolesHandlerEJB3.class);
+
+ /** Add the roles from ejb-jar.xml to the security roles
+ */
+ public void addSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
+ {
+ // The container objects below provide access to all of the ejb metadata
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
+ {
+ if (manager instanceof StatelessContainer)
+ {
+ StatelessContainer container = (StatelessContainer)manager;
+
+ RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
+ if (anRolesAllowed != null)
+ {
+ for (String role : anRolesAllowed.value())
+ {
+ Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
+ Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
+ roleName.appendChild(DOMUtils.createTextNode(role));
+ }
+ }
+ }
+ }
+ }
+
+ private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
+}
Deleted:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB21.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss42.jbossws;
-
-//$Id$
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.ApplicationMetaData;
-import org.jboss.metadata.AssemblyDescriptorMetaData;
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB21 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB21.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
- {
- // Fix:
http://jira.jboss.org/jira/browse/JBWS-309
- ApplicationMetaData applMetaData =
(ApplicationMetaData)udi.getAttachment(ApplicationMetaData.class);
- AssemblyDescriptorMetaData assemblyDescriptor =
applMetaData.getAssemblyDescriptor();
- if (assemblyDescriptor != null)
- {
- Map securityRoles = assemblyDescriptor.getSecurityRoles();
- if (securityRoles != null)
- {
- Iterator it = securityRoles.keySet().iterator();
- while (it.hasNext())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode((String)it.next()));
- }
- }
- }
- }
-}
Deleted:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/ServiceEndpointGeneratorEJB3.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -1,96 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss42.jbossws;
-
-//$Id$
-
-import javax.annotation.security.RolesAllowed;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.ejb3.Ejb3ModuleMBean;
-import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpointGeneratorEJB;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class ServiceEndpointGeneratorEJB3 extends ServiceEndpointGeneratorEJB
-{
- // logging support
- protected Logger log = Logger.getLogger(ServiceEndpointGeneratorEJB3.class);
-
- /** Add the roles from ejb-jar.xml to the security roles
- */
- protected void addEJBSecurityRoles(Element webApp, UnifiedDeploymentInfo udi)
- {
- // The container objects below provide access to all of the ejb metadata
- Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
- for (Object manager : ejb3Module.getContainers().values())
- {
- if (manager instanceof StatelessContainer)
- {
- StatelessContainer container = (StatelessContainer)manager;
-
- RolesAllowed anRolesAllowed =
(RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
- if (anRolesAllowed != null)
- {
- for (String role : anRolesAllowed.value())
- {
- Element securityRole =
(Element)webApp.appendChild(DOMUtils.createElement("security-role"));
- Element roleName =
(Element)securityRole.appendChild(DOMUtils.createElement("role-name"));
- roleName.appendChild(DOMUtils.createTextNode(role));
- }
- }
- }
- }
- }
-
- private Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
- {
- Ejb3ModuleMBean ejb3Module;
- try
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
- if (ejb3Module == null)
- throw new WSException("Cannot obtain EJB3 module: " + objectName);
-
- return ejb3Module;
- }
- catch (MBeanProxyCreationException ex)
- {
- throw new WSException("Cannot obtain proxy to EJB3 module");
- }
- }
-}
Deleted:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/java/org/jboss/ws/integration/jboss42/jbossws/WebAppGeneratorDeployer.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss42.jbossws;
-
-//$Id$
-
-import org.jboss.ws.integration.deployment.AbstractDeployer;
-import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.integration.deployment.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A deployer that generates a webapp for an EJB endpoint
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class WebAppGeneratorDeployer extends AbstractDeployer
-{
- @Override
- public void create(Deployment dep)
- {
- UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
- if (udi == null)
- throw new IllegalStateException("Cannot obtain unified deployement
info");
-
- UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
- if (umd == null)
- throw new IllegalStateException("Cannot obtain unified meta data");
-
- if (dep.getType().toString().endsWith("EJB21"))
- {
- ServiceEndpointGeneratorEJB21 generator = new ServiceEndpointGeneratorEJB21();
- udi.webappURL = generator.generatWebDeployment(umd, udi);
- }
- else if (dep.getType().toString().endsWith("EJB3"))
- {
- ServiceEndpointGeneratorEJB3 generator = new ServiceEndpointGeneratorEJB3();
- udi.webappURL = generator.generatWebDeployment(umd, udi);
- }
- }
-}
\ No newline at end of file
Modified:
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-05-15
14:01:18 UTC (rev 3099)
@@ -163,6 +163,8 @@
Register DeployerHooks with JBoss deployers
-->
<bean name="WSDeployerHook_JAXRPC_JSE"
class="org.jboss.ws.integration.jboss42.jbossws.JAXRPCDeployerHookJSE">
+ <property
name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property
name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject
bean="WSDeployerManagerJSE"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList"
elementClass="javax.management.ObjectName">
@@ -171,6 +173,8 @@
</property>
</bean>
<bean name="WSDeployerHook_JAXRPC_EJB21"
class="org.jboss.ws.integration.jboss42.jbossws.JAXRPCDeployerHookEJB21">
+ <property
name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property
name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject
bean="WSDeployerManagerEJB"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList"
elementClass="javax.management.ObjectName">
@@ -179,6 +183,8 @@
</property>
</bean>
<bean name="WSDeployerHook_JAXWS_JSE"
class="org.jboss.ws.integration.jboss42.jbossws.JAXWSDeployerHookJSE">
+ <property
name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property
name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject
bean="WSDeployerManagerJSE"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList"
elementClass="javax.management.ObjectName">
@@ -187,6 +193,8 @@
</property>
</bean>
<bean name="WSDeployerHook_JAXWS_EJB3"
class="org.jboss.ws.integration.jboss42.jbossws.JAXWSDeployerHookEJB3">
+ <property
name="deploymentClass">org.jboss.ws.core.deployment.UnifiedMetaDataDeployment</property>
+ <property
name="endpointClass">org.jboss.ws.integration.BasicEndpoint</property>
<property name="deployerManager"><inject
bean="WSDeployerManagerEJB"/></property>
<property name="phaseOneInterceptors">
<list class="java.util.LinkedList"
elementClass="javax.management.ObjectName">
Modified:
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -73,9 +73,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
server = MBeanServerLocator.locateJBoss();
Modified:
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java
===================================================================
---
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/jbws-jboss50/src/main/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB3.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -66,9 +66,9 @@
/** Initialize the service endpoint */
@Override
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
- super.init(endpoint);
+ super.create(endpoint);
ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
if (sepMetaData == null)
Modified:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/BasicLifecycleHandler.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -44,7 +44,7 @@
// Initialize the invoker
InvocationHandler invoker = endpoint.getInvocationHandler();
- invoker.init(endpoint);
+ invoker.create(endpoint);
endpoint.setState(EndpointState.CREATED);
}
Modified:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationContext.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -55,6 +55,8 @@
*/
package org.jboss.ws.integration.invocation;
+import javax.xml.ws.handler.MessageContext;
+
//$Id$
/**
@@ -65,4 +67,6 @@
*/
public interface InvocationContext
{
+ /** Get the message context */
+ MessageContext getMessageContext();
}
Modified:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/ws/integration/invocation/InvocationHandler.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -57,10 +57,12 @@
//$Id$
+import java.lang.reflect.Method;
+
import org.jboss.ws.integration.Endpoint;
/**
- * A general endpoint invoker.
+ * A general ep invoker.
*
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
@@ -68,8 +70,20 @@
public interface InvocationHandler
{
/** Initialize the invocation handler */
- void init(Endpoint endpoint);
+ void create(Endpoint ep);
- /** Invoke the the service endpoint */
- void invoke(InvocationContext reqContext) throws Exception;
+ /** Initialize the invocation handler */
+ void start(Endpoint ep);
+
+ /** Get an instance of the target bean */
+ Object getTargetBean(Endpoint ep) throws InstantiationException,
IllegalAccessException;
+
+ /** Invoke the the service ep */
+ Object invoke(Endpoint ep, Object targetBean, Method method, Object[] args,
InvocationContext invContext) throws Exception;
+
+ /** Initialize the invocation handler */
+ void stop(Endpoint ep);
+
+ /** Initialize the invocation handler */
+ void destroy(Endpoint ep);
}
Modified:
branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java
===================================================================
---
branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/integration/sunri-jboss50/src/main/java/org/jboss/ws/integration/jboss50/sunri/InvocationHandlerJSE.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -23,10 +23,13 @@
// $Id$
+import java.lang.reflect.Method;
+
+import javax.xml.ws.handler.MessageContext;
+
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.invocation.InvocationContext;
import org.jboss.ws.integration.invocation.InvocationHandler;
/**
@@ -43,14 +46,31 @@
private Endpoint endpoint;
/** Initialize the service endpoint */
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
this.endpoint = endpoint;
}
+ public void start(Endpoint endpoint)
+ {
+ }
+
+ public Object getTargetBean(Endpoint endpoint)
+ {
+ throw new NotImplementedException();
+ }
+
/** Invoke the the service endpoint */
- public void invoke(InvocationContext reqContext) throws Exception
+ public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[]
args, MessageContext msgContext) throws Exception
{
throw new NotImplementedException();
}
+
+ public void stop(Endpoint endpoint)
+ {
+ }
+
+ public void destroy(Endpoint endpoint)
+ {
+ }
}
Modified:
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java
===================================================================
---
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/AbstractInvocationHandler.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -71,7 +71,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
*/
-public abstract class AbstractInvocationHandler implements InvocationHandler
+public abstract class AbstractInvocationHandler
{
// provide logging
private static final Logger log = Logger.getLogger(AbstractInvocationHandler.class);
@@ -81,10 +81,10 @@
protected ServerHandlerDelegate delegate;
/** Initialize the service endpoint */
- public void init(Endpoint endpoint)
+ public void create(Endpoint endpoint)
{
this.endpoint = endpoint;
-
+
ServerEndpointMetaData sepMetaData =
endpoint.getMetaData(ServerEndpointMetaData.class);
if (sepMetaData == null)
throw new IllegalStateException("Cannot obtain endpoint meta data");
@@ -134,18 +134,12 @@
}
/** Invoke the the service endpoint */
- public void invoke(InvocationContext reqContext) throws Exception
+ public void invoke(ServletRequestContext reqContext) throws Exception
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
ServerEndpointMetaData sepMetaData =
(ServerEndpointMetaData)msgContext.getEndpointMetaData();
MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
- // Load the endpoint implementation bean
- Class seImpl = loadServiceEndpoint();
-
- // Create an instance of the endpoint implementation bean
- Object seInstance = createServiceEndpointInstance(seImpl, reqContext);
-
// The direction of the message
DirectionHolder direction = new DirectionHolder(Direction.InBound);
@@ -209,8 +203,16 @@
epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
}
- // Invoke the service endpoint
- invokeServiceEndpointInstance(seInstance, epInv);
+ InvocationHandler invHandler = endpoint.getInvocationHandler();
+ Object targetBean = invHandler.getTargetBean(endpoint);
+
+ Class implClass = endpoint.getEndpointImpl();
+ Method seiMethod = epInv.getJavaMethod();
+ Method implMethod = getImplMethod(implClass, seiMethod);
+
+ Object[] args = epInv.getRequestPayload();
+ Object retObj = invHandler.invoke(endpoint, targetBean, implMethod, args,
reqContext);
+ epInv.setReturnValue(retObj);
}
finally
{
@@ -280,8 +282,6 @@
closeHandlerChain(sepMetaData, handlerType[2]);
closeHandlerChain(sepMetaData, handlerType[1]);
closeHandlerChain(sepMetaData, handlerType[0]);
-
- destroyServiceEndpointInstance(seInstance);
}
}
Modified:
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java
===================================================================
---
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/InvocationHandlerJSE.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -40,7 +40,9 @@
import org.jboss.ws.core.jaxws.WebServiceContextJSE;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.invocation.InvocationContext;
+import org.jboss.ws.integration.invocation.InvocationHandler;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
/**
@@ -49,11 +51,57 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
*/
-public class InvocationHandlerJSE extends AbstractInvocationHandler
+public class InvocationHandlerJSE implements InvocationHandler
{
// provide logging
private static final Logger log = Logger.getLogger(InvocationHandlerJSE.class);
+ public void create(Endpoint ep)
+ {
+ // noting to do
+ }
+
+ public void destroy(Endpoint endpoint)
+ {
+ }
+
+ public Object getTargetBean(Endpoint ep) throws InstantiationException,
IllegalAccessException
+ {
+ Class epClass = ep.getEndpointImpl();
+ Object targetBean = epClass.newInstance();
+ return targetBean;
+ }
+
+ public Object invoke(Endpoint endpoint, Object targetBean, Method method, Object[]
args, InvocationContext invContext) throws Exception
+ {
+ if (targetBean instanceof ServiceLifecycle && context != null)
+ {
+ try
+ {
+ ServiceLifecycle serviceLifecycle = ((ServiceLifecycle)seiImpl);
+ ServletEndpointContext servletEndpointContext = new
ServletEndpointContextImpl((ServletRequestContext)context);
+ serviceLifecycle.init(servletEndpointContext);
+ }
+ catch (ServiceException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+ return null;
+ }
+
+ public void start(Endpoint endpoint)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void stop(Endpoint endpoint)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
/** Load the SEI implementation bean if necessary */
public Class loadServiceEndpoint() throws ClassNotFoundException
{
Modified:
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java
===================================================================
---
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-15
12:42:40 UTC (rev 3098)
+++
branches/tdiesler/trunk/jbossws/src/main/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-15
14:01:18 UTC (rev 3099)
@@ -356,9 +356,12 @@
ClassLoader classLoader = sepMetaData.getClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
+ AbstractInvocationHandler invHandler =
endpoint.getMetaData(AbstractInvocationHandler.class);
+ if (invHandler == null)
+ throw new IllegalStateException("Cannot obtain invocation
handler");
+
// Invoke the service endpoint
- InvocationHandler invoker = endpoint.getInvocationHandler();
- invoker.invoke(reqContext);
+ invHandler.invoke(reqContext);
// Get the response message context
msgContext = MessageContextAssociation.peekMessageContext();