TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.execution.util.internal
Class AgentControllerPool

java.lang.Object
  extended by org.eclipse.tptp.platform.execution.util.internal.AgentControllerPool

public class AgentControllerPool
extends java.lang.Object

This delegate is used to keep track of connections with Agent Controller. Only one connection should be established with any one host. Establishing connections is expensive and should only be done once. This is a singleton class.


Field Summary
static int INCREMENTAL_WAIT
          The incremental wait times
protected static AgentControllerPool instance
           
static int TOTAL_WAIT
          The total incremental wait
 
Constructor Summary
protected AgentControllerPool()
          Hide the construtor
 
Method Summary
 org.eclipse.tptp.platform.execution.client.core.IAgentController getConnection(java.lang.String hostName, int portNumber)
           
 org.eclipse.tptp.platform.execution.client.core.IAgentController getConnection(java.lang.String hostName, int portNumber, boolean reuseExistingConnection)
          Return the connection to the hostname and the port number
static AgentControllerPool getInstance()
          Return the instance of this singleton class
 void setACFactory(IAgentControllerFactory acFactory)
           
static void setAgentControllerFactory(IAgentControllerFactory acFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCREMENTAL_WAIT

public static final int INCREMENTAL_WAIT
The incremental wait times

See Also:
Constant Field Values

TOTAL_WAIT

public static final int TOTAL_WAIT
The total incremental wait

See Also:
Constant Field Values

instance

protected static AgentControllerPool instance
Constructor Detail

AgentControllerPool

protected AgentControllerPool()
Hide the construtor

Method Detail

getInstance

public static AgentControllerPool getInstance()
Return the instance of this singleton class

Returns:
The instance of this class

getConnection

public org.eclipse.tptp.platform.execution.client.core.IAgentController getConnection(java.lang.String hostName,
                                                                                      int portNumber)
                                                                               throws java.lang.Exception
Throws:
java.lang.Exception

getConnection

public org.eclipse.tptp.platform.execution.client.core.IAgentController getConnection(java.lang.String hostName,
                                                                                      int portNumber,
                                                                                      boolean reuseExistingConnection)
                                                                               throws java.lang.Exception
Return the connection to the hostname and the port number

Parameters:
hostName - The hostname that Agent Controller is running on
portNumber - The port number that Agent Controller is running on
reuseExistingConnection - Reuses an existing connection if one already exists
Returns:
An Agent Controller connection
Throws:
java.lang.Exception - If any errors occur.

setACFactory

public void setACFactory(IAgentControllerFactory acFactory)

setAgentControllerFactory

public static void setAgentControllerFactory(IAgentControllerFactory acFactory)

TPTP 4.5.0 Platform Project
Internal API Specification