Package org.dwcj.environment.namespace
Class StandardNamespace
java.lang.Object
org.dwcj.environment.namespace.StandardNamespace
- Direct Known Subclasses:
GlobalNamespace,GroupNamespace,PrivateNamespace
A Namespace is a shared object space, like a singleton.
Depending on its type it's shared gloablly across all clients, a family of clients started by the same parent, or has a private name.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.dwcj.environment.namespace.Namespace
Namespace.NamespaceType -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Delete all variables in this namespaceretrieve a variable from the namespacekeySet()list all variables in this namespaceonAccess(Consumer<NamespaceEvent> consumer) Register a callback that is called whenever anything inside this namespace is being written, regardless if it was a changeonChange(Consumer<NamespaceEvent> consumer) Register a callback that is called whenever anything inside this namespace changesonVariableAccess(String key, Consumer<NamespaceEvent> consumer) Register a callback that is called whenever a specific variable inside this namespace was written, regardless if it changed its valueonVariableChange(String key, Consumer<NamespaceEvent> consumer) Register a callback that is called whenever a specific variable inside this namespace changesvoidPut a variable in the namespacevoidremove a variable from the namespacevoidremoveLock(String key) voidintsize()Get the variable count in this namespace.
-
Field Details
-
ns
protected com.basis.bbj.proxies.BBjNamespace ns
-
-
Constructor Details
-
StandardNamespace
public StandardNamespace()
-
-
Method Details
-
put
Description copied from interface:NamespacePut a variable in the namespace- Specified by:
putin interfaceNamespace- Parameters:
key- the variable namevalue- the variable contents- Throws:
NamespaceVarableLockedException
-
get
Description copied from interface:Namespaceretrieve a variable from the namespace -
remove
Description copied from interface:Namespaceremove a variable from the namespace- Specified by:
removein interfaceNamespace- Parameters:
key- the variable name- Throws:
NamespaceVarableLockedException
-
keySet
Description copied from interface:Namespacelist all variables in this namespace -
size
public int size()Description copied from interface:NamespaceGet the variable count in this namespace. -
clear
public void clear()Description copied from interface:NamespaceDelete all variables in this namespace -
setLock
- Specified by:
setLockin interfaceCanLock- Throws:
NamespaceVarableLockedException
-
removeLock
- Specified by:
removeLockin interfaceCanLock
-
onChange
Register a callback that is called whenever anything inside this namespace changes- Parameters:
consumer- the consumer to notify- Returns:
-
onAccess
Register a callback that is called whenever anything inside this namespace is being written, regardless if it was a change- Parameters:
consumer- the consumer to notify- Returns:
-
onVariableChange
Register a callback that is called whenever a specific variable inside this namespace changes- Parameters:
consumer- the consumer to notify- Returns:
-
onVariableAccess
Register a callback that is called whenever a specific variable inside this namespace was written, regardless if it changed its value- Parameters:
consumer- the consumer to notify- Returns:
-