Package com.uc4.communication
Class AEConnectionPool
- java.lang.Object
-
- com.uc4.communication.AEConnectionPool
-
public class AEConnectionPool extends java.lang.Object
Maintains a pool of connections. The users of this class don't have to create and close the connection. Connections to the Automation Engine are created on demand and closed based on a timeout.
-
-
Constructor Summary
Constructors Constructor Description AEConnectionPool(int maxLifetime)
Creates a newConnectionMananger
instance with a maximum lifetime of connections.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sendRequestAndWait(ConnectProperties connectInfo, XMLRequest req)
Sends a request to the Automation Engine.void
sendRequestAndWait(ConnectProperties connectInfo, XMLRequest req, java.util.Properties options)
Sends a request to the Automation Engine.void
shutdown()
Closes all open connections.int
size()
-
-
-
Method Detail
-
shutdown
public void shutdown()
Closes all open connections.
-
size
public int size()
- Returns:
- The number of open connections.
-
sendRequestAndWait
public void sendRequestAndWait(ConnectProperties connectInfo, XMLRequest req) throws java.io.IOException
Sends a request to the Automation Engine. This method may use an existing connection from the pool or create a new one.- Parameters:
connectInfo
- Connect informationreq
- Request- Throws:
java.io.IOException
- If there are I/O errors or the login fails
-
sendRequestAndWait
public void sendRequestAndWait(ConnectProperties connectInfo, XMLRequest req, java.util.Properties options) throws java.io.IOException
Sends a request to the Automation Engine. This method may use an existing connection from the pool or create a new one.- Parameters:
connectInfo
- Connect informationreq
- Requestoptions
- This properties are only used when a new Connection is created. These are the same properties as in the methodConnection.open(String servername, int port, Properties options)
Supported parameters:Key Description DIRECT If set to the String "YES" the load balancing will be disabled AGENTNAME Name of the Agent if the connection is created within an UC4 Agent process HOSTNAME Name of the user's host. This value will be shown in the system overview REMOTE_ID Remote ID. This value will be shown in the system overview SECRET_TYPE Optional: Type of the secret in the login method. Values: "ET" (Exit-Token), "TK" (AE-Token) and "PW" (Password) - Throws:
java.io.IOException
- If there are I/O errors or the login fails
-
-