|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.messaging.MsgService
General class used to support JMS communications The methods subscribeEvent, unsubscribeEvent and emitEvent along with the com.infoengine.webject.wes.* webjects supply support for the Web Event Service (WES). The WES is I*E's interface to JMS' Publish/Subscribe mechanism. The methods subscribeQueue, unsubscribeQueue, queueTask and queryResults along with the com.infoengine.webject.msg.* webjects supply support for the foundation of messaging queue support and guaranteed task execution.
Nested Class Summary | |
(package private) class |
MsgService.IEJMSRecoveryThread
this thread will re-initialize queue and topic support and recover any subscriptions that were lost as a result of the MOM going away |
(package private) static interface |
MsgService.MOMConnectionPool
describes a connection pool |
(package private) class |
MsgService.MOMHash
simple collection of objects similar to a hashtable in that there's only one element per key allowed. |
(package private) class |
MsgService.MOMHashMember
an element in a MOMHash |
(package private) class |
MsgService.MOMKey
object that uniquely identifies an element in a MOMHash |
(package private) class |
MsgService.MOMSharedConnection
a member in a MOMSharedPool |
(package private) class |
MsgService.MOMSharedPool
A simple connection pool used to organize and maintain connections to a MOM. |
Field Summary | |
private ObjectCache |
administeredObjectCache
|
(package private) static String |
CLASS
|
private long |
correlationSequence
|
private String |
defaultQueuePass
|
private String |
defaultQueueUser
|
private String |
defaultTopicPass
|
private String |
defaultTopicUser
|
private MsgService.MOMHash |
events
|
(package private) static String |
IE_RESULT_TTL
|
(package private) static String |
PARAM_ATTRIBUTE
|
(package private) static String |
PARAM_BLOBCOUNT
|
(package private) static String |
PARAM_CORR_ID
|
(package private) static String |
PARAM_DELETE
|
(package private) static String |
PARAM_DEST
|
(package private) static String |
PARAM_END_DURABLE_SUBSCRIPTION
|
(package private) static String |
PARAM_EVENT
|
(package private) static String |
PARAM_EXECUTETASK
|
(package private) static String |
PARAM_FAILURETASK
|
(package private) static String |
PARAM_GROUPIN
|
(package private) static String |
PARAM_GROUPOUT
|
(package private) static String |
PARAM_PASS
|
(package private) static String |
PARAM_PRIORITY
|
(package private) static String |
PARAM_PROPERTY
|
(package private) static String |
PARAM_QUEUE
|
(package private) static String |
PARAM_RESULT_TTL
|
(package private) static String |
PARAM_TASK
|
(package private) static String |
PARAM_TASK_TTL
|
(package private) static String |
PARAM_TTLIVE
|
(package private) static String |
PARAM_TYPE
|
(package private) static String |
PARAM_UNIQUE_CORR_ID
|
(package private) static String |
PARAM_USER
|
(package private) static String |
PARAM_WAITTIME
|
(package private) static String |
PARAM_WHERE
|
private MsgService.MOMConnectionPool |
queueConnectionPool
|
private Context |
queueCtx
|
private javax.jms.QueueConnectionFactory |
queueFactory
|
private MsgService.MOMHash |
queues
|
(package private) static String |
queueServiceName
|
private boolean |
queueSupport
|
private MsgService.IEJMSRecoveryThread |
recovery
|
(package private) static String |
RESOURCE
|
private MsgService.MOMConnectionPool |
topicConnectionPool
|
private javax.jms.TopicConnectionFactory |
topicFactory
|
private boolean |
topicSupport
|
private Context |
wesCtx
|
(package private) static String |
wesServiceName
|
Constructor Summary | |
private |
MsgService()
create a new instance of the MsgService pretend we're in a perfect world and let all exceptions fly to be handled by the creator. |
Method Summary | |
Group |
browseQueue(Task t)
Browse a queue for contents |
private IeRequest |
buildRequest(Task t,
Webject w)
|
private void |
closeEventListener(EventListener listener)
close an event listener but don't end its subscription. |
private void |
closeEventListener(EventListener listener,
boolean endDurableSubscription)
close an event listener |
private void |
closeQueueListener(QueueListener listener)
close a queue listener |
Group |
createObject(Task t)
<ie:webject name="Create-Object" type="MSG"> <ie:param name="QUEUE" data=" |
Task |
deleteObject(Task t)
<ie:webject name="Delete-Object" type="MSG"> <ie:param name="QUEUE" data=" |
Group |
emitEvent(Task t)
send a named event |
private EventListener |
findEventListener(String euri)
search for a named event listener |
private MsgListener |
findListener(String name,
String where,
MsgService.MOMHash hash)
find a MsgListener object in a list |
private QueueListener |
findQueueListener(String quri,
String where)
search for a named queue listener |
private javax.jms.ConnectionFactory |
getConnectionFactory(String serviceName,
String property,
Context ctx)
retrieve a ConnectionFactory object from an LDAP context for serviceName |
private EventListener |
getEventListener(String euri,
String user,
String pass,
boolean create)
lookup an event listener in the events hash. |
private EventListener |
getEventListener(String euri,
String user,
String pass,
boolean create,
boolean subscribe)
lookup an event listener in the events hash if create is true and a listener is not found then create a new listener |
private Context |
getInitialContext(String serviceName)
based on ie.properties retrieve an initial context for serviceName |
private String |
getLocalizedMessage(String key,
Object[] inserts)
get a localized String from the resource bundle used to put localized status messages |
static MsgService |
getMsgService(boolean topicSupport,
boolean queueSupport)
get the MsgService instance |
(package private) javax.jms.QueueConnection |
getQueueConnection(String user,
String pass)
retrieve a queue connection from the connection pool sending a user name and password of null will return an anonymous connection. |
private QueueListener |
getQueueListener(String quri,
String user,
String pass,
String where)
lookup an event listener in the events hash if create is true and a listener is not found then create a new listener |
private QueueListener |
getQueueListener(String quri,
String user,
String pass,
String where,
boolean create)
lookup an event listener in the events hash if create is true and a listener is not found then create a new listener |
private QueueListener |
getQueueListener(String quri,
String user,
String pass,
String where,
boolean create,
boolean createNew)
lookup an queue listener in the listener's hash if create is true and a listener is not found then create a new listener |
private void |
initializeQueueSupport()
- initialize LDAP context for Queue related Administered objects - retrieve the QueueConnectionFactory from LDAP - create a QueueConnection to JMS - start the connection - set queue support to true |
private void |
initializeTopicSupport()
- initialize LDAP context for Topic related Administered objects - retrieve the TopicConnectionFactory from LDAP - create a TopicConnection to JMS - start the connection - set topic support to true |
private Object |
lookupAdminObject(Context ctx,
String uri)
Lookup an administered object by name |
private javax.jms.ConnectionFactory |
lookupConnectionFactory(Context ctx,
String uri)
Lookup ConnectionFactory administered object by name |
(package private) javax.jms.Queue |
lookupQueue(String uri)
Lookup Queue administered object by name |
private javax.jms.Topic |
lookupTopic(String uri)
Lookup Topic administered object by name |
private Webject |
mapCredentials(Task t,
String instance)
|
private Webject |
mapMsgCredentials(Task t)
|
private Webject |
mapWesCredentials(Task t)
|
private EventListener |
newEventListener(javax.jms.Topic topic,
String euri,
String user,
String pass,
boolean subscribe)
create a new EventListener |
private QueueListener |
newQueueListener(javax.jms.Queue queue,
String quri,
String user,
String pass,
String where)
create a new QueueListener |
private String |
normalizeUri(String uri)
prepend 'cn=' to uri if appropriate it's assumed that it's ok for uri to be fully qualified, or relative. |
void |
onException(javax.jms.JMSException jmse)
start a recovery thread when serious connection related problems occur |
Task |
queryObject(Task t)
<ie:webject name="Query-Object" type="MSG"> <ie:param name="QUEUE" data=" |
private Task |
queryObject(Task t,
boolean remove)
method supporting query and delete object webjects |
Task |
queryResults(Task t,
boolean remove)
Query for the results of a queued task |
Group |
queueTask(Task t)
Queue a named task |
(package private) void |
releaseQueueConnection(String user,
String pass)
release a queue connection no longer in use |
private void |
startRecovery()
begin a recovery thread when the MOM goes away |
Group |
subscribeEvent(Task t)
subscribe to listen for a named event |
Group |
subscribeQueue(Task t)
subscribe to a queue for tasks to execute |
Group |
unsubscribeEvent(Webject w)
unsubscribe from a named event |
Group |
unsubscribeQueue(Task t)
unsubscribe from a named queue |
private void |
updateHash(MsgService.MOMKey key,
MsgListener listener,
MsgService.MOMHash hash,
boolean put)
add or remove an item from a Hashtable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ObjectCache administeredObjectCache
static final String wesServiceName
private MsgService.MOMHash events
private javax.jms.TopicConnectionFactory topicFactory
private Context wesCtx
private boolean topicSupport
private MsgService.MOMConnectionPool topicConnectionPool
private String defaultTopicUser
private String defaultTopicPass
static final String queueServiceName
private MsgService.MOMHash queues
private javax.jms.QueueConnectionFactory queueFactory
private Context queueCtx
private boolean queueSupport
private MsgService.MOMConnectionPool queueConnectionPool
private String defaultQueueUser
private String defaultQueuePass
private long correlationSequence
static final String RESOURCE
static final String CLASS
static final String IE_RESULT_TTL
static final String PARAM_EVENT
static final String PARAM_EXECUTETASK
static final String PARAM_FAILURETASK
static final String PARAM_TTLIVE
static final String PARAM_GROUPIN
static final String PARAM_GROUPOUT
static final String PARAM_PRIORITY
static final String PARAM_PROPERTY
static final String PARAM_TYPE
static final String PARAM_QUEUE
static final String PARAM_TASK
static final String PARAM_DEST
static final String PARAM_WHERE
static final String PARAM_WAITTIME
static final String PARAM_CORR_ID
static final String PARAM_TASK_TTL
static final String PARAM_RESULT_TTL
static final String PARAM_DELETE
static final String PARAM_BLOBCOUNT
static final String PARAM_ATTRIBUTE
static final String PARAM_USER
static final String PARAM_PASS
static final String PARAM_UNIQUE_CORR_ID
static final String PARAM_END_DURABLE_SUBSCRIPTION
private MsgService.IEJMSRecoveryThread recovery
Constructor Detail |
private MsgService() throws Exception
Exception
- this creator does not catch any JNDI, JMS or other ExceptionsMethod Detail |
public static MsgService getMsgService(boolean topicSupport, boolean queueSupport) throws Exception
Exception
- this method does not catch any JNDI, JMS or other Exceptionsprivate void initializeTopicSupport() throws Exception
Exception
- this method does not catch any JNDI, JMS or other Exceptionsprivate void initializeQueueSupport() throws Exception
Exception
- this method does not catch any JNDI, JMS or other Exceptionsprivate Context getInitialContext(String serviceName) throws Exception
Exception
- this method does not catch any JNDI or other Exceptionsprivate javax.jms.ConnectionFactory getConnectionFactory(String serviceName, String property, Context ctx) throws Exception
Exception
- no JMS related or other exceptions are caught by this method
Exception
private String normalizeUri(String uri)
private void updateHash(MsgService.MOMKey key, MsgListener listener, MsgService.MOMHash hash, boolean put)
private String getLocalizedMessage(String key, Object[] inserts)
private Webject mapCredentials(Task t, String instance)
private Webject mapWesCredentials(Task t)
private Webject mapMsgCredentials(Task t)
public Group emitEvent(Task t) throws IEException
IEException
public Group subscribeEvent(Task t) throws IEException
IEException
public Group unsubscribeEvent(Webject w) throws IEException
IEException
private EventListener newEventListener(javax.jms.Topic topic, String euri, String user, String pass, boolean subscribe) throws IEException
topic
- - the topic for the listeneruser
- - the user name used to connect to the MOMpass
- - the password used to connect to the MOMsubscribe
- - whether or not to create a durable subscription to this topic
IEException
private MsgListener findListener(String name, String where, MsgService.MOMHash hash)
name
- - the name associated with the listener objectwhere
- - the where clause associated with the listener objecthash
- - the list to searchprivate EventListener findEventListener(String euri) throws IEException
euri
- - the uri of the event's administered object
IEException
private QueueListener findQueueListener(String quri, String where) throws IEException
quri
- - the uri of the queue's administered objectwhere
- - the where clause associated with the queue listener
IEException
private EventListener getEventListener(String euri, String user, String pass, boolean create) throws IEException
IEException
- if error occurs creating new listenerprivate EventListener getEventListener(String euri, String user, String pass, boolean create, boolean subscribe) throws IEException
IEException
- if error occurs creating new listenerprivate void closeEventListener(EventListener listener) throws IEException
IEException
- if error closing listenerprivate void closeEventListener(EventListener listener, boolean endDurableSubscription) throws IEException
IEException
- if error closing listenerprivate void closeQueueListener(QueueListener listener) throws IEException
IEException
- if error closing listenerprivate Object lookupAdminObject(Context ctx, String uri) throws IEException
IEException
javax.jms.Queue lookupQueue(String uri) throws IEException
IEException
private javax.jms.Topic lookupTopic(String uri) throws IEException
IEException
private javax.jms.ConnectionFactory lookupConnectionFactory(Context ctx, String uri) throws IEException
IEException
private QueueListener getQueueListener(String quri, String user, String pass, String where, boolean create, boolean createNew) throws IEException
IEException
- if error occurs creating new listenerjavax.jms.QueueConnection getQueueConnection(String user, String pass) throws Exception
Exception
- if an error occurs creating the connectionvoid releaseQueueConnection(String user, String pass)
private QueueListener newQueueListener(javax.jms.Queue queue, String quri, String user, String pass, String where) throws IEException
queue
- - the queue to associate the listener withuser
- - the user name used to connect to the MOMpass
- - the password used to connect to the MOMwhere
- - the where clause to associate with the listener
IEException
private QueueListener getQueueListener(String quri, String user, String pass, String where) throws IEException
IEException
- if error occurs creating new listenerprivate QueueListener getQueueListener(String quri, String user, String pass, String where, boolean create) throws IEException
IEException
- if error occurs creating new listenerpublic Group queueTask(Task t) throws IEException
IEException
public Task queryResults(Task t, boolean remove) throws IEException
IEException
public Group subscribeQueue(Task t) throws IEException
IEException
public Group browseQueue(Task t) throws IEException
IEException
public Group unsubscribeQueue(Task t) throws IEException
IEException
private IeRequest buildRequest(Task t, Webject w)
public Group createObject(Task t) throws IEException
public Task deleteObject(Task t) throws IEException
IEException
public Task queryObject(Task t) throws IEException
IEException
private Task queryObject(Task t, boolean remove) throws IEException
IEException
private void startRecovery()
public void onException(javax.jms.JMSException jmse)
onException
in interface javax.jms.ExceptionListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |