public abstract class Client extends java.lang.Object implements ShutdownListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTE_RECORD_COUNT |
static java.lang.String |
ATTRIBUTE_SENT_MS
The time that this message was sent.
|
static java.lang.String |
ATTRIBUTE_TRANS_MS
The transaction milliseconds for this message.
|
static java.lang.String |
ATTRIBUTE_TRANS_NR
The transaction for this message.
|
static java.lang.String |
DISABLE_JMS
Environment Variable to turn JMS off.
|
static java.lang.String |
ENV_JMS_MAX_LIVE_MS
Environment variable to control the max transfer time in milliseconds
|
static java.lang.String |
ENV_JMS_PENDING_COUNT
The pending count that we will send out an error
|
static java.lang.String |
ENV_JMS_TIMEOUT
Environment variable to control The maximum time we will wait for a JMS message to be sent.
|
static long |
JMS_TIMEOUT
The maximum time we will wait for a JMS message to be sent.
|
static int |
MAX_INACTIVITY_DURATION
the max inactivity duration
|
static java.lang.String |
PROPERTY_MAX_INACTIVITY_DURATION
the property to control max inactivity duration
|
Constructor and Description |
---|
Client() |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the JMS server
|
protected void |
connectionFailed()
the connection failed
|
int |
getConnectionCount()
How many times have we connected ?
|
JMSConnectionStatsImpl |
getConnectionStats()
The stats
|
abstract java.lang.String |
getContextFactory()
The context factory to use
|
java.lang.String |
getCurrentClientID()
The current the client ID
|
java.util.Date |
getLastConnected()
when did we last connect ?
|
protected MessageListener |
getMessageListener()
The message listener
|
abstract java.lang.String |
getProviderUrl()
get the provider URL to use.
|
long |
getTotalSentCount()
How many messages have been sent ?
|
boolean |
isConnected()
Are we currently connected.
|
boolean |
isEnabled()
Do we have a JMS
|
static void |
logSentMessage(TextMessage message,
long startMS)
log the sent message.
|
void |
onException(javax.jms.JMSException jMSException)
Handle a JMS exception
|
protected void |
postPublish(Message msg)
We have sent a message
|
protected void |
prePublish(Message msg)
About to send a message
|
protected void |
reconnectedJMS()
We have reconnected to the JMS server ( may have lost some messages).
|
protected void |
refreshContext()
reload the context from the database or where ever.
|
void |
send(java.lang.String message)
Send the XML message to the message server.
|
void |
shutdown()
the application is shutting down.
|
void |
shutdownJMS()
shutdown the JMS connections
|
public static final int MAX_INACTIVITY_DURATION
public static final java.lang.String PROPERTY_MAX_INACTIVITY_DURATION
public static final java.lang.String DISABLE_JMS
public static final long JMS_TIMEOUT
public static final java.lang.String ENV_JMS_TIMEOUT
public static final java.lang.String ENV_JMS_MAX_LIVE_MS
public static final java.lang.String ENV_JMS_PENDING_COUNT
public static final java.lang.String ATTRIBUTE_SENT_MS
public static final java.lang.String ATTRIBUTE_RECORD_COUNT
public static final java.lang.String ATTRIBUTE_TRANS_NR
public static final java.lang.String ATTRIBUTE_TRANS_MS
public abstract java.lang.String getContextFactory()
public abstract java.lang.String getProviderUrl()
protected void refreshContext() throws java.lang.Exception
java.lang.Exception
- A serious error.public boolean isEnabled()
public void send(java.lang.String message) throws java.lang.Exception
message
- The message text to send.java.lang.Exception
- A serious messageprotected void reconnectedJMS()
protected void prePublish(Message msg)
msg
- The message we are about to sendprotected void postPublish(Message msg)
msg
- The message that was sent.public void connect() throws java.lang.Exception
java.lang.Exception
- A serious problem.public void onException(javax.jms.JMSException jMSException)
jMSException
- The exceptionpublic JMSConnectionStatsImpl getConnectionStats()
public java.util.Date getLastConnected()
public int getConnectionCount()
public long getTotalSentCount()
public boolean isConnected()
protected MessageListener getMessageListener()
@Nonnull @CheckReturnValue public java.lang.String getCurrentClientID()
protected void connectionFailed()
public final void shutdown()
shutdown
in interface ShutdownListener
public final void shutdownJMS()
public static void logSentMessage(TextMessage message, long startMS)
message
- the messagestartMS
- when did we start sending the message.stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.