public interface TransportConnection
extends javax.jms.Connection
Title: Open Service Framework
Description: Base interface for a reliable Transport Connection. This interface provides an
implementation outline for all transport connections that are created by the
TransportFactory
implementations. There is a strict hirarchy of ownership
that allows the creation of connection factories and subsequently all
connections only thru the management framework interface.
The Transport connection interface is a wrapper around a standard JMS-compliant connection. It provides some additional functionality not found in regular connections and facilitates a reliable communication channel into a given transport. Reliable implies that the connection mechanism has some logic built into it that tracks connection state and critical events, allowing developers to subscribe to such events in order to react to connection state changes when, for example, the back-end messaging system has been shut down or made unavailable. If a network or other communications error has prevented access to the messaging system the connection may (dependent on settings) autmatically timeout, re-connect, abort the connection or block upstream operations from executing until the connection is re-established. Alternativley the connection may be set up to roll over to an alternate URL. While this does not facilitate a Fault Tolerant bahavior at the transaction level, it does provide a level of reliability that is ideal for environments that experience sparse connection outages or require automated failover to Disaster Recovery sites or alternate transport brokers.
JMS Compliance
It is expected any transport supported by the factory interface provide a JMS compliant factory and connection implementation. However non-standards based messaging systems will not support such interfaces. In this case it is expected that the user provide a wrapper set of classes that complete the integration.
Copyright: Copyright (c) 2008
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the message transport.
|
void |
disconnect()
Disconnects from the message transport.
|
void |
forceStateCheck()
Forces connection to check it's current state, e.g.
|
ExceptionEventListener |
getExceptionEventListener()
Returns the exception advisory listener for this connection.
|
java.lang.String |
getName()
Returns the name of this connection.
|
Logger |
getServiceLogger()
Returns the logger for this connection.
|
ConnectionState |
getState()
Returns the state of this connection.
|
StateNotificationEventListener |
getStateNotificationEventListener()
Returns the state notification advisory listener for this connection.
|
boolean |
isActive()
Returns
true is the current connection is active and connected. |
boolean |
isPrimary()
Check if this connection is a primary in a connection group.
|
void |
raiseException(TransportException e)
Raises a user-defined exception for this connection.
|
void |
resume()
Resume a connection.
|
void |
setExceptionEventListener(ExceptionEventListener listener)
Sets the exception (advisory) event listener for this connection.
|
void |
setPrimary(boolean primary)
Sets the connection in a group to be the primary.
|
void |
setServiceLogger(Logger logger)
Sets the logger for this connection's critical log events.
|
void |
setStateNotificationEventListener(StateNotificationEventListener listener)
Sets the state notification (advisory) event listener for this connection.
|
void |
suspend()
Suspends a connection.
|
java.lang.String getName()
Transport Factory
are unique.void connect() throws TransportException
getState()
to determine when a connection is in
ConnectionState.CONNECTED
state before proceeding.TransportException
void disconnect() throws TransportException
TransportException
void suspend()
void resume()
void forceStateCheck()
boolean isPrimary()
void setPrimary(boolean primary)
primary
- booleanboolean isActive()
true
is the current connection is active and connected.void setServiceLogger(Logger logger)
logger
- ILoggerLogger getServiceLogger()
null
if one is not set.void setStateNotificationEventListener(StateNotificationEventListener listener)
ConnectionStateChangeAdvisory
event every time a connection state change occurs.listener
- IStateNotificationEventListenerStateNotificationEventListener getStateNotificationEventListener()
null
if a listener is not set.void setExceptionEventListener(ExceptionEventListener listener)
TransportException
event in case of
an exception.listener
- IExceptionEventListenerExceptionEventListener getExceptionEventListener()
null
if a listener is not set.ConnectionState getState()
void raiseException(TransportException e)
e
- TransportExceptionCopyright © 2015-2024 StreamScape Technologies. All rights reserved.