ActiveMQManagedConnection (ActiveMQ 1.1 API)
Keywords: org.codehaus.activemq.ra.ActiveMQManagedConnection class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.ra
Class ActiveMQManagedConnection

    java.lang.Object
      org.codehaus.activemq.ra.ActiveMQManagedConnection

All Implemented Interfaces:
  ManagedConnection

public class ActiveMQManagedConnection
extends Object
implements ManagedConnection

ActiveMQManagedConnection maps to real physical connection to the server. Since a ManagedConnection has to provide a transaction managment interface to the physical connection, and sessions are the objects implement transaction managment interfaces in the JMS API, this object also maps to a singe physical JMS session.

The side-effect is that JMS connection the application gets will allways create the same session object. This is good if running in an app server since the sessions are elisted in the context transaction. This is bad if used outside of an app server since the user may be trying to create 2 different sessions to coordinate 2 different uow.

Version:
  $Revision: 1.14 $

Constructor Summary
`ActiveMQManagedConnection(Subject subject, ActiveMQResourceAdapter adapter, ActiveMQConnectionRequestInfo info)`

Method Summary
`void` | `addConnectionEventListener(ConnectionEventListener listener)`
`void` | `associateConnection(Object connection)`
`void` | `cleanup()` Cleans up all proxy handles attached to this physical connection so that they cannot be used anymore.
`void` | `destroy()` Close down the physical connection to the server.
`Object` | `getConnection(Subject subject, ConnectionRequestInfo info)`
`LocalTransaction` | `getLocalTransaction()`
`PrintWriter` | `getLogWriter()`
`ManagedConnectionMetaData` | `getMetaData()`
`Connection` | `getPhysicalConnection()`
`Session` | `getPhysicalSession()`
`XAResource` | `getXAResource()`
`boolean` | `matches(Subject subject, ConnectionRequestInfo info)`
`void` | `proxyClosedEvent(JMSConnectionProxy proxy)` When a proxy is closed this cleans up the proxy and notifys the ConnectionEventListeners that a connection closed.
`void` | `removeConnectionEventListener(ConnectionEventListener listener)`
`void` | `setLogWriter(PrintWriter logWriter)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ActiveMQManagedConnection

    public ActiveMQManagedConnection(Subject subject,
                                     ActiveMQResourceAdapter adapter,
                                     ActiveMQConnectionRequestInfo info)
                              throws ResourceException

Method Detail

### getPhysicalConnection

    public Connection getPhysicalConnection()

### getPhysicalSession

    public Session getPhysicalSession()

### getConnection

    public Object getConnection(Subject subject,
                                ConnectionRequestInfo info)
                         throws ResourceException

  Specified by:
    `getConnection` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.getConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)`

### destroy

    public void destroy()
                 throws ResourceException

  Close down the physical connection to the server.

  Specified by:
    `destroy` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.destroy()`

### cleanup

    public void cleanup()
                 throws ResourceException

  Cleans up all proxy handles attached to this physical connection so that they cannot be used anymore.

  Specified by:
    `cleanup` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.cleanup()`

### associateConnection

    public void associateConnection(Object connection)
                             throws ResourceException

  Specified by:
    `associateConnection` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.associateConnection(java.lang.Object)`

### addConnectionEventListener

    public void addConnectionEventListener(ConnectionEventListener listener)

  Specified by:
    `addConnectionEventListener` in interface `ManagedConnection`
  See Also:
    `ManagedConnection.addConnectionEventListener(javax.resource.spi.ConnectionEventListener)`

### removeConnectionEventListener

    public void removeConnectionEventListener(ConnectionEventListener listener)

  Specified by:
    `removeConnectionEventListener` in interface `ManagedConnection`
  See Also:
    `ManagedConnection.removeConnectionEventListener(javax.resource.spi.ConnectionEventListener)`

### getXAResource

    public XAResource getXAResource()
                             throws ResourceException

  Specified by:
    `getXAResource` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.getXAResource()`

### getLocalTransaction

    public LocalTransaction getLocalTransaction()
                                         throws ResourceException

  Specified by:
    `getLocalTransaction` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.getLocalTransaction()`

### getMetaData

    public ManagedConnectionMetaData getMetaData()
                                          throws ResourceException

  Specified by:
    `getMetaData` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.getMetaData()`

### setLogWriter

    public void setLogWriter(PrintWriter logWriter)
                      throws ResourceException

  Specified by:
    `setLogWriter` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.setLogWriter(java.io.PrintWriter)`

### getLogWriter

    public PrintWriter getLogWriter()
                             throws ResourceException

  Specified by:
    `getLogWriter` in interface `ManagedConnection`
  Throws:
    `ResourceException`
  See Also:
    `ManagedConnection.getLogWriter()`

### matches

    public boolean matches(Subject subject,
                           ConnectionRequestInfo info)

  Parameters:
    `subject` -
    `info` -
  Returns:

### proxyClosedEvent

    public void proxyClosedEvent(JMSConnectionProxy proxy)

  When a proxy is closed this cleans up the proxy and notifys the ConnectionEventListeners that a connection closed.

  Parameters:
    `proxy` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.