|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.ibm.websphere.samples.asynchbeans.wstrader.applet.URLSenderHandler
public class URLSenderHandler
Sends information to our various Ticker Streamer servlets by queuing all requests to run on a single thread. We use a singleton, so all applets running in the same JVM are using a single HTTP connection.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener listener)
Add a listener for Notifications that will be recieved asynchronously. |
void |
cancel()
Cancel this monitor. |
static URLSenderHandler |
create(java.net.URL codeBase)
Initialize the singleton URLSenderHandler. |
boolean |
doLogout(java.lang.String cookie)
Logout from the WebSphere Trader application by way of the logout servlet. |
boolean |
doUpdate(java.lang.String streamerName,
java.lang.String cookie,
java.lang.String symbols)
Update the current client's ticker symbols on the WebSphere Trader application by way of the update servlet. |
boolean |
getCancelled()
Find out if the thread has been requested to end. |
static URLSenderHandler |
getSelf()
Return a singleton instance of the URLSenderHandler. |
void |
removeNotificationListener(NotificationListener listener)
Remove a listener from the Notification list. |
void |
run()
Execute the URLSender loop. |
static void |
sendLoginMessage(java.lang.String clientid,
java.lang.String symbols)
Send a Client Login message to the TickerStreamer server app. |
static void |
sendLogoutMessage(java.lang.String cookie)
Send a Client Logout message to the TickerStreamer server app. |
static void |
sendPingMessage(java.lang.String cookie)
Send a Ping message to the TickerStreamer server app. |
static void |
sendUpdateMessage(java.lang.String streamerName,
java.lang.String cookie,
java.lang.String symbols)
Send a Change Tickers message to the TickerStreamer server app. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static URLSenderHandler getSelf()
public static URLSenderHandler create(java.net.URL codeBase)
codeBase
- the calling applet's codeBase.public static void sendPingMessage(java.lang.String cookie)
cookie
- the Cookie receieved from the login.public static void sendLoginMessage(java.lang.String clientid, java.lang.String symbols)
clientid
- the client id to login assymbols
- the Ticker Symbols to use if this client is not already
logged-in.public static void sendLogoutMessage(java.lang.String cookie)
cookie
- the Cookie receieved from the login.public static void sendUpdateMessage(java.lang.String streamerName, java.lang.String cookie, java.lang.String symbols)
streamerName
- the streamer to update (example: "DEFAULT")cookie
- the Cookie receieved from the login.symbols
- the Ticker Symbols to update to.public boolean doLogout(java.lang.String cookie) throws java.net.MalformedURLException, java.io.IOException
cookie
- the Cookie receieved from the login.
java.net.MalformedURLException
java.io.IOException
public boolean doUpdate(java.lang.String streamerName, java.lang.String cookie, java.lang.String symbols) throws java.net.MalformedURLException, java.io.IOException
streamerName
- the streamer to update (example: "DEFAULT")cookie
- the Cookie receieved from the login.symbols
- the Ticker Symbols to update to.
java.net.MalformedURLException
java.io.IOException
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void cancel()
public boolean getCancelled()
public void addNotificationListener(NotificationListener listener)
listener
- the listener to notify.public void removeNotificationListener(NotificationListener listener)
listener
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |