|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ReplicationContext
A context object
that provides the functions required for a client or a server to implement
networking code related with replication communication. This is provided
to and used by ReplicationClientContextHandler and
ReplicationServerContextHandler.
| Nested Class Summary | |
|---|---|
static class |
ReplicationContext.State
Represents the state of the connection between two Replicas. |
| Method Summary | |
|---|---|
void |
cancelAllExpirations()
Cancells all scheduled expirations. |
java.lang.Object |
cancelExpiration(int sequence)
Cancels the expiration scheduled by calling scheduleExpiration(Object). |
ReplicationConfiguration |
getConfiguration()
Returns the current ReplicationConfiguration of the
Replica which is managing this context. |
int |
getNextSequence()
Generates a new and unique sequence number of protocol message. |
Replica |
getPeer()
Returns the remote peer Replica that this context is connected
to. |
int |
getScheduledExpirations()
Returns the number of the scheduled experations. |
ReplicationService |
getService()
Returns the ReplicationService which is managing this
context. |
DirectoryServiceConfiguration |
getServiceConfiguration()
Returns the DirectoryServiceConfiguration which owns the
ReplicationService which is managing this context. |
IoSession |
getSession()
Returns MINA IoSession
instance that is associated with the current connection to
the remote Replica. |
ReplicationContext.State |
getState()
Returns the current state of the Replica this context is
managing. |
boolean |
replicate()
Forces this context to send replication data to the peer replica immediately. |
void |
scheduleExpiration(java.lang.Object message)
Schedules an expiration of the specified message. |
void |
setPeer(Replica peer)
Sets the remote peer Replica that this context is connected
to. |
void |
setState(ReplicationContext.State state)
Sets the current state of the Replica this context is
managing. |
| Method Detail |
|---|
IoSession getSession()
IoSession
instance that is associated with the current connection to
the remote Replica.
ReplicationConfiguration getConfiguration()
ReplicationConfiguration of the
Replica which is managing this context.
ReplicationService getService()
ReplicationService which is managing this
context.
DirectoryServiceConfiguration getServiceConfiguration()
DirectoryServiceConfiguration which owns the
ReplicationService which is managing this context.
int getNextSequence()
Replica getPeer()
Replica that this context is connected
to.
void setPeer(Replica peer)
Replica that this context is connected
to. A user has authenticate the remote peer first and call this method
manually to prevent unauthorized access.
ReplicationContext.State getState()
Replica this context is
managing.
void setState(ReplicationContext.State state)
Replica this context is
managing.
void scheduleExpiration(java.lang.Object message)
cancelExpiration(int) method is not
invoked within a certain timeout, an exception will be raised to
ReplicationContextHandler.exceptionCaught(ReplicationContext, Throwable).
java.lang.Object cancelExpiration(int sequence)
scheduleExpiration(Object). A user of this context could
call this method when the response message has been received to
stop the expiration for the message with the specified
sequence number.
void cancelAllExpirations()
int getScheduledExpirations()
OutOfMemoryError by limiting the number
of the messages which didn't get their responses.
boolean replicate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||