Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun GlassFish(tm) Message Queue v4.4
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.messaging.jms
Interface Connection

All Superinterfaces:
  Connection

    public interface Connection

extends Connection

This interafce provides the following API for the MQ applications:

1. Provide API to create a MQ NO_ACKNOWLEDGE session.

2. Provide API to set the connection event listener.

3. Provide API to query broker adress and HA state.

Method Summary
`Session` | `createSession(int acknowledgeMode)` Creates a `Session` object.
`String` | `getBrokerAddress()` Get the broker's address that the connection is connected (related) to.
`boolean` | `isConnectedToHABroker()` Get the current connection state.
`void` | `setEventListener(EventListener listener)` Set MQ connection event listener to the current connection.

Methods inherited from interface javax.jms.Connection
`close, createConnectionConsumer, createDurableConnectionConsumer, createSession, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop`

Method Detail

### createSession

    Session createSession(int acknowledgeMode)
                          throws JMSException

  Creates a `Session` object.

  Parameters:
    `acknowledgeMode` - indicates whether the consumer or the client will acknowledge any messages it receives; Legal values are `Session.AUTO_ACKNOWLEDGE`, `Session.CLIENT_ACKNOWLEDGE`, `Session.DUPS_OK_ACKNOWLEDGE`, and `com.sun.messaging.jms.Session.NO_ACKNOWLEDGE`
  Returns:
    a newly created session
  Throws:
    `JMSException` - if the `Connection` object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.
    `JMSException`
  See Also:
    `Session.AUTO_ACKNOWLEDGE`, `Session.CLIENT_ACKNOWLEDGE`, `Session.DUPS_OK_ACKNOWLEDGE`, `Session.NO_ACKNOWLEDGE`

### setEventListener

    void setEventListener(EventListener listener)
                          throws JMSException

  Set MQ connection event listener to the current connection.

  Parameters:
    `listener` - EventListener
  Throws:
    `JMSException`
    `JMSException`

### getBrokerAddress

    String getBrokerAddress()

  Get the broker's address that the connection is connected (related) to.

  Returns:
    the broker's address that the connection is connected (related) to.

### isConnectedToHABroker

    boolean isConnectedToHABroker()

  Get the current connection state.

  Returns:
    true if the connection is connected to a HA broker. false if not connected to a HA broker.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun GlassFish(tm) Message Queue v4.4
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2009 Sun Microsystems, Inc. 4150 Network Circle,
Santa Clara, California, 95054, U.S.A. All Rights Reserved.