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 access()
          Marks the object as accessed.
 void change()
          Signals that the object has been changed by the application, i.e.
 long getAccessWindow()
          Returns the access window.
 long getExpireInterval()
          Sets the max access time.
 long getMaxIdleTime()
          Returns the max idle time.
 java.lang.String getObjectId()
          Returns the object id.
 Store getStore()
          Returns the store.
 java.lang.String getStoreId()
          Returns the store id.
 StoreManager getStoreManager()
          Returns the store manager.
 java.lang.String getUniqueId()
          Returns the unique id.
 boolean load(java.lang.Object obj)
          Loads the object from the cluster.
 ReadStream openRead()
          Reads the current value
 void remove()
          Removes the object from the cluster.
 void removeImpl()
          Removes the object from the cluster.
 void setAccessTime(long accessTime)
          Sets the access time.
 void setExpireInterval(long expireInterval)
          Sets the max access time.
 void setMaxIdleTime(long maxIdleTime)
          Sets the max idle time.
 void setObjectManager(ObjectManager objectManager)
           
 void setPrimary(boolean primary)
          Sets true for the primary server.
 void setValid()
          Sets the object's saved update count
 void store(java.lang.Object obj)
          Saves the object to the cluster.
 void update()
          Signals that the object has been updated externally, i.e.
 void write(java.io.InputStream is)
          Writes updated values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setObjectManager

public void setObjectManager(ObjectManager objectManager)

getStore

public Store getStore()
Returns the store.


getStoreManager

public StoreManager getStoreManager()
Returns the store manager.


getStoreId

public java.lang.String getStoreId()
Returns the store id.


getObjectId

public java.lang.String getObjectId()
Returns the object id.


getUniqueId

public java.lang.String getUniqueId()
Returns the unique id.


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 access window.


setPrimary

public void setPrimary(boolean primary)
Sets true for the primary server.


setValid

public void setValid()
Sets the object's saved update count


load

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

Returns:
true on success.

update

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


change

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


access

public void access()
Marks the object as accessed.


setAccessTime

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


getExpireInterval

public long getExpireInterval()
Sets the max access time.


setExpireInterval

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


store

public void store(java.lang.Object obj)
           throws java.io.IOException
Saves the object to the cluster.

Throws:
java.io.IOException

write

public void write(java.io.InputStream is)
           throws java.io.IOException
Writes updated values

Throws:
java.io.IOException

openRead

public ReadStream openRead()
                    throws java.io.IOException
Reads the current value

Throws:
java.io.IOException

remove

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


removeImpl

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