public abstract class Method extends Participant
Listener
and Informer
instances used
to communicate between methods as well as a state pattern for activating
them.Modifier | Constructor and Description |
---|---|
protected |
Method(ParticipantCreateArgs<?> args)
Create a new Method object for the method named @a name.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
protected Factory |
getFactory()
Returns the factory instance to use by this method for creating internal
participants.
|
Informer<?> |
getInformer()
Return the Informer object associated to this method.
|
Listener |
getListener()
Return the Listener object associated to this method.
|
String |
getName()
Return the name of this method.
|
boolean |
isActive()
Tells whether this class is currently active or not.
|
protected void |
setInformer(Informer<?> informer)
Sets the informer instances used by this method communicate with
counterparts.
|
protected void |
setListener(Listener listener)
Sets the listener instance used by this method to communicate with
counterparts.
|
String |
toString() |
getConfig, getDataType, getId, getKind, getObserverManager, getScope, getTransportUris, setObserverManager
close
protected Method(ParticipantCreateArgs<?> args)
args
- Arguments used to create a method instances. The last scope
fragment is assumed to be the method name.protected Factory getFactory()
public String getName()
public Informer<?> getInformer()
public Listener getListener()
public boolean isActive()
Activatable
true
if activepublic void activate() throws RSBException
Activatable
activate
in interface Activatable
activate
in class Participant
RSBException
- generic error related to RSBpublic void deactivate() throws RSBException, InterruptedException
Activatable
deactivate
in interface Activatable
deactivate
in class Participant
RSBException
- generic error related to RSBInterruptedException
- interrupted while waiting for proper deactivation. Object
might be in an undefined state nowprotected void setInformer(Informer<?> informer)
informer
- the new informer instancesprotected void setListener(Listener listener)
listener
- the new listenersCopyright © 2018 CoR-Lab. All rights reserved.