|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Connection
This interface is used to define the basic methods required of a message connection.
A Sender and Receiver interface object extends the Connection interface.
A connection contains methods to specify error callbacks, close a connection
and set and get message attribute defaults.
Connection specific message attribute defaults
can be added and retrieved from the connection object.
They are identified by the message type
which is just an arbirary string identifier.
During a send operation, if the type of a message matches
the type of a set of defaults,
then the associated attributes are used for that message.
During a send message operation, defaults DO NOT override
message specific attributes.
During a receive message operation, the best matched attribute set
with those of the received message defines the type.
Sender
,
Receiver
Field Summary | |
---|---|
static int |
CONNECTED
The link is connected (and not reconnecting). |
static int |
NOT_CONNECTED
The link is not connected (and not reconnecting). |
static int |
NOT_USED
|
static int |
RECONNECTING
The link was connected and is now in the process of reconnecting. |
Method Summary | |
---|---|
void |
close()
Close the connection. |
void |
connect()
Connect with the service. |
boolean |
connected()
Deprecated. Use getConnectionStatus instead |
int |
getConnectionStatus()
Query the status of the link. |
Attributes |
getTypeDefaults(java.lang.String type)
Get connection specific message attribute defaults as identified by the type. |
void |
init(java.util.Properties properties)
Initialise the object with settings specified in the properties. |
void |
init(java.util.Properties properties,
java.lang.String prefix)
Initialise the object with settings specified in the properties where the relevant property names have been prefixed with the specified prefix. |
void |
putTypeDefaults(java.lang.String type,
Attributes props)
Set connection specific message attribute defaults as identified by the type. |
void |
setErrorListener(ErrorListener listener)
Specify a callback called if an connection error occurs in the underlying connection. |
void |
shutdown()
Shutdown the connection. |
Field Detail |
---|
static final int NOT_USED
static final int NOT_CONNECTED
getConnectionStatus()
,
Constant Field Valuesstatic final int CONNECTED
getConnectionStatus()
,
Constant Field Valuesstatic final int RECONNECTING
getConnectionStatus()
,
Constant Field ValuesMethod Detail |
---|
Attributes getTypeDefaults(java.lang.String type)
putTypeDefaults(java.lang.String, ie.ncl.msg.Attributes)
,
Message.getType()
,
Attributes
void putTypeDefaults(java.lang.String type, Attributes props)
getTypeDefaults(java.lang.String)
,
Message.getType()
,
Attributes
void close()
void setErrorListener(ErrorListener listener)
ErrorListener
,
TemporaryConnectionException
,
connected()
void init(java.util.Properties properties) throws ConnectionException
ConnectionException
void init(java.util.Properties properties, java.lang.String prefix) throws ConnectionException
ConnectionException
void connect() throws ConnectionException
ConnectionException
boolean connected()
setErrorListener(ie.ncl.msg.ErrorListener)
,
TemporaryConnectionException
int getConnectionStatus()
CONNECTED
,
NOT_CONNECTED
,
RECONNECTING
,
setErrorListener(ie.ncl.msg.ErrorListener)
,
TemporaryConnectionException
void shutdown()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |