User: oberg   
  Date: 00/08/15 23:44:47

  Modified:    src/main/org/jboss/ejb/plugins/jrmp/interfaces
                        ContainerRemote.java EntityProxy.java
                        GenericProxy.java HomeProxy.java
                        RemoteMethodInvocation.java StatefulHandleImpl.java
                        StatefulSessionProxy.java
                        StatelessSessionProxy.java
  Log:
  Made proxies implement Externalizable as a performance fix.
  Added MarshalledObject wrapping on return values to fix classloader problems
  
  Revision  Changes    Path
  1.6       +3 -3      
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/ContainerRemote.java
  
  Index: ContainerRemote.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/ContainerRemote.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ContainerRemote.java      2000/08/06 21:36:01     1.5
  +++ ContainerRemote.java      2000/08/16 06:44:43     1.6
  @@ -18,7 +18,7 @@
    *      
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
  - *   @version $Revision: 1.5 $
  + *   @version $Revision: 1.6 $
    */
   public interface ContainerRemote
      extends Remote
  @@ -31,10 +31,10 @@
      // Public --------------------------------------------------------
   
      // ContainerRemote implementation --------------------------------
  -   public Object invokeHome(MarshalledObject mi)
  +   public MarshalledObject invokeHome(MarshalledObject mi)
         throws Exception;
   
  -   public Object invoke(MarshalledObject mi)
  +   public MarshalledObject invoke(MarshalledObject mi)
         throws Exception;
   
      public Object invokeHome(Method m, Object[] args, Transaction tx,
  
  
  
  1.13      +10 -5     
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/EntityProxy.java
  
  Index: EntityProxy.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/EntityProxy.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- EntityProxy.java  2000/08/08 21:19:40     1.12
  +++ EntityProxy.java  2000/08/16 06:44:44     1.13
  @@ -20,7 +20,7 @@
    *      @see <related>
    *      @author Rickard �berg ([EMAIL PROTECTED])
    *           @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  - *      @version $Revision: 1.12 $
  + *      @version $Revision: 1.13 $
    */
   public class EntityProxy
      extends GenericProxy
  @@ -59,6 +59,11 @@
      }
   
      // Constructors --------------------------------------------------
  +   public EntityProxy()
  +   {
  +      // For externalization to work
  +   }
  +   
      public EntityProxy(String name, ContainerRemote container, Object id, boolean 
optimize)
      {
                super(name, container, optimize);
  @@ -148,17 +153,17 @@
      // Package protected ---------------------------------------------
       
      // Protected -----------------------------------------------------
  -   protected void writeObject(java.io.ObjectOutputStream out)
  +   public void writeExternal(java.io.ObjectOutput out)
         throws IOException
      {
  -             super.writeObject(out);
  +             super.writeExternal(out);
        out.writeObject(id);
      }
      
  -   protected void readObject(java.io.ObjectInputStream in)
  +   public void readExternal(java.io.ObjectInput in)
         throws IOException, ClassNotFoundException
      {
  -     super.readObject(in);
  +     super.readExternal(in);
        id = in.readObject();
      }
       
  
  
  
  1.7       +13 -7     
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/GenericProxy.java
  
  Index: GenericProxy.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/GenericProxy.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GenericProxy.java 2000/08/06 21:36:01     1.6
  +++ GenericProxy.java 2000/08/16 06:44:44     1.7
  @@ -24,10 +24,10 @@
    *      
    *      @see <related>
    *      @author Rickard �berg ([EMAIL PROTECTED])
  - *      @version $Revision: 1.6 $
  + *      @version $Revision: 1.7 $
    */
  -public class GenericProxy
  -   implements java.io.Serializable
  +public abstract class GenericProxy
  +   implements java.io.Externalizable
   {
      // Constants -----------------------------------------------------
       
  @@ -63,6 +63,11 @@
     }
   
      // Constructors --------------------------------------------------
  +   public GenericProxy()
  +   {
  +      // For externalization to work
  +   }
  +   
      protected GenericProxy(String name, ContainerRemote container, boolean optimize)
      {
         this.name = name;
  @@ -80,16 +85,16 @@
         return containerStartup == ContainerRemote.startup;
      }
       
  -   protected void writeObject(java.io.ObjectOutputStream out)
  +   public void writeExternal(java.io.ObjectOutput out)
         throws IOException
      {
          out.writeUTF(name);
          out.writeObject(isLocal() ? container : null);
  -      out.writeLong(containerStartup);
  -      out.writeBoolean(optimize);
  +        out.writeLong(containerStartup);
  +        out.writeBoolean(optimize);
      }
      
  -   protected void readObject(java.io.ObjectInputStream in)
  +   public void readExternal(java.io.ObjectInput in)
         throws IOException, ClassNotFoundException
      {
        name = in.readUTF();
  @@ -103,6 +108,7 @@
            container = getLocal(name);
         }
      }
  +   
      // Private -------------------------------------------------------
      
      // Inner classes -------------------------------------------------
  
  
  
  1.14      +25 -3     
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/HomeProxy.java
  
  Index: HomeProxy.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/HomeProxy.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- HomeProxy.java    2000/08/14 15:07:53     1.13
  +++ HomeProxy.java    2000/08/16 06:44:44     1.14
  @@ -6,10 +6,12 @@
    */
   package org.jboss.ejb.plugins.jrmp.interfaces;
   
  -import javax.naming.Name;
  +import java.io.IOException;
   import java.lang.reflect.Method;
   import java.rmi.MarshalledObject;
   
  +import javax.naming.Name;
  +
   import javax.ejb.EJBHome;
   import javax.ejb.EJBObject;
   import javax.ejb.Handle;
  @@ -24,7 +26,7 @@
    *      @see <related>
    *      @author Rickard �berg ([EMAIL PROTECTED])
    *           @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  - *      @version $Revision: 1.13 $
  + *      @version $Revision: 1.14 $
    */
   public class HomeProxy
      extends GenericProxy
  @@ -68,6 +70,11 @@
   
   
      // Constructors --------------------------------------------------
  +   public HomeProxy()
  +   {
  +      // For externalization to work
  +   }
  +   
      public HomeProxy(String name, EJBMetaData ejbMetaData, ContainerRemote 
container, boolean optimize)
      {
          super(name, container, optimize);
  @@ -218,11 +225,26 @@
                rmi.setCredential( getCredential() );
             
             // Invoke on the remote server, enforce marshalling
  -             return container.invokeHome(new MarshalledObject(rmi));
  +             return container.invokeHome(new MarshalledObject(rmi)).get();
             }
         }
      }
   
  +   public void writeExternal(java.io.ObjectOutput out)
  +      throws IOException
  +   {
  +      super.writeExternal(out);
  +        
  +      out.writeObject(ejbMetaData);
  +   }
  +   
  +   public void readExternal(java.io.ObjectInput in)
  +      throws IOException, ClassNotFoundException
  +   {
  +      super.readExternal(in);
  +      
  +     ejbMetaData = (EJBMetaData)in.readObject();
  +   }
      // Package protected ---------------------------------------------
       
      // Protected -----------------------------------------------------
  
  
  
  1.7       +10 -5     
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/RemoteMethodInvocation.java
  
  Index: RemoteMethodInvocation.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/RemoteMethodInvocation.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteMethodInvocation.java       2000/08/06 21:36:01     1.6
  +++ RemoteMethodInvocation.java       2000/08/16 06:44:45     1.7
  @@ -27,10 +27,10 @@
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *  @author <a href="mailto:[EMAIL PROTECTED]">Richard 
Monson-Haefel</a>.
    *  @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>.
  - *   @version $Revision: 1.6 $
  + *   @version $Revision: 1.7 $
    */
   public final class RemoteMethodInvocation
  -   implements java.io.Serializable
  +   implements java.io.Externalizable
   {
      // Constants -----------------------------------------------------
   
  @@ -43,7 +43,7 @@
        
        Transaction tx;
        Principal identity;
  -  Object credential;
  +   Object credential;
        
        transient Map methodMap;
   
  @@ -80,6 +80,11 @@
      }
        
      // Constructors --------------------------------------------------
  +   public RemoteMethodInvocation()
  +   {
  +      // For externalization to work
  +   }
  +   
      public RemoteMethodInvocation(Method m, Object[] args)
      {
         this(null, m, args);
  @@ -146,7 +151,7 @@
      // Package protected ---------------------------------------------
   
      // Protected -----------------------------------------------------
  -   protected void writeObject(java.io.ObjectOutputStream out)
  +   public void writeExternal(java.io.ObjectOutput out)
         throws IOException
      {
        out.writeObject(id);
  @@ -157,7 +162,7 @@
                out.writeObject(identity);
      }
      
  -   protected void readObject(java.io.ObjectInputStream in)
  +   public void readExternal(java.io.ObjectInput in)
         throws IOException, ClassNotFoundException
      {
        id = in.readObject();
  
  
  
  1.3       +2 -2      
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulHandleImpl.java
  
  Index: StatefulHandleImpl.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulHandleImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StatefulHandleImpl.java   2000/08/14 15:05:33     1.2
  +++ StatefulHandleImpl.java   2000/08/16 06:44:45     1.3
  @@ -22,7 +22,7 @@
    *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *   @author <a href="mailto:[EMAIL PROTECTED]>Marc Fleury</a>
  - *   @version $Revision: 1.2 $
  + *   @version $Revision: 1.3 $
    */
   public class StatefulHandleImpl
      implements Handle
  @@ -83,7 +83,7 @@
             // rmi.setCredential( getCredential() );
             
             // Invoke on the remote server, enforce marshalling
  -          return (EJBObject) container.invokeHome(new MarshalledObject(rmi));
  +          return (EJBObject) container.invokeHome(new MarshalledObject(rmi)).get();
            
         
         } catch (Exception e) {
  
  
  
  1.13      +10 -5     
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulSessionProxy.java
  
  Index: StatefulSessionProxy.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulSessionProxy.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StatefulSessionProxy.java 2000/08/14 15:05:33     1.12
  +++ StatefulSessionProxy.java 2000/08/16 06:44:45     1.13
  @@ -21,7 +21,7 @@
    *      @see <related>
    *      @author Rickard �berg ([EMAIL PROTECTED])
    *           @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  - *      @version $Revision: 1.12 $
  + *      @version $Revision: 1.13 $
    */
   public class StatefulSessionProxy
      extends GenericProxy
  @@ -61,6 +61,11 @@
      }
   
      // Constructors --------------------------------------------------
  +   public StatefulSessionProxy()
  +   {
  +      // For externalization to work
  +   }
  +   
      public StatefulSessionProxy(String name, ContainerRemote container, Object id, 
boolean optimize)
      {
          super(name, container, optimize);
  @@ -165,17 +170,17 @@
      // Package protected ---------------------------------------------
       
      // Protected -----------------------------------------------------
  -   protected void writeObject(java.io.ObjectOutputStream out)
  +   public void writeExternal(java.io.ObjectOutput out)
         throws IOException
      {
  -    super.writeObject(out);
  +    super.writeExternal(out);
       out.writeObject(id);
      }
      
  -   protected void readObject(java.io.ObjectInputStream in)
  +   public void readExternal(java.io.ObjectInput in)
         throws IOException, ClassNotFoundException
      {
  -    super.readObject(in);
  +    super.readExternal(in);
       id = in.readObject();
      }
       
  
  
  
  1.9       +7 -2      
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatelessSessionProxy.java
  
  Index: StatelessSessionProxy.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatelessSessionProxy.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StatelessSessionProxy.java        2000/08/08 21:29:00     1.8
  +++ StatelessSessionProxy.java        2000/08/16 06:44:46     1.9
  @@ -21,10 +21,10 @@
   *      @see <related>
   *      @author Rickard �berg ([EMAIL PROTECTED])
   *       @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  -*      @version $Revision: 1.8 $
  +*      @version $Revision: 1.9 $
   */
   public class StatelessSessionProxy
  -extends GenericProxy
  +   extends GenericProxy
   {
        // Constants -----------------------------------------------------
        
  @@ -60,6 +60,11 @@
        
        
        // Constructors --------------------------------------------------
  +   public StatelessSessionProxy()
  +   {
  +      // For externalization to work
  +   }
  +   
        public StatelessSessionProxy(String name, ContainerRemote container, boolean 
optimize)
        {
                super(name, container, optimize);
  
  
  

Reply via email to