User: slaboure
  Date: 01/11/09 14:53:08

  Added:       src/main/org/jboss/ejb/plugins/jrmp/interfaces
                        StatefulSessionProxyHA.java
  Log:
  Clustering for SFSB
  
  Revision  Changes    Path
  1.1                  
jbossmx/src/main/org/jboss/ejb/plugins/jrmp/interfaces/StatefulSessionProxyHA.java
  
  Index: StatefulSessionProxyHA.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.ejb.plugins.jrmp.interfaces;
  
  import java.io.IOException;
  import java.io.ObjectOutput;
  import java.io.ObjectInput;
  
  import java.rmi.MarshalledObject;
  import java.lang.reflect.Method;
  
  import javax.naming.InitialContext;
  import javax.ejb.EJBObject;
  import javax.ejb.EJBHome;
  
  import org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker;
  import org.jboss.ejb.CacheKey;
  import org.jboss.ha.framework.interfaces.HARMIProxy;
  
  /**
   * An EJB SFSB HA proxy class.
   *      
   * @author  <a href="mailto:[EMAIL PROTECTED]";>Sacha Labourey</a>.
   * @version $Revision: 1.1 $
   */
  public class StatefulSessionProxyHA extends StatefulSessionProxy
  {
     // Constants -----------------------------------------------------
  
     // Attributes ----------------------------------------------------
  
     // Static --------------------------------------------------------
     
     // Constructors --------------------------------------------------
     
     /**
      * No-argument constructor for externalization.
      */
     public StatefulSessionProxyHA () {}
  
     /**
      * Construct a <tt>EntityProxy</tt>.
      *
      * @param name          The JNDI name of the container that we proxy for.
      * @param container     The remote interface of the invoker for which
      *                      this is a proxy for.
      * @param id            The primary key of the entity.
      * @param optimize      True if the proxy will attempt to optimize
      *                      VM-local calls.
      *
      * @throws NullPointerException     Id may not be null.
      */
     public StatefulSessionProxyHA (final String name, final ContainerRemote 
container, final Object id, final boolean optimize)
     {
        super(name, container, id, optimize);
     }
      
     // Public --------------------------------------------------------
  
     // Package protected ---------------------------------------------
     
     // Protected -----------------------------------------------------
     
     /**
      * Externalization support.
      *
      * @param out
      *
      * @throws IOException
      */
     public void writeExternal(final ObjectOutput out)
        throws IOException
     {
        out.writeUTF(name);
        out.writeObject(container);
        out.writeBoolean(optimize);
        out.writeObject(initialContextHandle);
        out.writeObject(id);
     }
      
     /**
      * Externalization support.
      *
      * @param in
      *
      * @throws IOException
      * @throws ClassNotFoundException
      */
     public void readExternal(final ObjectInput in)
        throws IOException, ClassNotFoundException
     {
        name = in.readUTF();
        container = (ContainerRemote)in.readObject();
        optimize = in.readBoolean();
        initialContextHandle = (InitialContextHandle)in.readObject();
        id = in.readObject();
     }
      
     public void setHAProxy(ContainerRemote proxy)
     {
        container = proxy;
     }
  
     // Protected -----------------------------------------------------
  
     /**
      *  Returns <code>true</code> iff this instance lives in the same
      *  VM as its container.
      */
     protected boolean isLocal()
     {
        return ((HARMIProxy)container).isLocal();
     }
     // Private -------------------------------------------------------
      
     // Inner classes -------------------------------------------------
  }
  
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to