net.sf.jso.remote
Class StorageControllerProxy

java.lang.Object
  extended bynet.sf.jso.remote.StorageControllerProxy
All Implemented Interfaces:
java.util.EventListener, LockManager, SchemaManager, java.io.Serializable, StorageController, StorageListener

public class StorageControllerProxy
extends java.lang.Object
implements StorageController, java.io.Serializable

Proxy for remote storage controllers.

See Also:
Serialized Form

Field Summary
 RemoteStorageController controller
           
 
Constructor Summary
StorageControllerProxy()
          Constructs the proxy.
StorageControllerProxy(RemoteStorageController aController)
          Constructs the proxy.
 
Method Summary
 void addSchemaListener(SchemaListener listener)
          Not supported.
 void addStatusListener(StatusListener listener)
          Not supported.
 void addStorageListener(StorageListener listener)
          Not supported.
 void connect(java.lang.String registryUrl, java.lang.String user, java.lang.String password)
          Connects the proxy to the remote storage controller through a storage controller home.
 ClassDescriptor createClassDescriptor(java.lang.Class aClass)
          Creates a class descriptor for a storable class.
 long createId()
          Creates an unique identification within a database.
 boolean equals(java.lang.Object o)
          Indicates whether some other proxy is "equal to" this one.
 ClassDescriptor getClassDescriptor(java.lang.Class aClass)
          Returns the descriptor for a storable class.
 java.util.Properties getConfigurationProperties()
          Returns configuration properties.
 ControllerInfo getControllerInfo()
          Gets storage control information.
 int getCurrentCycle()
          Gets current garbage collection cycle.
 PID getCurrentPID()
          Gets current storage partition's identification.
 LockInfo getLockInfo()
          Gets transaction processing information.
 Status getStatus()
          Gets controller's status.
 int hashCode()
          Returns a hash code value for the proxy.
 boolean isRemote()
          Indicates if controller is running on another JVM.
 void lock(TID txid, OID oid, boolean exclusive, long timeout)
          Holds a lock for an object.
 void objectDeleted(StorageEvent event)
          Called when an object is deleted.
 void objectStored(StorageEvent event)
          Called when an object is stored.
 void registerManager(StorageManager manager)
          Register a storage manager to receive events.
 void release(TID txid, OID oid)
          Releases the lock for an object
 void removeSchemaListener(SchemaListener listener)
          Not supported.
 void removeStatusListener(StatusListener listener)
          Not supported.
 void removeStorageListener(StorageListener listener)
          Not supported.
 void start()
          Not supported.
 void stop()
          Not supported.
 void unregisterManager(StorageManager manager)
          Unregister a storage manager to receive events.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controller

public RemoteStorageController controller
Constructor Detail

StorageControllerProxy

public StorageControllerProxy()
Constructs the proxy.


StorageControllerProxy

public StorageControllerProxy(RemoteStorageController aController)
Constructs the proxy.

Parameters:
aController - Reference to remote storage controller.
Method Detail

connect

public void connect(java.lang.String registryUrl,
                    java.lang.String user,
                    java.lang.String password)
             throws StorageException
Connects the proxy to the remote storage controller through a storage controller home.

Parameters:
registryUrl - JNDI URL for storage controller home.
user - User name for authentication.
password - User's password.
Throws:
StorageException

start

public void start()
           throws StorageException
Not supported.

Specified by:
start in interface StorageController
Throws:
RuntimeStorageException - Always.
StorageException

stop

public void stop()
          throws StorageException
Not supported.

Specified by:
stop in interface StorageController
Throws:
RuntimeStorageException - Always.
StorageException

getConfigurationProperties

public java.util.Properties getConfigurationProperties()
Description copied from interface: StorageController
Returns configuration properties. Managers use this method to configure themselves.

Specified by:
getConfigurationProperties in interface StorageController
Returns:
Configuration properties.
See Also:
StorageController.getConfigurationProperties()

getStatus

public Status getStatus()
Description copied from interface: StorageController
Gets controller's status.

Specified by:
getStatus in interface StorageController
Returns:
Controller's current status.
See Also:
StorageController.getStatus()

isRemote

public boolean isRemote()
Description copied from interface: StorageController
Indicates if controller is running on another JVM.

Specified by:
isRemote in interface StorageController
Returns:
true if controller is running on another JVM; false otherwise.
See Also:
StorageController.isRemote()

createId

public long createId()
              throws StorageException
Description copied from interface: StorageController
Creates an unique identification within a database.

Specified by:
createId in interface StorageController
Returns:
An unique id.
Throws:
StorageException
See Also:
StorageController.createId()

getControllerInfo

public ControllerInfo getControllerInfo()
Description copied from interface: StorageController
Gets storage control information.

Specified by:
getControllerInfo in interface StorageController
Returns:
Information about storage control.
See Also:
StorageController.getControllerInfo()

getCurrentPID

public PID getCurrentPID()
                  throws StorageException
Description copied from interface: StorageController
Gets current storage partition's identification.

