ist.palcom.assembly.manager
Class AssemblyManager

java.lang.Object
  extended by ist.palcom.services.AbstractService
      extended by ist.palcom.assembly.manager.AssemblyManager
All Implemented Interfaces:
IAssemblyManager, Service, IHgraphNode, CommandEventListener
Direct Known Subclasses:
EclipseAssemblyManager, PalBoxAssemblyManager

public class AssemblyManager
extends AbstractService
implements IAssemblyManager


Field Summary
 
Fields inherited from class ist.palcom.services.AbstractService
_node, connectionsMonitor, context, info, siid
 
Fields inherited from interface ist.palcom.assemblies.IAssemblyManager
COMMAND_ADD_DECL, COMMAND_ASSEMBLYINFO, COMMAND_LIST_LOADED, COMMAND_LIST_STORED, COMMAND_LOAD, COMMAND_LOAD_ID, COMMAND_LOADED_ASSEMBLIES, COMMAND_LOADED_COUNT_IN, COMMAND_LOADED_COUNT_OUT, COMMAND_READ_LOADED, COMMAND_REM_DECL, COMMAND_STORE, COMMAND_STORED_ASSEMBLIES, COMMAND_STORED_COUNT_IN, COMMAND_STORED_COUNT_OUT, COMMAND_UNLOAD, COMMAND_UNLOAD_ALL, COMMAND_UPDATE, ENABLE_UPDATE_SERVICE, SERVICE_NAME, URN_SUFFIX
 
Fields inherited from interface ist.palcom.hgraph.IHgraphNode
CHILD_NAME_CLASH, CIRCULARITY_CLASH, COMMAND_OR_NODE_MISSING, ERROR, HANDLER_MISSING, INVOKATOR_MISSING, LISTENER_MISSING, NODE_NOT_CHILD, PATH_MISSING, SIBLING_ALREADY_EXISTS, SIBLING_NONEXISTENT, SIBLING_REFERENCE_ALREADY_EXISTS, SIBLING_REFERENCE_NONEXISTENT, STATUS_OK, VALUE_ALREADY_EXISTS, VALUE_NOT_PRESENT
 
Constructor Summary
AssemblyManager(DeviceContext context)
          This constructor makes it possible to instantiate the AssemblyManager from the ServiceManager
AssemblyManager(DeviceContext context, java.lang.String serviceName)
           
 
Method Summary
 Assembly checkIfUpdateToRunning(PRDAssemblyVer ai)
          Aux method: iterate over the assemblies, and check if ai is an update to any of them.
 PRDAssemblyD checkIfUpdateToStored(PRDAssemblyVer ai)
           
 void commandReceived(CommandEvent e)
           
 void doAddDeclCommand(java.lang.String idxStr, java.lang.String decl)
           
protected  void doCommand(java.lang.String commandID, byte[] data)
           
protected  void doCommand(java.lang.String commandID, java.lang.String text)
           
 void doRemDeclCommand(java.lang.String idxStr, java.lang.String decl)
           
protected  void doUpdateCommand(PRDAssemblyVer ai)
           
 PalcomThread getEditCommandReceiverThread()
          Returns a palcom thread responsible for receiving and executing edit commands for (running) assemblies
 LinearMap getLoadedAssemblies()
          Returns a LinearMap with index:name logical version <--> assembly ID
protected  SelfTestProvider getSelfTestService(java.lang.String urn)
           
 ServiceID getServiceID()
           
 void loadAssembly(PRDAssemblyVer ai)
           
 byte[] readAssembly(int index)
           
 void registerContingencyManagerThread(PalcomThread t)
          Register a thread that receives requests for contingency monitoring for assemblies loaded onto this assembly manager.
 void removeAssemblies()
           
 void start()
          Start the service.
 void stop()
           
 void stopAssembly(Assembly a)
           
 void stopAssembly(java.lang.String assemblySIID)
           
 void unregisterContingencyManagerThread(PalcomThread t)
          Unregister the receiver thread
 
Methods inherited from class ist.palcom.services.AbstractService
addNodeChild, addServiceProxyListener, connectionClosed, connectionCreated, connectTo, disconnectFrom, getChildIterator, getConnections, getFuncFunc, getNodeName, getNodeParent, getPath, getRemoteServiceProxy, getSelector, getServiceInfo, getServiceInstanceID, getServiceProxy, getSiblingFunc, getValueFunc, hasChildNamed, isAncestorOf, remoteServiceProxyIterator, removeNodeChild, removeServiceProxyListener, sendToAll, setGroupID, setLocalSID, setName, setNodeName, setNodeParent, setServiceInstanceID, setServiceProxy, setStatus, setTopic, toXML, toXMLFull, toXMLFullRecursively, toXMLRecursively, updatePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ist.palcom.assemblies.IAssemblyManager
getServiceProxy
 
