Class ServiceState

java.lang.Object
com.invirgance.convirgance.web.servlet.ServiceState

public class ServiceState extends Object
Records the current state of the Service using a ThreadLocal so that pluggable objects can access the state during execution.
Author:
jbanes
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Object
    get(String key)
    Get the key configured by the current Service. e.g.
    static void
    Clears the thread local of information to prepare the thread for reuse, prevent leaking of information, and avoid memory leaks
    static void
    set(String key, Object value)
    Sets the key/value pair on the thread local

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServiceState

      public ServiceState()
  • Method Details

    • get

      public static Object get(String key)
      Get the key configured by the current Service. e.g. "parameters" is often a JSONObject containing parameters collected from the request, session, and other locations.
      Parameters:
      key - the key to look up
      Returns:
      the value of the key if found, null otherwise
    • set

      public static void set(String key, Object value)
      Sets the key/value pair on the thread local
      Parameters:
      key - the key to set
      value - the value to set for the key
    • release

      public static void release()
      Clears the thread local of information to prepare the thread for reuse, prevent leaking of information, and avoid memory leaks