org.wso2.carbon.databridge.agent.endpoint.binary
Class BinaryClientPoolFactory

java.lang.Object
  extended by org.apache.commons.pool.BaseKeyedPoolableObjectFactory
      extended by org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory
          extended by org.wso2.carbon.databridge.agent.endpoint.binary.BinaryClientPoolFactory
All Implemented Interfaces:
org.apache.commons.pool.KeyedPoolableObjectFactory

public class BinaryClientPoolFactory
extends AbstractClientPoolFactory

This class implements AbstractClientPoolFactory to handle the Binary transport related connections.


Constructor Summary
BinaryClientPoolFactory()
           
 
Method Summary
 Object createClient(String protocol, String hostName, int port)
          Make a connection to the receiver and return the client.
 void terminateClient(Object client)
          Terminates the connection between the client and the endpoint.
 boolean validateClient(Object client)
          Check the validity of the client whether it's in the position to make the communication with endpoint.
 
Methods inherited from class org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory
destroyObject, makeObject, validateObject
 
Methods inherited from class org.apache.commons.pool.BaseKeyedPoolableObjectFactory
activateObject, passivateObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryClientPoolFactory

public BinaryClientPoolFactory()
Method Detail

createClient

public Object createClient(String protocol,
                           String hostName,
                           int port)
                    throws DataEndpointException
Description copied from class: AbstractClientPoolFactory
Make a connection to the receiver and return the client.

Specified by:
createClient in class AbstractClientPoolFactory
Parameters:
protocol - protocol that is used to connect to the endpoint
hostName - hostname of the endpoint
port - port of the endpoint that is listening to
Returns:
A valid client which has connected to the receiver and can be used for rest of the operations regarding the endpoint.
Throws:
DataEndpointException

validateClient

public boolean validateClient(Object client)
Description copied from class: AbstractClientPoolFactory
Check the validity of the client whether it's in the position to make the communication with endpoint.

Specified by:
validateClient in class AbstractClientPoolFactory
Parameters:
client - Client object which needs to be validated.
Returns:
Returns true/false based on the client is valid or invalid.

terminateClient

public void terminateClient(Object client)
Description copied from class: AbstractClientPoolFactory
Terminates the connection between the client and the endpoint.

Specified by:
terminateClient in class AbstractClientPoolFactory
Parameters:
client - The client which needs to be terminated.


Copyright © 2015 WSO2. All rights reserved.