org.garret.jipc
Interface JIPCSharedMemory

All Superinterfaces:
JIPCPrimitive

public interface JIPCSharedMemory
extends JIPCPrimitive

Shared memory object. This class is used to organize replication of data between all listeners of this object. Listener should use wait method to detect moment when object is updated by set method by some other session. Then it should call get method to get the most recent version of the object. If client prefer to receive updates asynchronously, it should lanunch separate thread which will preform wait in loop for updates of this object, thne get the most recent version of the object and somehow notify other threads that object is changed.

Semantic of methods inherited from JIPCPrimitive:

waitFor
Wait until version of the object at client becomes deteriorated. For local sessions, this metod always wait until set method is invoked. For remote sessions, sequence number of the object is remembered by local stub and is sent to the server to be compared with sequence number of shared memory object at the server.
reset
Do nothing


Field Summary
 
Fields inherited from interface org.garret.jipc.JIPCPrimitive
DEFAULT_RANK
 
Method Summary
 java.io.Serializable get()
          Get the most recent version of shared memory object.
 void set(java.io.Serializable obj)
          Make new objet visible to all other sessions using this shared memory object
 
Methods inherited from interface org.garret.jipc.JIPCPrimitive
alreadyExists, close, getName, priorityWait, priorityWait, reset, waitFor, waitFor
 

Method Detail

get

public java.io.Serializable get()
                         throws JIPCException,
                                java.io.IOException
Get the most recent version of shared memory object. If class of the object (or of it's components) placed in the shared memory by some other client can not be located at this system, then JIPCClassNotFoundException will be thrown.

Returns:
most recent object placed in shared memory
JIPCException
java.io.IOException

set

public void set(java.io.Serializable obj)
         throws JIPCException,
                java.io.IOException
Make new objet visible to all other sessions using this shared memory object

Parameters:
obj - and non-null serializable object (implementing java.io.Serializable interface)
JIPCException
java.io.IOException