org.apache.camel.component.sjms.jms
Class ConnectionFactoryResource

java.lang.Object
  extended by org.apache.camel.component.sjms.jms.ObjectPool<javax.jms.Connection>
      extended by org.apache.camel.component.sjms.jms.ConnectionFactoryResource
All Implemented Interfaces:
ConnectionResource

public class ConnectionFactoryResource
extends ObjectPool<javax.jms.Connection>
implements ConnectionResource

The default ConnectionResource implementation for the SJMSComponent.


Field Summary
 
Fields inherited from class org.apache.camel.component.sjms.jms.ObjectPool
logger
 
Constructor Summary
ConnectionFactoryResource()
          Default Constructor
ConnectionFactoryResource(int poolSize, javax.jms.ConnectionFactory connectionFactory)
          TODO Add Constructor Javadoc
ConnectionFactoryResource(int poolSize, javax.jms.ConnectionFactory connectionFactory, String username, String password)
           
ConnectionFactoryResource(int poolSize, javax.jms.ConnectionFactory connectionFactory, String username, String password, String connectionId)
           
 
Method Summary
 javax.jms.Connection borrowConnection()
          Borrows a Connection from the connection pool.
 javax.jms.Connection borrowConnection(long timeout)
          Borrows a Connection from the connection pool.
protected  javax.jms.Connection createObject()
          Implement to create new objects of type T when the pool is initialized empty.
protected  void destroyObject(javax.jms.Connection connection)
          Clean up pool objects
 String getClientId()
           
 javax.jms.ConnectionFactory getConnectionFactory()
           
 String getPassword()
           
 String getUsername()
           
 void returnConnection(javax.jms.Connection connection)
          Returns the Connection to the connection pool.
 void setClientId(String clientId)
           
 void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
           
 void setPassword(String password)
           
 void setUsername(String username)
           
 
Methods inherited from class org.apache.camel.component.sjms.jms.ObjectPool
borrowObject, borrowObject, drainPool, fillPool, getLock, getMaxSize, returnObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactoryResource

public ConnectionFactoryResource()
Default Constructor


ConnectionFactoryResource

public ConnectionFactoryResource(int poolSize,
                                 javax.jms.ConnectionFactory connectionFactory)
TODO Add Constructor Javadoc

Parameters:
poolSize -
connectionFactory -

ConnectionFactoryResource

public ConnectionFactoryResource(int poolSize,
                                 javax.jms.ConnectionFactory connectionFactory,
                                 String username,
                                 String password)
Parameters:
poolSize -
connectionFactory -
username -
password -

ConnectionFactoryResource

public ConnectionFactoryResource(int poolSize,
                                 javax.jms.ConnectionFactory connectionFactory,
                                 String username,
                                 String password,
                                 String connectionId)
Parameters:
poolSize -
connectionFactory -
username -
password -
Method Detail

borrowConnection

public javax.jms.Connection borrowConnection()
                                      throws Exception
Description copied from interface: ConnectionResource
Borrows a Connection from the connection pool. An exception should be thrown if no resource is available.

Specified by:
borrowConnection in interface ConnectionResource
Returns:
Connection
Throws:
Exception - when no resource is available

borrowConnection

public javax.jms.Connection borrowConnection(long timeout)
                                      throws Exception
Description copied from interface: ConnectionResource
Borrows a Connection from the connection pool.

Specified by:
borrowConnection in interface ConnectionResource
Parameters:
timeout - the amount of time to wait before throwing an Exception
Returns:
Connection
Throws:
Exception - when no resource is available

returnConnection

public void returnConnection(javax.jms.Connection connection)
                      throws Exception
Description copied from interface: ConnectionResource
Returns the Connection to the connection pool.

Specified by:
returnConnection in interface ConnectionResource
Parameters:
connection - the borrowed Connection
Throws:
Exception

createObject

protected javax.jms.Connection createObject()
                                     throws Exception
Description copied from class: ObjectPool
Implement to create new objects of type T when the pool is initialized empty.

Specified by:
createObject in class ObjectPool<javax.jms.Connection>
Returns:
Throws:
Exception

destroyObject

protected void destroyObject(javax.jms.Connection connection)
                      throws Exception
Description copied from class: ObjectPool
Clean up pool objects

Specified by:
destroyObject in class ObjectPool<javax.jms.Connection>
Throws:
Exception

getConnectionFactory

public javax.jms.ConnectionFactory getConnectionFactory()

setConnectionFactory

public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)

getUsername

public String getUsername()

setUsername

public void setUsername(String username)

getPassword

public String getPassword()

setPassword

public void setPassword(String password)

getClientId

public String getClientId()

setClientId

public void setClientId(String clientId)


Apache Camel