com.caucho.server.cluster
Class ClusterObject

java.lang.Object
  extended by com.caucho.server.cluster.ClusterObject

public class ClusterObject
extends java.lang.Object

Data for the cluster's object.


Method Summary
 void accessImpl()
          Called when the object is accessed to updateImpl the objectAccess time.
 long getAccessWindow()
          Returns the objectAccess window.
 long getExpireInterval()
          Sets the max objectAccess time.
 long getMaxIdleTime()
          Returns the max idle time.
 HashKey getObjectId()
          Returns the object id.
 java.lang.Object getObjectManagerKey()
          Returns the object manager key
 int getPrimaryIndex()
          Returns the primary index for the object
 ClusterServer getPrimaryServer()
          Returns the primary server for the object
 int getSecondaryIndex()
          Returns the secondary server for the object
 ClusterServer getSecondaryServer()
          Returns the secondary server for the object
 Store getStore()
          Returns the objectStore.
 HashKey getStoreId()
          Returns the objectStore id.
 StoreManager getStoreManager()
          Returns the objectStore manager.
 int getTertiaryIndex()
          Returns the tertiary server for the object
 ClusterServer getTertiaryServer()
          Returns the tertiary server for the object
 boolean isPrimary()
           
 void objectAccess()
          Called by the object when it is accessed to invalidate the access time.
 void objectCreate()
          Called when the object is newly created.
 void objectInvalidated()
          Marks that the object no longer contains valid data
 boolean objectLoad(java.lang.Object obj)
          Called by the object to load itself from the cluster.
 void objectModified()
          Signals that the object has been changed by the application, i.e.
 void objectRemove()
          Called by the object to remove itself from the cluster.
 void objectStore(java.lang.Object obj)
          Called by the object to save itself to the cluster.
 void removeImpl()
          Removes the object from the cluster.
 void setAccessTime(long accessTime)
          Sets the objectAccess time.
 void setExpireInterval(long expireInterval)
          Sets the max objectAccess time.
 void setMaxIdleTime(long maxIdleTime)
          Sets the max idle time.
 void setObjectManager(ObjectManager objectManager)
           
 void setObjectManagerKey(java.lang.Object key)
          Sets the object manager key
 java.lang.String toString()
           
 void updateImpl()
          Signals that the object has been updated externally, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setObjectManager

public void setObjectManager(ObjectManager objectManager)

isPrimary

public boolean isPrimary()

getStore

public Store getStore()
Returns the objectStore.


getStoreManager

public StoreManager getStoreManager()
Returns the objectStore manager.


getStoreId

public HashKey getStoreId()
Returns the objectStore id.


getObjectId

public HashKey getObjectId()
Returns the object id.


getObjectManagerKey

public java.lang.Object getObjectManagerKey()
Returns the object manager key


setObjectManagerKey

public void setObjectManagerKey(java.lang.Object key)
Sets the object manager key


setAccessTime

public void setAccessTime(long accessTime)
Sets the objectAccess time.


getExpireInterval

public long getExpireInterval()
Sets the max objectAccess time.


setExpireInterval

public void setExpireInterval(long expireInterval)
Sets the max objectAccess time.


getMaxIdleTime

public long getMaxIdleTime()
Returns the max idle time.


setMaxIdleTime

public void setMaxIdleTime(long maxIdleTime)
Sets the max idle time.


getAccessWindow

public long getAccessWindow()
Returns the objectAccess window.


getPrimaryIndex

public int getPrimaryIndex()
Returns the primary index for the object


getSecondaryIndex

public int getSecondaryIndex()
Returns the secondary server for the object


getTertiaryIndex

public int getTertiaryIndex()
Returns the tertiary server for the object


getPrimaryServer

public ClusterServer getPrimaryServer()
Returns the primary server for the object


getSecondaryServer

public ClusterServer getSecondaryServer()
Returns the secondary server for the object


getTertiaryServer

public ClusterServer getTertiaryServer()
Returns the tertiary server for the object


objectAccess

public void objectAccess()
Called by the object when it is accessed to invalidate the access time.


objectCreate

public void objectCreate()
Called when the object is newly created.


objectInvalidated

public void objectInvalidated()
Marks that the object no longer contains valid data


objectLoad

public boolean objectLoad(java.lang.Object obj)
Called by the object to load itself from the cluster. If the object fails to load, its contents may be in an inconsistent state.

Returns:
true on success.

objectModified

public void objectModified()
Signals that the object has been changed by the application, i.e. that the object needs to be saved to the persistent objectStore.


objectRemove

public void objectRemove()
Called by the object to remove itself from the cluster.


objectStore

public void objectStore(java.lang.Object obj)
                 throws java.io.IOException
Called by the object to save itself to the cluster.

Throws:
java.io.IOException

updateImpl

public void updateImpl()
Signals that the object has been updated externally, i.e. that the persistent objectStore now has a more current version of the object's data.


accessImpl

public void accessImpl()
Called when the object is accessed to updateImpl the objectAccess time.


removeImpl

public void removeImpl()
Removes the object from the cluster.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object