|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.mitosis.service.DefaultReplicationContext
public class DefaultReplicationContext
The default implementation of ReplicationContext
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.directory.mitosis.service.ReplicationContext |
---|
ReplicationContext.State |
Constructor Summary | |
---|---|
DefaultReplicationContext(ReplicationInterceptor interceptor,
DirectoryService directoryService,
ReplicationConfiguration configuration,
org.apache.mina.common.IoSession session)
|
Method Summary | |
---|---|
void |
cancelAllExpirations()
Cancells all scheduled expirations. |
java.lang.Object |
cancelExpiration(int sequence)
Cancels the expiration scheduled by calling ReplicationContext.scheduleExpiration(Object) . |
ReplicationConfiguration |
getConfiguration()
Returns the current ReplicationConfiguration of the
Replica which is managing this context. |
DirectoryService |
getDirectoryService()
Returns the DirectoryService which owns the ReplicationInterceptor
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. |
ReplicationInterceptor |
getService()
Returns the ReplicationInterceptor which is managing this
context. |
org.apache.mina.common.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultReplicationContext(ReplicationInterceptor interceptor, DirectoryService directoryService, ReplicationConfiguration configuration, org.apache.mina.common.IoSession session)
Method Detail |
---|
public ReplicationInterceptor getService()
ReplicationContext
ReplicationInterceptor
which is managing this
context.
getService
in interface ReplicationContext
public ReplicationConfiguration getConfiguration()
ReplicationContext
ReplicationConfiguration
of the
Replica
which is managing this context.
getConfiguration
in interface ReplicationContext
public DirectoryService getDirectoryService()
ReplicationContext
DirectoryService
which owns the ReplicationInterceptor
which is managing this context.
getDirectoryService
in interface ReplicationContext
public org.apache.mina.common.IoSession getSession()
ReplicationContext
IoSession
instance that is associated with the current connection to
the remote Replica
.
getSession
in interface ReplicationContext
public int getNextSequence()
ReplicationContext
getNextSequence
in interface ReplicationContext
public Replica getPeer()
ReplicationContext
Replica
that this context is connected
to.
getPeer
in interface ReplicationContext
public void setPeer(Replica peer)
ReplicationContext
Replica
that this context is connected
to. A user has authenticate the remote peer first and call this method
manually to prevent unauthorized access.
setPeer
in interface ReplicationContext
public ReplicationContext.State getState()
ReplicationContext
Replica
this context is
managing.
getState
in interface ReplicationContext
public void setState(ReplicationContext.State state)
ReplicationContext
Replica
this context is
managing.
setState
in interface ReplicationContext
public void scheduleExpiration(java.lang.Object message)
ReplicationContext
ReplicationContext.cancelExpiration(int)
method is not
invoked within a certain timeout, an exception will be raised to
ReplicationContextHandler.exceptionCaught(ReplicationContext, Throwable)
.
scheduleExpiration
in interface ReplicationContext
public java.lang.Object cancelExpiration(int sequence)
ReplicationContext
ReplicationContext.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.
cancelExpiration
in interface ReplicationContext
public boolean replicate()
ReplicationContext
replicate
in interface ReplicationContext
public void cancelAllExpirations()
ReplicationContext
cancelAllExpirations
in interface ReplicationContext
public int getScheduledExpirations()
ReplicationContext
OutOfMemoryError
by limiting the number
of the messages which didn't get their responses.
getScheduledExpirations
in interface ReplicationContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |