cgl.hhms.hhfr.wscontext
Class ContextServiceHandler

java.lang.Object
  extended bycgl.hhms.hhfr.wscontext.ContextServiceHandler
All Implemented Interfaces:
java.lang.Runnable

public class ContextServiceHandler
extends java.lang.Object
implements java.lang.Runnable

Methods that send request to that WS-Context service.

This version provides two public methods, setContext and getContext.

Both indetifierKey and contextData are String types.


Constructor Summary
ContextServiceHandler(java.lang.String serviceUrl, int version)
          Creates a new ContextServiceHandler instance.
 
Method Summary
 java.lang.String getContext(java.lang.String identifierKey)
          Get desired context data with identifier.
 void run()
          run method which makes WS-Context requests for setContext and getContext.
 boolean setContext(java.lang.String identifierKey, java.lang.String data)
          Set desired context data with identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextServiceHandler

public ContextServiceHandler(java.lang.String serviceUrl,
                             int version)
Creates a new ContextServiceHandler instance.

Parameters:
serviceUrl - the url of WS-Context service
version - the version of WS-Context service implementation
Method Detail

getContext

public java.lang.String getContext(java.lang.String identifierKey)
                            throws java.lang.InterruptedException
Get desired context data with identifier.

Parameters:
identifierKey - the key to identify context data
Returns:
context data as a String type
Throws:
java.lang.InterruptedException

setContext

public boolean setContext(java.lang.String identifierKey,
                          java.lang.String data)
                   throws java.lang.InterruptedException
Set desired context data with identifier.

Parameters:
identifierKey - the key to identify context data
data - context data
Returns:
result of action as a boolean
Throws:
java.lang.InterruptedException

run

public void run()
run method which makes WS-Context requests for setContext and getContext.

getContext and setContext requests are made in run() to avoid a possible deadlock.

Specified by:
run in interface java.lang.Runnable
Returns:
result of action as a boolean