com.continuent.tungsten.replicator.thl
Class ConnectorHandler

java.lang.Object
  extended by com.continuent.tungsten.replicator.thl.ConnectorHandler
All Implemented Interfaces:
ReplicatorPlugin, java.lang.Runnable

public class ConnectorHandler
extends java.lang.Object
implements ReplicatorPlugin, java.lang.Runnable

This class defines a ConnectorHandler

Version:
1.0
Author:
Teemu Ollakka

Constructor Summary
ConnectorHandler()
          Creates a new ConnectorHandler object
 
Method Summary
 void configure(PluginContext context)
          Complete plug-in configuration.
 java.lang.String getRmiHost()
          Gets client's RMI host.
 java.lang.String getRmiPort()
          Gets client's RMI port.
 boolean isFinished()
          Returns true if this handler has terminated and may be discarded.
 void prepare(PluginContext context)
          Prepare plug-in for use.
 void release(PluginContext context)
          Release all resources used by plug-in.
 void run()
          Implements the connector handler loop, which runs until we are interrupted.
 void setRmiHost(java.lang.String rmiHost)
          Sets client's RMI host.
 void setRmiPort(java.lang.String rmiPort)
          Sets client's RMI port.
 void setServer(Server server)
          Sets the server value.
 void setSocket(SocketWrapper socket)
          Sets the server value.
 void setThl(THL thl)
          Sets the thl value.
 void start()
          Start the thread to serve thl changes to requesting slaves.
 void stop()
          Stop the thread which is serving changes to requesting slaves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorHandler

public ConnectorHandler()
Creates a new ConnectorHandler object

Method Detail

isFinished

public boolean isFinished()
Returns true if this handler has terminated and may be discarded.


run

public void run()
Implements the connector handler loop, which runs until we are interrupted.

Specified by:
run in interface java.lang.Runnable

start

public void start()
Start the thread to serve thl changes to requesting slaves.


stop

public void stop()
          throws java.lang.InterruptedException
Stop the thread which is serving changes to requesting slaves.

Throws:
java.lang.InterruptedException

configure

public void configure(PluginContext context)
               throws ReplicatorException,
                      java.lang.InterruptedException
Complete plug-in configuration. This is called after setters are invoked at the time that the replicator goes through configuration.

Specified by:
configure in interface ReplicatorPlugin
Throws:
ReplicatorException - Thrown if configuration is incomplete or fails
java.lang.InterruptedException
See Also:
ReplicatorPlugin.configure(com.continuent.tungsten.replicator.plugin.PluginContext)

prepare

public void prepare(PluginContext context)
             throws ReplicatorException,
                    java.lang.InterruptedException
Prepare plug-in for use. This method is assumed to allocate all required resources. It is called before the plug-in performs any operations.

Specified by:
prepare in interface ReplicatorPlugin
Throws:
ReplicatorException - Thrown if resource allocation fails
java.lang.InterruptedException
See Also:
ReplicatorPlugin.prepare(com.continuent.tungsten.replicator.plugin.PluginContext)

release

public void release(PluginContext context)
             throws ReplicatorException,
                    java.lang.InterruptedException
Release all resources used by plug-in. This is called before the plug-in is deallocated.

Specified by:
release in interface ReplicatorPlugin
Throws:
ReplicatorException - Thrown if resource deallocation fails
java.lang.InterruptedException
See Also:
ReplicatorPlugin.release(com.continuent.tungsten.replicator.plugin.PluginContext)

setSocket

public void setSocket(SocketWrapper socket)
Sets the server value.


setServer

public void setServer(Server server)
Sets the server value.

Parameters:
server - The server to set.

setThl

public void setThl(THL thl)
Sets the thl value.

Parameters:
thl - The thl to set.

setRmiHost

public void setRmiHost(java.lang.String rmiHost)
Sets client's RMI host.


setRmiPort

public void setRmiPort(java.lang.String rmiPort)
Sets client's RMI port.


getRmiHost

public java.lang.String getRmiHost()
Gets client's RMI host.


getRmiPort

public java.lang.String getRmiPort()
Gets client's RMI port.