[jboss-cvs] JBossAS SVN: r76548 - in projects/ejb3/trunk/proxy: src/main/java/org/jboss/ejb3 and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 31 23:52:40 EDT 2008


Author: ALRubinger
Date: 2008-07-31 23:52:40 -0400 (Thu, 31 Jul 2008)
New Revision: 76548

Added:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/stateful/
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteInvocation.java
Removed:
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/InvokableContextProxy.java
Modified:
   projects/ejb3/trunk/proxy/pom.xml
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java
   projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java
Log:
[EJBTHREE-1345] Rework invocation model, obtain SFSB IDs in-container only

Modified: projects/ejb3/trunk/proxy/pom.xml
===================================================================
--- projects/ejb3/trunk/proxy/pom.xml	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/pom.xml	2008-08-01 03:52:40 UTC (rev 76548)
@@ -16,7 +16,7 @@
   <parent>
     <groupId>org.jboss.ejb3</groupId>
     <artifactId>jboss-ejb3-build</artifactId>
-    <version>0.13.11</version>
+    <version>0.13.12-SNAPSHOT</version>
   </parent>
 
   <!-- Model Version -->

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionProxyFactoryBase.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -33,6 +33,7 @@
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactoryBase;
 import org.jboss.ejb3.proxy.handler.session.stateful.StatefulProxyInvocationHandlerBase;
 import org.jboss.ejb3.proxy.intf.StatefulSessionProxy;
+import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 
 /**
@@ -48,6 +49,12 @@
          StatefulSessionProxyFactory
 {
    // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   private static final Logger log = Logger.getLogger(StatefulSessionProxyFactoryBase.class);
+
+   // --------------------------------------------------------------------------------||
    // Instance Members ---------------------------------------------------------------||
    // --------------------------------------------------------------------------------||
 
@@ -304,6 +311,11 @@
       {
          throw new RuntimeException("Could not obtain a new Session ID from SFSB Container \"" + container + "\"", e);
       }
+      catch (RuntimeException re)
+      {
+         log.error("Could not obtain new Session ID from SFSB Container", re);
+         throw re;
+      }
 
       // Return the new ID
       return sessionId;

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/factory/session/stateful/StatefulSessionRemoteProxyFactory.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -21,22 +21,13 @@
  */
 package org.jboss.ejb3.proxy.factory.session.stateful;
 
-import java.lang.reflect.Proxy;
-import java.net.MalformedURLException;
 import java.util.Set;
 
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
-import org.jboss.aspects.remoting.PojiProxy;
-import org.jboss.ejb3.proxy.container.StatefulSessionInvokableContext;
 import org.jboss.ejb3.proxy.factory.session.SessionProxyFactory;
 import org.jboss.ejb3.proxy.handler.session.SessionProxyInvocationHandler;
 import org.jboss.ejb3.proxy.handler.session.stateful.StatefulRemoteProxyInvocationHandler;
-import org.jboss.ejb3.proxy.remoting.InvokableContextProxy;
-import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
-import org.jboss.remoting.InvokerLocator;
 
 /**
  * StatefulSessionRemoteProxyFactory
@@ -151,50 +142,6 @@
       return handler;
    }
 
-//   /**
-//    * Obtains the Container used by this Proxy Factory
-//    * 
-//    * @return The Container for this Proxy Factory
-//    */
-//   @Override
-//   protected StatefulSessionInvokableContext<?> obtainContainer()
-//   {
-//      /*
-//       * Obtain the Container
-//       */
-//      StatefulSessionInvokableContext<?> container = null;
-//      String containerName = this.getContainerName();
-//
-//      // Create an InvokerLocator
-//      String url = this.getUrl();
-//      assert url != null && !url.trim().equals("") : InvokerLocator.class.getSimpleName()
-//            + " URL is required, but is not specified for " + this;
-//      InvokerLocator locator = null;
-//      try
-//      {
-//         locator = new InvokerLocator(url);
-//      }
-//      catch (MalformedURLException e)
-//      {
-//         throw new RuntimeException(
-//               "URL for " + InvokerLocator.class.getSimpleName() + " in " + this + " was improper", e);
-//      }
-//
-//      // Create a POJI Proxy to the Container
-//      Interceptor[] interceptors =
-//      {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
-//      PojiProxy handler = new InvokableContextProxy(containerName, locator, interceptors);
-//      Class<?>[] interfaces = new Class<?>[]
-//      {StatefulSessionInvokableContext.class};
-//      container = (StatefulSessionInvokableContext<?>) Proxy.newProxyInstance(interfaces[0].getClassLoader(),
-//            interfaces, handler);
-//      log.debug("Created Remoting Proxy to " + StatefulSessionInvokableContext.class.getSimpleName() + " with name "
-//            + containerName + " using URL " + url);
-//
-//      // Return
-//      return container;
-//   }
-
    // --------------------------------------------------------------------------------||
    // Accessors / Mutators -----------------------------------------------------------||
    // --------------------------------------------------------------------------------||

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionProxyInvocationHandlerBase.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -24,10 +24,7 @@
 import java.lang.reflect.Proxy;
 import java.net.MalformedURLException;
 
