public class XholonDirectoryService extends AbstractXholonService
IXholon ann = XholonDirectoryService.instance().get(Annotation.makeUniqueKey(this));Or:
IXholon ann = ((XholonDirectoryService)getService(IXholonService.XHSRV_XHOLON_DIRECTORY)) .get(Annotation.makeUniqueKey(this));A typical use is storing and accessing a Xholon Annotation.
TODO Possibly this service should be called XholonAttributeService ?
TODO Because this is a global object, the entries in the xholonMap will persist even if a new application is run. The Map needs to be emptied when a new application is loaded. However, new values will just replace existing ones, so there's not much danger.
TODO There should be at least one action that would appear in XholonGui menu: Show All Entries
activated
SIG_ADD_REQUEST, SIG_PROCESS_REQUEST, SIG_RESPONSE, SIG_RESPONSE_ERROR, XHSRV_ABOUT, XHSRV_BERKELEY_DB, XHSRV_BLACKBOARD, XHSRV_BLUEPRINTS, XHSRV_CHART_VIEWER, XHSRV_CSS, XHSRV_DATABASE, XHSRV_DUMMY, XHSRV_EXTERNAL_FORMAT, XHSRV_GAME_ENGINE, XHSRV_GIST, XHSRV_GRAPHICAL_NETWORK_VIEWER, XHSRV_GRAPHICAL_TREE_VIEWER, XHSRV_GRID_VIEWER, XHSRV_HISTOGRAM, XHSRV_JAVA_SERIALIZATION, XHSRV_JAXEN, XHSRV_JCR, XHSRV_JXPATH, XHSRV_LOG, XHSRV_MATHSCIENG, XHSRV_MEDIA, XHSRV_NETLOGO, XHSRV_NODE_SELECTION, XHSRV_NOSQL, XHSRV_PCSPATH, XHSRV_PRE_CONFIGURATION, XHSRV_RECORD_PLAYBACK, XHSRV_REFLECTION, XHSRV_REST, XHSRV_SBML, XHSRV_SCRIPT, XHSRV_SEARCH_ENGINE, XHSRV_SEMANTIC_WEB, XHSRV_SERVICE_LOCATOR, XHSRV_SPRING_FRAMEWORK, XHSRV_SVG_VIEW, XHSRV_TEXT_TREE_VIEWER, XHSRV_TIMELINE, XHSRV_VALIDATION, XHSRV_VFS, XHSRV_VRML, XHSRV_WIRING, XHSRV_XHOLON_CREATION, XHSRV_XHOLON_DIRECTORY, XHSRV_XHOLON_HELPER, XHSRV_XHOLON2XML, XHSRV_XML_DATABASE, XHSRV_XML_READER, XHSRV_XML_VALIDATION, XHSRV_XML_WRITER, XHSRV_XML2XHOLON, XHSRV_XPATH, XHSRV_XQUERY
DEFAULT_SIZE_MSG_Q, DEFAULT_SIZE_SYSTEM_MSG_Q, GETNAME_DEFAULT, GETNAME_LOCALPART_ID, GETNAME_NOROLENAME, GETNAME_ROLENAME_OR_CLASSNAME, GETNAME_ROLENAMESEP_, GETNAME_SIZE_TEMPLATE, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx, XHOLON_ID_DEFAULT, XHOLON_ID_NULL
Constructor and Description |
---|
XholonDirectoryService() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all entries.
|
boolean |
containsKey(java.lang.String key)
Check if the service contains a Object or IXholon instance that matches a String key.
|
void |
doAction(java.lang.String action)
Do a specific action that this xholon knows how to do.
|
java.lang.Object |
get(java.lang.String key)
Get a Object or IXholon instance that matches a String key.
|
java.lang.String[] |
getActionList()
Get a list of actions that this xholon can do.
|
IXholon |
getService(java.lang.String serviceName)
Get the singleton instance of the Xholon Directory Service.
|
static java.lang.String |
makeUniqueKey(java.lang.Object node,
java.lang.String name)
Make and return a unique key for a Object or IXholon node.
|
void |
put(java.lang.String key,
java.lang.Object value)
Store a Object or IXholon instance for later retreival using a String key.
|
java.lang.Object |
remove(java.lang.String key)
Remove the Object or IXholon instance that matches a String key.
|
void |
setActionList(java.lang.String[] actionList)
Set the list of actions that this xholon can do.
|
act, getServiceLocatorService, hasAnnotation, isActivated, postAct, preAct, setActivated, toXmlAttributes
actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, compareTo, configure, configure, consoleLog, decVal, decVal, depth, equals, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFactory, getFirstChild, getFirstSibling, getId, getInteraction, getInteractionsEnabled, getIQueueImplName, getLastChild, getLastSibling, getLogger, getMsgQ, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getSiblings, getSystemMsgQ, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, getXPath, handleNodeSelection, handleNodeSelection, hasAncestor, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postConfigure, postOrderPrint, postReconfigure, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, searchForReferencingNodesRecurse, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toString, toXml, toXmlAttribute, toXmlText, treeSize, visit
public java.lang.Object get(java.lang.String key)
key
- A unique non-null key.Map
public void put(java.lang.String key, java.lang.Object value)
key
- A unique non-null key.value
- A non-null instance of Object or IXholon.Map
public java.lang.Object remove(java.lang.String key)
key
- A unique non-null key.public boolean containsKey(java.lang.String key)
key
- A unique non-null key.public void clear()
public IXholon getService(java.lang.String serviceName)
getService
in interface IXholon
getService
in class AbstractXholonService
serviceName
- The name of a service.
This is the name used in XholonService.xml, which is the IXholonClass name.AbstractXholonService.getService(java.lang.String)
public java.lang.String[] getActionList()
IXholon
getActionList
in interface IXholon
getActionList
in class Xholon
public void setActionList(java.lang.String[] actionList)
IXholon
setActionList
in interface IXholon
setActionList
in class Xholon
actionList
- A list of actions, or null.public void doAction(java.lang.String action)
IXholon
public static java.lang.String makeUniqueKey(java.lang.Object node, java.lang.String name)
node
- An Object or IXholon instance.name
- The name of an attribute.