Class NameRegistrar

java.lang.Object
org.jpos.util.NameRegistrar
All Implemented Interfaces:
Loggeable

public class NameRegistrar extends Object implements Loggeable
Allow runtime binding of jPOS's components (ISOChannels, Logger, MUXes, etc)
  • Method Details

    • getSpace

      public static TSpace<String,Object> getSpace()
    • getAsMap

      public static Map<String,Object> getAsMap()
      Returns:
      a copy of the NameRegistrar's entries as a Map
    • getInstance

      public static NameRegistrar getInstance()
      Returns:
      singleton instance
    • register

      public static void register(String key, Object value)
      register object
      Parameters:
      key - - key with which the specified value is to be associated.
      value - - value to be associated with the specified key
    • unregister

      public static void unregister(String key)
      Parameters:
      key - key whose mapping is to be removed from registrar.
    • get

      public static <T> T get(String key) throws NameRegistrar.NotFoundException
      Get a value from the registry.
      Type Parameters:
      T - desired type of entry value.
      Parameters:
      key - the key whose associated value is to be returned.
      Returns:
      a value
      Throws:
      NameRegistrar.NotFoundException - if key not present in registrar
    • get

      public static <T> T get(String key, long timeout)
      Get a value from the registry - wait for it specified time.
      Type Parameters:
      T - desired type of value.
      Parameters:
      key - the key whose associated value is to be returned.
      timeout - the maximum waiting time (in miliseconds) for the appearance of value in the registry.
      Returns:
      a value or null if it does not exist
    • getIfExists

      public static <T> T getIfExists(String key)
      Get a value from the registry - without casting NotFoundException.
      Type Parameters:
      T - desired type of value.
      Parameters:
      key - the key whose associated value is to be returned.
      Returns:
      a value or null if it does not exist
    • dump

      public void dump(PrintStream p, String indent)
      Specified by:
      dump in interface Loggeable
    • dump

      public void dump(PrintStream p, String indent, boolean detail)