Class NameRegistrar
java.lang.Object
org.jpos.util.NameRegistrar
- All Implemented Interfaces:
Loggeable
Allow runtime binding of jPOS's components (ISOChannels, Logger, MUXes, etc)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThrown when a requested name is not found in the registrar. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) Dumps a summary of registered names to the given stream.voiddump(PrintStream p, String indent, boolean detail) Dumps registered names to the given stream, optionally including object detail.static <T> TGet a value from the registry.static <T> TGet a value from the registry - wait for it specified time.getAsMap()Returns a copy of the NameRegistrar's entries as a Map.static <T> TgetIfExists(String key) Get a value from the registry - without castingNotFoundException.static NameRegistrarReturns the singleton NameRegistrar instance.getSpace()Returns the underlying TSpace used for name registration.static voidregister objectstatic voidunregister(String key) Removes the mapping for the given key from the registrar.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Method Details
-
getSpace
-
getAsMap
-
getInstance
Returns the singleton NameRegistrar instance.- Returns:
- singleton instance
-
register
-
unregister
Removes the mapping for the given key from the registrar.- Parameters:
key- key whose mapping is to be removed from registrar.
-
get
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
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
nullif it does not exist
-
getIfExists
Get a value from the registry - without castingNotFoundException.- Type Parameters:
T- desired type of value.- Parameters:
key- the key whose associated value is to be returned.- Returns:
- a value or
nullif it does not exist
-
dump
Dumps a summary of registered names to the given stream. -
dump
Dumps registered names to the given stream, optionally including object detail.- Parameters:
p- output streamindent- indent prefixdetail- if true, also dumps Loggeable objects
-