|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.websphere.samples.asynchbeans.wstrader.tickstream.StreamApplicationState
public class StreamApplicationState
This class holds the application state. This state tracks all application wide state and resources. This state has an associated 'root' asynch bean on a WorkManager. This object is stored on that AsynchBean using a property allowing it to be retrieved easily at runtime. We currently use a single TopicConnection for the applications. Any Thread/Works make their own JMSSessions using this TopicConnection.
| Field Summary | |
|---|---|
static java.lang.String |
AS_SSM_PRICEGEN
The name of the Price Generator Subsystem Monitor |
| Method Summary | |
|---|---|
void |
destroy()
Destroy the AsynchScope where our StreamAppliationState is stored. |
void |
destroyed(com.ibm.websphere.asynchbeans.AsynchScope scope)
|
static StreamApplicationState |
getApplicationState(com.ibm.websphere.asynchbeans.WorkManager wm,
boolean create)
This is the method used to get the ApplicationState object. |
com.ibm.websphere.asynchbeans.AsynchScope |
getAsynchScope()
Retrieve the Asynchronous Scope associated with this application state. |
StreamClientState |
getClientState(java.lang.String clientID,
boolean createFlag)
Retrieve a new or existing client state. |
com.ibm.websphere.asynchbeans.SubsystemMonitor |
getPriceGeneratorSSM()
This is exposed to clients can register listeners on it to be notified when the price generator goes down or recovers. |
TickerSubscriber |
getTickerSubscriber(java.lang.String ticker)
We could have given each attach client its own set of dynamically started JMS listeners. |
void |
handlePriceGenPing()
This is called whenever a heart beat message is received from the price generator. |
void |
initialize()
Initialize this object |
void |
listenerCountChanged(com.ibm.websphere.asynchbeans.EventSource es,
int oldCount,
int newCount)
|
void |
listenerExceptionThrown(com.ibm.websphere.asynchbeans.EventSource es,
java.lang.Object listener,
java.lang.String methodName,
java.lang.Throwable exception)
|
void |
removeTickerSubscriber(java.lang.String ticker)
This is called by TickerSubscriber when it notices that there are no more listeners attached to it. |
void |
unexpectedException(com.ibm.websphere.asynchbeans.EventSource es,
java.lang.Object runnable,
java.lang.Throwable exception)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String AS_SSM_PRICEGEN
| Method Detail |
|---|
public com.ibm.websphere.asynchbeans.SubsystemMonitor getPriceGeneratorSSM()
public void initialize()
throws javax.naming.NamingException,
javax.jms.JMSException
javax.naming.NamingException
javax.jms.JMSException
public static StreamApplicationState getApplicationState(com.ibm.websphere.asynchbeans.WorkManager wm,
boolean create)
throws javax.naming.NamingException,
javax.jms.JMSException
javax.naming.NamingException
javax.jms.JMSExceptionpublic void destroy()
public void destroyed(com.ibm.websphere.asynchbeans.AsynchScope scope)
destroyed in interface com.ibm.websphere.asynchbeans.AsynchScopeEventsAsynchScopeEvents.destroyed(AsynchScope)
public void listenerCountChanged(com.ibm.websphere.asynchbeans.EventSource es,
int oldCount,
int newCount)
listenerCountChanged in interface com.ibm.websphere.asynchbeans.EventSourceEventsEventSourceEvents.listenerCountChanged(EventSource, int, int)
public void listenerExceptionThrown(com.ibm.websphere.asynchbeans.EventSource es,
java.lang.Object listener,
java.lang.String methodName,
java.lang.Throwable exception)
listenerExceptionThrown in interface com.ibm.websphere.asynchbeans.EventSourceEventsEventSourceEvents.listenerExceptionThrown(EventSource, Object, String, Throwable)
public void unexpectedException(com.ibm.websphere.asynchbeans.EventSource es,
java.lang.Object runnable,
java.lang.Throwable exception)
unexpectedException in interface com.ibm.websphere.asynchbeans.EventSourceEventsEventSourceEvents.unexpectedException(EventSource, Object, Throwable)
public StreamClientState getClientState(java.lang.String clientID,
boolean createFlag)
clientID - a String representation of a client.createFlag - If true and the client state doesn't exist, don't create one. Return null.
If false, create and return a new StreamClientState object.
public TickerSubscriber getTickerSubscriber(java.lang.String ticker)
throws com.ibm.websphere.asynchbeans.WorkException,
javax.jms.JMSException,
javax.naming.NamingException
Clients then add a listener to the EventSource associated with the listener and will then get an event when a message is received.
ticker - We need a listener for this ticker.
com.ibm.websphere.asynchbeans.WorkException
javax.jms.JMSException
javax.naming.NamingExceptionpublic void removeTickerSubscriber(java.lang.String ticker)
public void handlePriceGenPing()
public com.ibm.websphere.asynchbeans.AsynchScope getAsynchScope()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||