Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.ha.hasessionstate.interfaces
Interface HASessionState

All Known Implementing Classes:
  HASessionStateImpl

public interface HASessionState

Interface for services providing clustered state session availability

Version:
  $Revision: 1.5 $

  Revisions:

Author:
  Sacha Labourey
See Also:
  `HASessionStateImpl`

Nested Class Summary
`static interface` | `HASessionState.HASessionStateListener` Information that can be used to clean a cache for example.

Method Summary
`void` | `createSession(String appName, Object keyId)` Share a new session state in the sub-partition of this cluster
`HAPartition` | `getCurrentHAPartition()`
`String` | `getNodeName()` Return the name of this node as used in the computations
`PackagedSession` | `getState(String appName, Object keyId)` Get a particular state
`PackagedSession` | `getStateWithOwnership(String appName, Object keyId)` Get a state and, if it is not already the case, takes its ownership (a state is always owned by a node)
`void` | `init()`
`void` | `removeSession(String appName, Object keyId)` Remove a session from the sub-partition
`void` | `setState(String appName, Object keyId, byte[] state)` Modifies a state already shared
`void` | `start()`
`void` | `subscribe(String appName, HASessionState.HASessionStateListener listener)` Subscribe to receive notifications when objects gets modified on another node.
`void` | `takeOwnership(String appName, Object keyId)` Take ownership of a state.
`void` | `unsubscribe(String appName, HASessionState.HASessionStateListener listener)`

Method Detail

### init

    public void init()
              throws Exception

  Throws:
    `Exception`

### start

    public void start()
               throws Exception

  Throws:
    `Exception`

### subscribe

    public void subscribe(String appName,
                          HASessionState.HASessionStateListener listener)

  Subscribe to receive notifications when objects gets modified on another node.

### unsubscribe

    public void unsubscribe(String appName,
                            HASessionState.HASessionStateListener listener)

### getCurrentHAPartition

    public HAPartition getCurrentHAPartition()

### getNodeName

    public String getNodeName()

  Return the name of this node as used in the computations

### createSession

    public void createSession(String appName,
                              Object keyId)

  Share a new session state in the sub-partition of this cluster

  Parameters:
    `appName` - Application name for which is state is shared
    `keyId` - Key identifier of the state

### setState

    public void setState(String appName,
                         Object keyId,
                         byte[] state)
                  throws RemoteException

  Modifies a state already shared

  Parameters:
    `appName` - Application name hosting this state
    `keyId` - Key identifier of the state to modify
    `state` - New state
  Throws:
    `RemoteException`

### getState

    public PackagedSession getState(String appName,
                                    Object keyId)

  Get a particular state

  Parameters:
    `appName` - Application hosting the state
    `keyId` - Key identifier of the state
  Returns:
    The state value

### getStateWithOwnership

    public PackagedSession getStateWithOwnership(String appName,
                                                 Object keyId)
                                          throws RemoteException

  Get a state and, if it is not already the case, takes its ownership (a state is always owned by a node)

  Parameters:
    `appName` - Application hosting the state
    `keyId` - Key identifier of the state
  Returns:
    The state value
  Throws:
    `RemoteException` - Thrown if an exception occurs while getting the ownership of the state

### takeOwnership

    public void takeOwnership(String appName,
                              Object keyId)
                       throws RemoteException

  Take ownership of a state. Each state is owned by a node.

  Parameters:
    `appName` - Application hosting the state
    `keyId` - Key identifier of the state
  Throws:
    `RemoteException` - Trown if a communication exception occurs while asking other node to get the ownership

### removeSession

    public void removeSession(String appName,
                              Object keyId)

  Remove a session from the sub-partition

  Parameters:
    `appName` - Application hosting the state
    `keyId` - Key identifier of the state

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.