org.apache.camel.component.sjms.jms
Interface ConnectionResource

All Known Implementing Classes:
ConnectionFactoryResource

public interface ConnectionResource

The ConnectionResource is the contract used to provide Connection pools to the SJMS component. A user should use this to provide access to an alternative pooled connection resource such as a Connection pool that is managed by a J2EE container.

It is recommended though that for standard ConnectionFactory providers you use the {@link ConnectionFactoryResource) implementation that is provided with SJMS as it is optimized for this component.


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.
 void returnConnection(javax.jms.Connection connection)
          Returns the Connection to the connection pool.
 

Method Detail

borrowConnection

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

Returns:
Connection
Throws:
Exception - when no resource is available

borrowConnection

javax.jms.Connection borrowConnection(long timeout)
                                      throws Exception
Borrows a Connection from the connection pool.

Parameters:
timeout - the amount of time to wait before throwing an Exception
Returns:
Connection
Throws:
Exception - when no resource is available

returnConnection

void returnConnection(javax.jms.Connection connection)
                      throws Exception
Returns the Connection to the connection pool.

Parameters:
connection - the borrowed Connection
Throws:
Exception


Apache Camel