-import org.jboss.aop.Dispatcher;
 import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.aop.util.PayloadKey;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
 import org.jboss.aspects.remoting.PojiProxy;
 import org.jboss.ejb3.common.registrar.spi.Ejb3Registrar;
@@ -35,7 +32,7 @@
 import org.jboss.ejb3.interceptors.container.ContainerMethodInvocation;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.handler.ProxyInvocationHandlerBase;
-import org.jboss.ejb3.proxy.remoting.InvokableContextProxy;
+import org.jboss.ejb3.proxy.invocation.StatefulRemoteProxyInvocationHack;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
@@ -114,11 +111,11 @@
       // Create a POJI Proxy to the Container
       Interceptor[] interceptors =
       {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
-      PojiProxy handler = new InvokableContextProxy(this.getContainerName(), locator, interceptors);
+      PojiProxy handler = new StatefulRemoteProxyInvocationHack(this.getContainerName(), locator, interceptors);
       Class<?>[] interfaces = new Class<?>[]
       {InvokableContext.class};
       InvokableContext<? extends ContainerMethodInvocation> container = (InvokableContext<?>) Proxy.newProxyInstance(
-            InvokableContext.class.getClassLoader(), interfaces, handler);
+            InvokableContext.class.getClassLoader(), interfaces, handler);      
 
       // Return
       return container;

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/SessionSpecProxyInvocationHandlerBase.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -23,6 +23,10 @@
 
 import java.lang.reflect.Method;
 
+import org.jboss.aop.Dispatcher;
+import org.jboss.aop.util.PayloadKey;
+import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.aspects.remoting.IsLocalInterceptor;
 import org.jboss.ejb3.common.lang.SerializableMethod;
 import org.jboss.ejb3.proxy.container.InvokableContext;
 import org.jboss.ejb3.proxy.handler.NotEligibleForDirectInvocationException;
@@ -115,14 +119,6 @@
          args = new Object[]
          {};
       }
