Class AbstractLinkInitializer

  extended by
All Implemented Interfaces:
Direct Known Subclasses:

public abstract class AbstractLinkInitializer
extends Object
implements LinkInitializer

Abstract implementation of LinkInitializer. This implements the initialize( isServer, String[] ) method and then calls the initialize( InetAddress[] ) method.

Constructor Summary
Method Summary
 List<LinkProvider> initialize(boolean thisEndIsServer, String remoteDataCenterName, int port, String[] remoteAddressStrings)
          Given an array of addressStrings, create a Link for each string, and return the array of Links.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface

Constructor Detail


public AbstractLinkInitializer()
Method Detail


public List<LinkProvider> initialize(boolean thisEndIsServer,
                                     String remoteDataCenterName,
                                     int port,
                                     String[] remoteAddressStrings)
Description copied from interface: LinkInitializer
Given an array of addressStrings, create a Link for each string, and return the array of Links.

The Links returned must implement the chosen protocol for the LinkProvider.

Normally, user implementations of LinkInitializer can extend {link AbstractLinkInitializer} and use its implementation of this method, leaving only the InetSocketAddress version of this initialize() to be implemented.

Specified by:
initialize in interface LinkInitializer
thisEndIsServer - tells the mode for this connection. thisEndIsServer means, set up a server connection on this link. Otherwise, set up a client connection.
remoteDataCenterName - the name of the remote data center, which appears in the config property after "". For example, "ct.replicator.inbound.East=..." turns into remoteDataCenterName="East".
port - The port number to listen on (for server connections) or to connect to (for client connections).
remoteAddressStrings - the list of IP (w.x.y.z) or hostname ( addresses from the config string for the link, broken apart by commas (',') and trimmed (leading and trailing whitespace removed).
This method should return if the links can be configured; otherwise, it should not proceed - it should exit the main process.