tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r535442 - in /incubator/openejb/trunk/openejb3/container/openejb-core/src: main/java/org/apache/openejb/assembler/classic/ main/java/org/apache/openejb/core/ main/java/org/apache/openejb/core/stateless/ test/java/org/apache/openejb/core/cmp...
Date Sat, 05 May 2007 03:47:06 GMT
Author: dblevins
Date: Fri May  4 20:47:06 2007
New Revision: 535442

URL: http://svn.apache.org/viewvc?view=rev&rev=535442
Log:
Correctly process the service endpoint interface in the CoreDeploymentInfo constructor.
Use the InterfaceType to determine the if the call is a webservice call (we can do that now
that we pass the interface in on the invoke)

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/AuthorBean.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/BookBean.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java?view=diff&rev=535442&r1=535441&r2=535442
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
Fri May  4 20:47:06 2007
@@ -98,6 +98,12 @@
             businessRemotes.add(loadClass(businessRemote, "classNotFound.businessRemote"));
         }
 
+        Class serviceEndpoint = null;
+        if (BeanType.STATELESS == ejbType){
+            if(bean.serviceEndpoint != null){
+                serviceEndpoint = loadClass(bean.serviceEndpoint, "classNotFound.sei");
+            }
+        }
 
         Class primaryKey = null;
         if (ejbType.isEntity() && ((EntityBeanInfo) bean).primKeyClass != null) {
@@ -113,19 +119,14 @@
         DeploymentContext deploymentContext = new DeploymentContext(bean.ejbDeploymentId,
cl, root);
         CoreDeploymentInfo deployment;
         if (BeanType.MESSAGE_DRIVEN != ejbType) {
-            deployment = new CoreDeploymentInfo(deploymentContext, ejbClass, home, remote,
localhome, local, businessLocals, businessRemotes, primaryKey, ejbType);
+            deployment = new CoreDeploymentInfo(deploymentContext, ejbClass, home, remote,
localhome, local, serviceEndpoint, businessLocals, businessRemotes, primaryKey, ejbType);
         } else {
             MessageDrivenBeanInfo messageDrivenBeanInfo = (MessageDrivenBeanInfo) bean;
             Class mdbInterface = loadClass(messageDrivenBeanInfo.mdbInterface, "classNotFound.mdbInterface");
             deployment = new CoreDeploymentInfo(deploymentContext, ejbClass, mdbInterface,
messageDrivenBeanInfo.activationProperties);
             deployment.setDestinationId(messageDrivenBeanInfo.destinationId);
         }
-        if (BeanType.STATELESS == ejbType){
-            if(bean.serviceEndpoint != null){
-                deployment.setServiceEndpointInterface(loadClass(bean.serviceEndpoint, "classNotFound.sei"));
-            }
-        }
-        
+
         deployment.setEjbName(bean.ejbName);
 
         deployment.setModuleId(moduleId);

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java?view=diff&rev=535442&r1=535441&r2=535442
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
Fri May  4 20:47:06 2007
@@ -174,7 +174,7 @@
                               Class remoteInterface,
                               Class localHomeInterface,
                               Class localInterface,
-                              List<Class> businessLocals, List<Class> businessRemotes,
Class pkClass,
+                              Class serviceEndpointInterface, List<Class> businessLocals,
List<Class> businessRemotes, Class pkClass,
                               BeanType componentType
     ) throws SystemException {
 
@@ -194,6 +194,7 @@
         this.remoteInterface = remoteInterface;
         this.beanClass = beanClass;
         this.pkClass = pkClass;
+        this.serviceEndpointInterface = serviceEndpointInterface;
 
         this.componentType = componentType;
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java?view=diff&rev=535442&r1=535441&r2=535442
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContainer.java
Fri May  4 20:47:06 2007
@@ -34,6 +34,7 @@
 import org.apache.openejb.DeploymentInfo;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.ProxyInfo;
+import org.apache.openejb.InterfaceType;
 import org.apache.openejb.core.CoreDeploymentInfo;
 import org.apache.openejb.core.Operation;
 import org.apache.openejb.core.ThreadContext;
@@ -161,7 +162,7 @@
 
             callContext.set(Method.class, runMethod);
             callContext.setInvokedInterface(callInterface);
-            Object retValue = _invoke(callMethod, runMethod, args, bean, callContext);
+            Object retValue = _invoke(callInterface, callMethod, runMethod, args, bean, callContext);
             instanceManager.poolInstance(callContext, bean);
 
             return retValue;
@@ -179,7 +180,7 @@
         return instanceManager;
     }
 
-    protected Object _invoke(Method callMethod, Method runMethod, Object [] args, Object
object, ThreadContext callContext)
+    protected Object _invoke(Class callInterface, Method callMethod, Method runMethod, Object
[] args, Object object, ThreadContext callContext)
             throws org.apache.openejb.OpenEJBException {
         Instance instance = (Instance) object;
 
@@ -192,9 +193,10 @@
 
         Object returnValue = null;
         try {
-            if (isWebServiceCall(deploymentInfo, callMethod, args)){
-                callContext.setCurrentOperation(Operation.BUSINESS_WS);                 
                 
-                returnValue = invokeWebService(args, deploymentInfo, runMethod, instance,
returnValue);                
+            InterfaceType type = deploymentInfo.getInterfaceType(callInterface);
+            if (type == InterfaceType.SERVICE_ENDPOINT){
+                callContext.setCurrentOperation(Operation.BUSINESS_WS);
+                returnValue = invokeWebService(args, deploymentInfo, runMethod, instance,
returnValue);
             } else {
                 List<InterceptorData> interceptors = deploymentInfo.getMethodInterceptors(runMethod);
                 InterceptorStack interceptorStack = new InterceptorStack(instance.bean, runMethod,
Operation.BUSINESS, interceptors, instance.interceptors);
@@ -261,13 +263,6 @@
             returnValue = interceptorStack.invoke((javax.xml.ws.handler.MessageContext) messageContext,
params);
         }
         return returnValue;
-    }
-
-    private boolean isWebServiceCall(DeploymentInfo deployment, Method callMethod, Object[]
args) {
-        Class serviceEndpointInterface = deployment.getServiceEndpointInterface();
-        // DMB: This will be a problem if the calling method is in an interface and the
-        // service-endpoint interface extends that interface.
-        return (serviceEndpointInterface != null && serviceEndpointInterface.isAssignableFrom(callMethod.getDeclaringClass()));
     }
 
     private TransactionManager getTransactionManager() {

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/AuthorBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/AuthorBean.java?view=diff&rev=535442&r1=535441&r2=535442
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/AuthorBean.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/AuthorBean.java
Fri May  4 20:47:06 2007
@@ -39,7 +39,7 @@
                     null,
                     AuthorHome.class,
                     Author.class,
-                    null,
+                    null, null,
                     null,
                     String.class, 
                     BeanType.CMP_ENTITY);

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/BookBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/BookBean.java?view=diff&rev=535442&r1=535441&r2=535442
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/BookBean.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/cmp/jpa/BookBean.java
Fri May  4 20:47:06 2007
@@ -39,7 +39,7 @@
                     null,
                     BookHome.class,
                     Book.class,
-                    null,
+                    null, null,
                     null,
                     String.class,
                     BeanType.CMP_ENTITY);



Mime
View raw message