-      
-//      StatefulRemoteInvocation sri = new StatefulRemoteInvocation(interceptors, hash, method, method, null, id);
-//      sri.setArguments(args);
-//      sri.setInstanceResolver(metadata);
-//      sri.getMetaData().addMetaData(Dispatcher.DISPATCHER, Dispatcher.OID, containerId, PayloadKey.AS_IS);
-//      sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR, uri, PayloadKey.AS_IS);
-//      sri.getMetaData().addMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.SUBSYSTEM, "AOP", PayloadKey.AS_IS);
-//      sri.getMetaData().addMetaData(IsLocalInterceptor.IS_LOCAL, IsLocalInterceptor.GUID, containerGuid, PayloadKey.AS_IS);
 
       // Invoke
       Object result = container.invoke(proxy, invokedMethod, args);

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/invocation/StatefulRemoteProxyInvocationHack.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.proxy.invocation;
+
+import java.lang.reflect.Method;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.aop.util.MethodHashing;
+import org.jboss.aspects.remoting.PojiProxy;
+import org.jboss.ejb3.stateful.StatefulRemoteInvocation;
+import org.jboss.remoting.InvokerLocator;
+
+/**
+ * StatefulRemoteProxyInvocationHack
+ * 
+ * Constructs a Proxy to the Container using an underlying
+ * StatefulRemoteInvocation when invocations are made.
+ * 
+ * Looking forward, should be using a more flexible
+ * invocation mechanism to handle SFSB, SLSB, etc invocations
+ * in an agnostic manner.  This is put into place to avoid
+ * further refactoring within EJB3 Core 
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ * @deprecated 
+ */
+ at Deprecated
+public class StatefulRemoteProxyInvocationHack extends PojiProxy
+{
+
+   public StatefulRemoteProxyInvocationHack(Object oid, InvokerLocator uri, Interceptor[] interceptors)
+   {
+      super(oid, uri, interceptors);
+   }
+
+   /**
+    * Constructs a MethodInvocation from the specified Method and
+    * arguments
+    * 
+    * This implementation uses a StatefulRemoteInvocation as the underlying 
+    * Invocation made, in order to support legacy EJB3 Core Containers
+    * 
+    * @param method
+    * @param args
+    * @return
+    */
+   @Override
+   protected MethodInvocation constructMethodInvocation(Method method, Object[] args)
+   {
+      long hash = MethodHashing.calculateHash(method);
+      MethodInvocation sri = new StatefulRemoteInvocation(this.getInterceptors(), hash, method, method, null, null);
+      return sri;
+   }
+
+}

Modified: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/objectfactory/ProxyObjectFactory.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -43,7 +43,7 @@
 import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
 import org.jboss.ejb3.common.registrar.spi.NotBoundException;
 import org.jboss.ejb3.proxy.factory.ProxyFactory;
-import org.jboss.ejb3.proxy.remoting.InvokableContextProxy;
+import org.jboss.ejb3.proxy.invocation.StatefulRemoteProxyInvocationHack;
 import org.jboss.ejb3.proxy.remoting.IsLocalProxyFactoryInterceptor;
 import org.jboss.logging.Logger;
 import org.jboss.remoting.InvokerLocator;
@@ -151,7 +151,7 @@
          // Create a POJI Proxy to the Registrar
          Interceptor[] interceptors =
          {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
-         PojiProxy handler = new InvokableContextProxy(proxyFactoryRegistryKey, locator, interceptors);
+         PojiProxy handler = new StatefulRemoteProxyInvocationHack(proxyFactoryRegistryKey, locator, interceptors);
          Class<?>[] interfaces = new Class<?>[]
          {this.getProxyFactoryClass()};
          proxyFactory = (ProxyFactory) Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, handler);

