|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.services.AbstractService
public abstract class AbstractService
AbstractService is the superclass of all services written in the framework. It has name and address information about the service. Subclasses implement the actual functionality of the service.
| Field Summary | |
|---|---|
protected HgraphNode |
_node
hgraph impl |
protected ist.palcom.services.AbstractService.ConnectionsMonitor |
connectionsMonitor
|
protected DeviceContext |
context
|
protected PRDService |
info
The info about the service. |
protected ServiceInstanceID |
siid
|
| 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 | |
|---|---|
AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText)
|
|
AbstractService(DeviceContext context,
java.lang.String name,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String readableVersionName,
java.lang.String serviceHelpText,
LocalSID localSID)
Create a new service instance. |
|
AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp)
|
|
AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp,
LocalSID localSID)
|
|
AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp,
LocalSID localSID,
GroupID groupID)
Constructor for Groupcast services. |
|
AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp,
LocalSID localSID,
Topic topic)
Constructor for Broadcast services. |
|
| Method Summary | |
|---|---|
int |
addNodeChild(IHgraphNode node,
Path callerPath)
Adds a child to the node's private list of children. |
void |
addServiceProxyListener(PalcomThread listener)
Add a listener for received ServiceProxies, for established connections to providers. |
protected void |
connectionClosed(UnicastConnection connection)
Notification that a connection has been closed. |
protected void |
connectionCreated(UnicastConnection connection)
Notification that a new connection has been established. |
void |
connectTo(LocalSID localSID)
Connect to the service identified by localSID. |
void |
disconnectFrom(LocalSID serviceLocalSID)
Closes the connection to the given provider and removes it from the list of connections. |
java.util.Iterator |
getChildIterator()
|
protected java.util.ArrayList |
getConnections()
Method for testing. |
FuncFunc |
getFuncFunc()
|
java.lang.String |
getNodeName()
hgraph impl below |
IHgraphNode |
getNodeParent()
|
Path |
getPath()
|
protected ServiceProxy |
getRemoteServiceProxy(LocalSID localSID)
|
Selector |
getSelector()
|
abstract ServiceID |
getServiceID()
|
PRDService |
getServiceInfo()
|
ServiceInstanceID |
getServiceInstanceID()
|
ServiceProxy |
getServiceProxy()
|
SiblingFunc |
getSiblingFunc()
|
ValueFunc |
getValueFunc()
|
boolean |
hasChildNamed(java.lang.String name)
Checks whether the node has a child with a given name |
boolean |
isAncestorOf(IHgraphNode node)
Checks whether this node is an ancestor of the parameter node. |
protected java.util.Iterator |
remoteServiceProxyIterator()
|
int |
removeNodeChild(java.lang.String name,
Path callerPath)
Removes a child based on its name. |
void |
removeServiceProxyListener(PalcomThread listener)
Remove a listener for ServiceProxies. |
protected void |
sendToAll(Message message)
|
void |
setGroupID(java.lang.String groupID)
|
void |
setLocalSID(LocalSID localSID)
Sets the LocalSID service. |
void |
setName(java.lang.String name)
Sets the name of the service to name. |
int |
setNodeName(java.lang.String name,
Path callerPath)
Sets the name of the node. |
int |
setNodeParent(IHgraphNode newParent,
Path callerPath)
Sets the parent of the HgraphNode. |
void |
setServiceInstanceID(ServiceInstanceID instanceID)
Sets the ServiceInstanceID for this service. |
void |
setServiceProxy(ServiceProxy proxy)
|
void |
setStatus(byte status,
java.lang.String helpText)
Set the status for the service. |
void |
setTopic(java.lang.String topic)
|
void |
start()
Start the service. |
void |
stop()
|
java.lang.String |
toXML()
|
java.lang.String |
toXMLFull()
|
java.lang.String |
toXMLFullRecursively()
|
java.lang.String |
toXMLRecursively()
|
void |
updatePath()
Updates the path of the H-Graph node along with its offspring recursively. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final DeviceContext context
protected final PRDService info
protected ServiceInstanceID siid
protected ist.palcom.services.AbstractService.ConnectionsMonitor connectionsMonitor
protected HgraphNode _node
| Constructor Detail |
|---|
public AbstractService(DeviceContext context,
java.lang.String name,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String readableVersionName,
java.lang.String serviceHelpText,
LocalSID localSID)
throws java.io.IOException
context - The device context of the servicename - The human-readable name of the servicehasDesc - Does the service have a descriptionremoteConnect - Will the service act on RemoteConnect messagesdistribution - The way the service connects to other servicesprotocol - The service interaction protocol spoken by the servicereliable - Do connecting services have to use reliable communicationreadableVersionName - A version presentation for the serviceserviceHelpText - A describing text for the servicelocalSID - A Local ServiceID for the service
java.io.IOException
public AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp,
LocalSID localSID)
throws java.io.IOException
java.io.IOException
public AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp,
LocalSID localSID,
Topic topic)
throws java.io.IOException
java.io.IOException
public AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp,
LocalSID localSID,
GroupID groupID)
throws java.io.IOException
java.io.IOException
public AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText,
ServiceProxy sp)
throws java.io.IOException
java.io.IOException
public AbstractService(DeviceContext context,
java.lang.String serviceName,
boolean hasDesc,
boolean remoteConnect,
byte distribution,
java.lang.String protocol,
boolean reliable,
java.lang.String versionName,
java.lang.String helpText)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public PRDService getServiceInfo()
getServiceInfo in interface Servicepublic Selector getSelector()
public void setLocalSID(LocalSID localSID)
java.lang.IllegalStateException - If the LocalSID has already been set.public void setServiceInstanceID(ServiceInstanceID instanceID)
public abstract ServiceID getServiceID()
public ServiceInstanceID getServiceInstanceID()
public void setStatus(byte status,
java.lang.String helpText)
public void setName(java.lang.String name)
public void start()
throws java.io.IOException
java.lang.IllegalStateException - if the LocalSID has not been set.
java.io.IOException
public void stop()
throws java.io.IOException
java.io.IOExceptionpublic void setTopic(java.lang.String topic)
public void setGroupID(java.lang.String groupID)
public void setServiceProxy(ServiceProxy proxy)
public ServiceProxy getServiceProxy()
getServiceProxy in interface Servicepublic void connectTo(LocalSID localSID)
connectTo in interface ServicelocalSID - ID of the service to connect to.public void addServiceProxyListener(PalcomThread listener)
public void removeServiceProxyListener(PalcomThread listener)
protected ServiceProxy getRemoteServiceProxy(LocalSID localSID)
protected java.util.Iterator remoteServiceProxyIterator()
public void disconnectFrom(LocalSID serviceLocalSID)
throws java.io.IOException
disconnectFrom in interface Servicejava.io.IOExceptionprotected void sendToAll(Message message)
protected void connectionCreated(UnicastConnection connection)
protected void connectionClosed(UnicastConnection connection)
protected java.util.ArrayList getConnections()
public java.lang.String getNodeName()
getNodeName in interface IHgraphNode
public int setNodeName(java.lang.String name,
Path callerPath)
IHgraphNode
setNodeName in interface IHgraphNodename - The new name
public Path getPath()
getPath in interface IHgraphNodepublic void updatePath()
IHgraphNode
updatePath in interface IHgraphNodepublic boolean hasChildNamed(java.lang.String name)
IHgraphNode
hasChildNamed in interface IHgraphNodename - The name to check
public boolean isAncestorOf(IHgraphNode node)
IHgraphNode
isAncestorOf in interface IHgraphNode
public int removeNodeChild(java.lang.String name,
Path callerPath)
IHgraphNode
removeNodeChild in interface IHgraphNodename - The name of the child to be removed
public java.lang.String toXML()
toXML in interface IHgraphNodepublic java.lang.String toXMLFull()
toXMLFull in interface IHgraphNodepublic java.lang.String toXMLRecursively()
toXMLRecursively in interface IHgraphNodepublic java.lang.String toXMLFullRecursively()
toXMLFullRecursively in interface IHgraphNode
public int setNodeParent(IHgraphNode newParent,
Path callerPath)
IHgraphNode
setNodeParent in interface IHgraphNodenewParent - the new parent
public int addNodeChild(IHgraphNode node,
Path callerPath)
IHgraphNode
addNodeChild in interface IHgraphNodenode - The new child to be added
public SiblingFunc getSiblingFunc()
getSiblingFunc in interface IHgraphNodepublic ValueFunc getValueFunc()
getValueFunc in interface IHgraphNodepublic FuncFunc getFuncFunc()
getFuncFunc in interface IHgraphNodepublic IHgraphNode getNodeParent()
getNodeParent in interface IHgraphNodepublic java.util.Iterator getChildIterator()
getChildIterator in interface IHgraphNode
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||