org.apache.directory.mitosis.service.protocol.handler
Interface ReplicationContextHandler

All Known Implementing Classes:
ReplicationClientContextHandler, ReplicationServerContextHandler

public interface ReplicationContextHandler

An interface that provides handler methods for events which occurs when a two replicas communicate with each other. This interface is very similar to MINA IoHandler, but there's a difference in that this interface provide a ReplicationContext instead of an IoHandler. It's usually wrapped by ReplicationProtocolHandler to work with MINA.

Version:
$Rev$, $Date$
Author:
The Apache Directory Project (dev@directory.apache.org)

Method Summary
 void contextBegin(ReplicationContext ctx)
          Invoked when a connection is established between two replicas.
 void contextEnd(ReplicationContext ctx)
          Invoked when a connection is closed between two replicas.
 void contextIdle(ReplicationContext ctx, org.apache.mina.common.IdleStatus status)
          Invoked when two replicas are not exchanging any data for certain amount of time.
 void exceptionCaught(ReplicationContext ctx, java.lang.Throwable cause)
          Invoked when an exception is raised during the communication or executing replication logic.
 void messageReceived(ReplicationContext ctx, java.lang.Object message)
          Invoked when a message is received from a peer replica.
 void messageSent(ReplicationContext ctx, java.lang.Object message)
          Invoked when a message is received from a peer replica.
 

Method Detail

contextBegin

void contextBegin(ReplicationContext ctx)
                  throws java.lang.Exception
Invoked when a connection is established between two replicas.

Throws:
java.lang.Exception

contextEnd

void contextEnd(ReplicationContext ctx)
                throws java.lang.Exception
Invoked when a connection is closed between two replicas.

Throws:
java.lang.Exception

messageReceived

void messageReceived(ReplicationContext ctx,
                     java.lang.Object message)
                     throws java.lang.Exception
Invoked when a message is received from a peer replica.

Throws:
java.lang.Exception

messageSent

void messageSent(ReplicationContext ctx,
                 java.lang.Object message)
                 throws java.lang.Exception
Invoked when a message is received from a peer replica.

Throws:
java.lang.Exception

exceptionCaught

void exceptionCaught(ReplicationContext ctx,
                     java.lang.Throwable cause)
                     throws java.lang.Exception
Invoked when an exception is raised during the communication or executing replication logic.

Throws:
java.lang.Exception

contextIdle

void contextIdle(ReplicationContext ctx,
                 org.apache.mina.common.IdleStatus status)
                 throws java.lang.Exception
Invoked when two replicas are not exchanging any data for certain amount of time.

Throws:
java.lang.Exception


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.