Specified by:
getCurrentPID in interface StorageController
Returns:
Current storage partition's identification.
Throws:
StorageException
See Also:
StorageController.getCurrentPID()

getCurrentCycle

public int getCurrentCycle()
Description copied from interface: StorageController
Gets current garbage collection cycle.

Specified by:
getCurrentCycle in interface StorageController
Returns:
Current garbage collection cycle.
See Also:
StorageController.getCurrentCycle()

registerManager

public void registerManager(StorageManager manager)
Description copied from interface: StorageController
Register a storage manager to receive events.

Specified by:
registerManager in interface StorageController
Parameters:
manager - Manager to be registered.
See Also:
StorageController.registerManager(StorageManager)

unregisterManager

public void unregisterManager(StorageManager manager)
Description copied from interface: StorageController
Unregister a storage manager to receive events.

Specified by:
unregisterManager in interface StorageController
Parameters:
manager - Manager to be unregistered.
See Also:
StorageController.unregisterManager(StorageManager)

addStatusListener

public void addStatusListener(StatusListener listener)
Not supported.

Specified by:
addStatusListener in interface StorageController
Parameters:
listener - Listener to receive status events.
Throws:
RuntimeStorageException - Always.

removeStatusListener

public void removeStatusListener(StatusListener listener)
Not supported.

Specified by:
removeStatusListener in interface StorageController
Parameters:
listener - Listener to stop receiving status events.
Throws:
RuntimeStorageException - Always.

addStorageListener

public void addStorageListener(StorageListener listener)
Not supported.

Specified by:
addStorageListener in interface StorageController
Parameters:
listener - Listener to receive storage events.
Throws:
RuntimeStorageException - Always.

removeStorageListener

public void removeStorageListener(StorageListener listener)
Not supported.

Specified by:
removeStorageListener in interface StorageController
Parameters:
listener - Listener to stop receiving storage events.
Throws:
RuntimeStorageException - Always.

lock

public void lock(TID txid,
                 OID oid,
                 boolean exclusive,
                 long timeout)
          throws TransactionTimeoutException
Description copied from interface: LockManager
Holds a lock for an object. All locks are released when transaction finishes.

Specified by:
lock in interface LockManager
Parameters:
oid - The OID of the object to be locked.
exclusive - Informs if the lock should be exclusive.
timeout - Number of milliseconds for timeout. Values lesser than 1 millisecond mean no timeout should be used.
Throws:
TransactionTimeoutException
See Also:
LockManager.lock(TID,OID,boolean,long)

release

public void release(TID txid,
                    OID oid)
             throws StorageException
Description copied from interface: LockManager
Releases the lock for an object

Specified by:
release in interface LockManager
Parameters:
oid - The OID of the object to be released.
Throws:
StorageException
See Also:
LockManager.release(TID,OID)

getLockInfo

public LockInfo getLockInfo()
Description copied from interface: LockManager
Gets transaction processing information.

Specified by:
getLockInfo in interface LockManager
Returns:
Information about transaction processing.
See Also:
LockManager.getLockInfo()

addSchemaListener

public void addSchemaListener(SchemaListener listener)
Not supported.

Specified by:
addSchemaListener in interface SchemaManager
Parameters:
listener - Listener to receive schema events.
Throws:
RuntimeStorageException - Always.

removeSchemaListener

public void removeSchemaListener(SchemaListener listener)
Not supported.

Specified by:
removeSchemaListener in interface SchemaManager
Parameters:
listener - Listener to stop receiving schema events.
Throws:
RuntimeStorageException - Always.

getClassDescriptor

public ClassDescriptor getClassDescriptor(java.lang.Class aClass)
                                   throws StorageException
Description copied from interface: SchemaManager
Returns the descriptor for a storable class.

Specified by:
getClassDescriptor in interface SchemaManager
Parameters:
aClass - The class to which the descriptot should be returned.
Returns:
The class descriptor.
Throws:
StorageException
See Also:
SchemaManager.getClassDescriptor(Class)

createClassDescriptor

public ClassDescriptor createClassDescriptor(java.lang.Class aClass)
                                      throws StorageException
Description copied from interface: SchemaManager
Creates a class descriptor for a storable class.

Specified by:
createClassDescriptor in interface SchemaManager
Parameters:
aClass - The class to which the descriptot should be created.
Returns:
The class descriptor.
Throws:
StorageException
See Also:
SchemaManager.createClassDescriptor(Class)

objectStored

public void objectStored(StorageEvent event)
Description copied from interface: StorageListener
Called when an object is stored.

Specified by:
objectStored in interface StorageListener
See Also:
StorageListener.objectStored(StorageEvent)

objectDeleted

public void objectDeleted(StorageEvent event)
Description copied from interface: StorageListener
Called when an object is deleted.

Specified by:
objectDeleted in interface StorageListener
See Also:
StorageListener.objectDeleted(StorageEvent)

equals

public boolean equals(java.lang.Object o)
Indicates whether some other proxy is "equal to" this one.

Parameters:
o - The object with which to compare.
Returns:
true if the proxy is the same as the proxy argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the proxy.

Returns:
A hash code value for the proxy.