Class ResponderRegistry

java.lang.Object
org.serviceconnector.registry.Registry<Object,IResponder>
org.serviceconnector.net.res.ResponderRegistry
All Implemented Interfaces:
IRegistryMXBean

public final class ResponderRegistry extends Registry<Object,IResponder>
The Class ResponderRegistry. Responder registry stores every responder which completed register process correctly.
Author:
JTraber
  • Constructor Details

    • ResponderRegistry

      public ResponderRegistry()
      Instantiates a new responder registry.
  • Method Details

    • setThreadLocal

      public void setThreadLocal(Object obj)
      Sets an object in thread local attached to incoming thread. This object can be used later from the same thread. Other threads cannot access earlier set object.
      Parameters:
      obj - the new thread local
    • addResponder

      public void addResponder(Object key, IResponder responder)
      Adds an entry of a responder.
      Parameters:
      key - the key
      responder - the responder
    • removeResponder

      public void removeResponder(Object key)
      Removes the responder.
      Parameters:
      key - the key
    • getResponder

      public IResponder getResponder(Object key)
      Gets the responder.
      Parameters:
      key - the key
      Returns:
      the responder
    • getResponders

      public IResponder[] getResponders()
      Gets all responders.
      Returns:
      the responders
    • dump

      public void dump(XMLDumpWriter writer) throws Exception
      Dump the responders into the xml writer.
      Parameters:
      writer - the writer
      Throws:
      Exception - the exception
    • getCurrentResponder

      public IResponder getCurrentResponder()
      Gets the current responder.
      Returns:
      the current responder
    • getFirstResponderForConnectionType

      public IResponder getFirstResponderForConnectionType(ConnectionType connectionType)
      Gets the first responder matching given connection type.
      Parameters:
      connectionType - the connection type
      Returns:
      the first responder for connection type