User: slaboure
  Date: 01/11/09 14:49:03

  Added:       src/main/org/jboss/ha/hasessionstate/interfaces
                        HASessionState.java PackagedSession.java
  Log:
  Clustering for SFSB
  
  Revision  Changes    Path
  1.1                  
jbossmx/src/main/org/jboss/ha/hasessionstate/interfaces/HASessionState.java
  
  Index: HASessionState.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE WebOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package org.jboss.ha.hasessionstate.interfaces;
  
  import org.jboss.ha.hasessionstate.interfaces.PackagedSession;
  import org.jboss.ha.framework.interfaces.HAPartition;
  
  /**
   *   Interface for services providing clustered state session availability
   *
   *   @see HASessionStateImpl
   *   @author [EMAIL PROTECTED]
   *   @version $Revision: 1.1 $
   *
   * <p><b>Revisions:</b><br>
   */
  
  public interface HASessionState
  {   
     
     public void init () throws Exception;
     public void start () throws Exception;
     
     // Information that can be used to clean a cache for example. It indicates that
     // another node has touched a session that we were previously owning
     //
     public interface HASessionStateListener
     {
        public void sessionExternallyModified (PackagedSession session);
     }
     public void subscribe (String appName, HASessionStateListener listener);
     public void unsubscribe (String appName, HASessionStateListener listener);
     
     // Information that can be used to update its view of the sub-partition. Raised 
when
     // a new topology is computed.
     //
     public interface HASessionStateTopologyListener
     {
        public void newSessionStateTopology (HAPartition haSubPartition, boolean 
partitionHasChanged);
     }
  
     public void subscribe (HASessionStateTopologyListener listener);
     public void unsubscribe (HASessionStateTopologyListener listener);
     
     public HAPartition getCurrentHAPartition ();
     
     // Return the name of this node as used in the computations
     //
     public String getNodeName ();
     
     // Methods used to manage the internal state of the sub-partition
     //
     public void createSession (String appName, Object keyId);
     public void setState (String appName, Object keyId, byte[] state);
     
     public PackagedSession getState (String appName, Object keyId);
     public PackagedSession getStateWithOwnership (String appName, Object keyId) 
throws java.rmi.RemoteException;
     
     public void takeOwnership (String appName, Object keyId) throws 
java.rmi.RemoteException;
        
     public void removeSession (String appName, Object keyId);
     
  }
  
  
  
  
  1.1                  
jbossmx/src/main/org/jboss/ha/hasessionstate/interfaces/PackagedSession.java
  
  Index: PackagedSession.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE WebOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package org.jboss.ha.hasessionstate.interfaces;
  
  import java.io.Serializable;
  
  /**
   *   Information about a session that is shared by nodes in a same sub-partition
   *
   *   @see HASessionState, PackagedSessionImpl
   *   @author [EMAIL PROTECTED]
   *   @version $Revision: 1.1 $
   *
   * <p><b>Revisions:</b><br>
   */
  
  
  public interface PackagedSession extends Serializable
  {   
     public byte[] getState ();
     public boolean setState (byte[] state);
     
     public boolean isStateIdentical (byte[] state);
     public void update (PackagedSession clone);
     
     public String getOwner ();
     public void setOwner (String owner);
     
     public long getVersion ();
     
     public Serializable getKey ();
     public void setKey (Serializable key);
     
     public long unmodifiedExistenceInVM ();
  }
  
  
  

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

Reply via email to