org.sr.server
Class CallerContext

java.lang.Object
  extended by org.sr.server.CallerContext

public class CallerContext
extends java.lang.Object

This class is designed to keep caller context information and incoming message object in thread local variables during service call life cycle so that arbitrary classes which executed in the same thread can access the context information. End point implementations need to set context information explicitly and reset them before returning back to the client.

Author:
Serhat Dirik

Constructor Summary
CallerContext()
           
 
Method Summary
static ICallerContextInfo<?> getCallerContextInfo()
          Gives caller context information.
static java.lang.Object getIncomingMessage()
          Gives incoming message.
static void resetContextValues()
          Nulls thread local the values
static void setContextValues(ICallerContextInfo<?> contextInfo, java.lang.Object incomingMessage)
          This method is designed for end points usage.They need to set up values by using this method immediately a message comes in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallerContext

public CallerContext()
Method Detail

getCallerContextInfo

public static ICallerContextInfo<?> getCallerContextInfo()
Gives caller context information. Returns null if end point didn't setup

Returns:
caller context information

getIncomingMessage

public static java.lang.Object getIncomingMessage()
Gives incoming message. Returns null if end point didn't setup

Returns:
original incoming message

setContextValues

public static void setContextValues(ICallerContextInfo<?> contextInfo,
                                    java.lang.Object incomingMessage)
This method is designed for end points usage.They need to set up values by using this method immediately a message comes in. Only thread safe end point implementations should use this.

Parameters:
contextInfo -
incomingMessage -

resetContextValues

public static void resetContextValues()
Nulls thread local the values