Methods inherited from interface ist.palcom.hgraph.IHgraphNode
addNodeChild, getChildIterator, getFuncFunc, getNodeName, getNodeParent, getPath, getSiblingFunc, getValueFunc, hasChildNamed, isAncestorOf, removeNodeChild, setNodeName, setNodeParent, toXML, toXMLFull, toXMLFullRecursively, toXMLRecursively, updatePath
 

Constructor Detail

AssemblyManager

public AssemblyManager(DeviceContext context,
                       java.lang.String serviceName)
                throws java.io.IOException
Throws:
java.io.IOException

AssemblyManager

public AssemblyManager(DeviceContext context)
                throws java.io.IOException
This constructor makes it possible to instantiate the AssemblyManager from the ServiceManager

Throws:
java.io.IOException
Method Detail

getServiceID

public ServiceID getServiceID()
Specified by:
getServiceID in class AbstractService
Returns:
the ServiceID of the service.

getSelfTestService

protected SelfTestProvider getSelfTestService(java.lang.String urn)

commandReceived

public void commandReceived(CommandEvent e)
Specified by:
commandReceived in interface CommandEventListener

doUpdateCommand

protected void doUpdateCommand(PRDAssemblyVer ai)

getLoadedAssemblies

public LinearMap getLoadedAssemblies()
Returns a LinearMap with index:name logical version <--> assembly ID


stopAssembly

public void stopAssembly(java.lang.String assemblySIID)

readAssembly

public byte[] readAssembly(int index)
Specified by:
readAssembly in interface IAssemblyManager

doAddDeclCommand

public void doAddDeclCommand(java.lang.String idxStr,
                             java.lang.String decl)
Specified by:
doAddDeclCommand in interface IAssemblyManager

doRemDeclCommand

public void doRemDeclCommand(java.lang.String idxStr,
                             java.lang.String decl)
Specified by:
doRemDeclCommand in interface IAssemblyManager

doCommand

protected void doCommand(java.lang.String commandID,
                         java.lang.String text)

doCommand

protected void doCommand(java.lang.String commandID,
                         byte[] data)

loadAssembly

public void loadAssembly(PRDAssemblyVer ai)
Specified by:
loadAssembly in interface IAssemblyManager

stopAssembly

public void stopAssembly(Assembly a)
Specified by:
stopAssembly in interface IAssemblyManager

removeAssemblies

public void removeAssemblies()
Specified by:
removeAssemblies in interface IAssemblyManager

start

public void start()
           throws java.io.IOException
Description copied from class: AbstractService
Start the service. The LocalSID must be set before calling this method (through a constructor, or through a call to the setLocalSID method). If the service is started already, nothing happens. The DiscoveryManager will be updated with info about the service.

Specified by:
start in interface IAssemblyManager
Overrides:
start in class AbstractService
Throws:
java.io.IOException

stop

public void stop()
          throws java.io.IOException
Specified by:
stop in interface IAssemblyManager
Overrides:
stop in class AbstractService
Throws:
java.io.IOException

checkIfUpdateToRunning

public Assembly checkIfUpdateToRunning(PRDAssemblyVer ai)
Aux method: iterate over the assemblies, and check if ai is an update to any of them.

Specified by:
checkIfUpdateToRunning in interface IAssemblyManager
Parameters:
ai -
Returns:
the parent of ai, or null

checkIfUpdateToStored

public PRDAssemblyD checkIfUpdateToStored(PRDAssemblyVer ai)
Specified by:
checkIfUpdateToStored in interface IAssemblyManager

registerContingencyManagerThread

public void registerContingencyManagerThread(PalcomThread t)
Register a thread that receives requests for contingency monitoring for assemblies loaded onto this assembly manager.

Specified by:
registerContingencyManagerThread in interface IAssemblyManager
Parameters:
t - - The receiver thread

unregisterContingencyManagerThread

public void unregisterContingencyManagerThread(PalcomThread t)
Unregister the receiver thread

Specified by:
unregisterContingencyManagerThread in interface IAssemblyManager
Parameters:
t - - the thread

getEditCommandReceiverThread

public PalcomThread getEditCommandReceiverThread()
Returns a palcom thread responsible for receiving and executing edit commands for (running) assemblies

Specified by:
getEditCommandReceiverThread in interface IAssemblyManager