Deleted: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/InvokableContextProxy.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/InvokableContextProxy.java	2008-08-01 03:51:57 UTC (rev 76547)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/remoting/InvokableContextProxy.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -1,130 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.ejb3.proxy.remoting;
-
-import java.lang.reflect.Method;
-
-import org.jboss.aop.advice.Interceptor;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.aop.util.MethodHashing;
-import org.jboss.aspects.remoting.PojiProxy;
-import org.jboss.ejb3.common.lang.SerializableMethod;
-import org.jboss.remoting.InvokerLocator;
-
-/**
- * InvokableContextProxy
- * 
- * An EJB3-specific implementation of the Remoting PojiProxy
- * for an InvokableContext, responsible for rewriting the target method
- * "invoke" with that specified as the method to invoke
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class InvokableContextProxy extends PojiProxy
-{
-   // ------------------------------------------------------------------------------||
-   // Class Members  ---------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   private static final long serialVersionUID = 1L;
-
-   // ------------------------------------------------------------------------------||
-   // Constructor ------------------------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   public InvokableContextProxy(Object oid, InvokerLocator uri, Interceptor[] interceptors)
-   {
-      super(oid, uri, interceptors);
-   }
-
-   // ------------------------------------------------------------------------------||
-   // Overridden Implementations ---------------------------------------------------||
-   // ------------------------------------------------------------------------------||
-
-   //TODO Pending Release of jboss-remoting-aspects, stalled by failed build
-//   /**
-//    * Adds EJB3-specific metadata to the invocation before it's made
-//    */
-//   @Override
-//   protected void addMetadataToInvocation(MethodInvocation methodInvocation)
-//   {
-//      // Call Super
-//      super.addMetadataToInvocation(methodInvocation);
-//
-//      // Add metadata for the IsLocalProxyFactoryInterceptor
-//      //TODO
-//
-//   }
-
-   //TODO Pending Release of jboss-remoting-aspects, stalled by failed build
-//   /**
-//    * Proceed with the invocation upon InvokableContext.invoke(), 
-//    * setting the target method
-//    */
-//   @Override
-//   public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
-//   {
-//      MethodInvocation sri = this.constructMethodInvocation(method, args);
-//      sri.setArguments(args);
-//      this.addMetadataToInvocation(sri);
-//      return sri.invokeNext();
-//   }
-
-   //TODO Pending Release of jboss-remoting-aspects, stalled by failed build
-//   /**
-//    * Constructs a MethodInvocation from the specified Method and
-//    * arguments
-//    * 
-//    * @param method
-//    * @param args
-//    * @return
-//    */
-//   /*
-//    * Hack Smell, this would not be necessary if the Container could 
-//    * resolve InvokableContext.invoke()'s methodHash from the advisor.getMethodInfo(hash).
-//    * 
-//    * Code review requested by ALR
-//    */
-//   @Override
-//   protected MethodInvocation constructMethodInvocation(Method method, Object[] args)
-//   {
-//      // Some sanity checks
-//      assert args.length == 3; // InvokableContext.invoke(Object proxy, SerializableMethod method, Object[] args)
-//      Object targetMethodArg = args[1];
-//      assert targetMethodArg instanceof SerializableMethod : "Second argument expected to be "
-//            + SerializableMethod.class.getName();
-//      assert targetMethodArg != null : "Target method may not be null";
-//
-//      // Get the target method      
-//      SerializableMethod targetMethod = (SerializableMethod) targetMethodArg;
-//      Method realizedMethod = targetMethod.toMethod();
-//
-//      // Create and invoke upon a MethodInvocation
-//      long hash = MethodHashing.calculateHash(realizedMethod);
-//      MethodInvocation sri = new MethodInvocation(this.getInterceptors(), hash, realizedMethod, realizedMethod, null);
-//
-//      // Return
-//      return sri;
-//   }
-
-}

Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteInvocation.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteInvocation.java	                        (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/stateful/StatefulRemoteInvocation.java	2008-08-01 03:52:40 UTC (rev 76548)
@@ -0,0 +1,97 @@
+/*
+ * 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.ejb3.stateful;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.lang.reflect.Method;
+import org.jboss.aop.Advisor;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 62769 $
+ * @deprecated To be replaced by another invocation mechanism which provides way for
+ * Stateless/Stateful Invocations - probably descended from ContainerMethodInvocation in
+ * EJB3 Interceptors
+ */
+ at Deprecated
+public class StatefulRemoteInvocation extends MethodInvocation implements java.io.Externalizable
+{
+   private static final long serialVersionUID = 523913901046490941L;
+   
+   protected Object id;
+
+
+   public StatefulRemoteInvocation(Interceptor[] interceptors, long methodHash, Method advisedMethod, Method unadvisedMethod, Advisor advisor, Object id)
+   {
+      super(interceptors, methodHash, advisedMethod, unadvisedMethod, advisor);
+      this.id = id;
+   }
+
+   public StatefulRemoteInvocation()
+   {
+   }
+
+   public Object getId()
+   {
+      return id;
+   }
+
+   public Invocation getWrapper(Interceptor[] newchain)
+   {
+      throw new RuntimeException("NOT IMPLEMENTED");
+   }
+
+   public Invocation copy()
+   {
+      throw new RuntimeException("NOT IMPLEMENTED");
+   }
+
+   public void writeExternal(ObjectOutput out) throws IOException
+   {
+      super.writeExternal(out);
+      out.writeObject(id);
+   }
+
+   public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+   {
+      super.readExternal(in);
+      id = in.readObject();
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append("[");
+      sb.append("id=").append(id);
+      sb.append(", MethodInvocation=").append(super.toString());
+      sb.append("]");
+      return sb.toString();
+   }
+
+}




More information about the jboss-cvs-commits mailing list