org.marketcetera.client
Class ClientManager

java.lang.Object
  extended by org.marketcetera.client.ClientManager

public final class ClientManager
extends Object

Abstraction that manages the initialization of the Client and provides an easy way to get to its singleton instance.

Since:
1.0.0
Version:
$Id: ClientManager.java 16154 2012-07-14 16:34:05Z colin $
Author:
anshul@marketcetera.com

Method Summary
static Client getInstance()
          Returns the Client instance after it has been initialized via init(ClientParameters)
static void init(ClientParameters inParameter)
          Initializes the connection to the server.
static boolean isInitialized()
          Returns true if the client is initialized, false if it's not.
static void setClientFactory(ClientFactory inFactory)
          Sets the ClientFactory to use to create the Client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(ClientParameters inParameter)
                 throws ConnectionException,
                        ClientInitException
Initializes the connection to the server. The handle to communicate with the server can be obtained via getInstance().

Parameters:
inParameter - The parameters to connect the client. Cannot be null.
Throws:
ConnectionException - if there were errors connecting to the server.
ClientInitException - if the client is already initialized.

setClientFactory

public static void setClientFactory(ClientFactory inFactory)
                             throws ClientInitException
Sets the ClientFactory to use to create the Client.

Parameters:
inFactory - a ClientFactory value
Throws:
ClientInitException - if the client is already initialized.

getInstance

public static Client getInstance()
                          throws ClientInitException
Returns the Client instance after it has been initialized via init(ClientParameters)

Returns:
the client instance to communicate with the server.
Throws:
ClientInitException - if the client is not initialized.

isInitialized

public static boolean isInitialized()
Returns true if the client is initialized, false if it's not.

Returns:
if the client is initialized.


Copyright © 2012. All Rights Reserved.