MethodType
- The type of methods used in the subclassespublic abstract class Server<MethodType extends Method> extends Participant
Modifier | Constructor and Description |
---|---|
protected |
Server(ParticipantCreateArgs<?> args)
Constructs a new server.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
protected void |
addMethod(String name,
MethodType method,
boolean overwrite)
Adds a method to the server.
|
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
MethodType |
getMethod(String name)
Returns the method with the given name.
|
Collection<MethodType> |
getMethods()
Return all methods of the server.
|
Set<URI> |
getTransportUris()
Returns URIs describing the transports configured for this participants.
|
boolean |
hasMethod(String name)
Indicates whether a method with the given name is already registered.
|
boolean |
isActive()
Tells whether this class is currently active or not.
|
getConfig, getDataType, getId, getKind, getObserverManager, getScope, setObserverManager
protected Server(ParticipantCreateArgs<?> args)
args
- arguments used for this serverpublic Collection<MethodType> getMethods()
public MethodType getMethod(String name)
name
- method nameMethod
instance or null
if no method exists
with this namepublic boolean hasMethod(String name)
name
- name of the methodtrue
if a method is registered with the given name,
else false
protected void addMethod(String name, MethodType method, boolean overwrite)
name
- name under which the method should be registeredmethod
- the method instanceoverwrite
- if true
, overwrite an existing method with that
name, else raise an exceptionIllegalArgumentException
- method with the given name already exists and shall not be
overwrittenpublic 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 nowpublic Set<URI> getTransportUris()
Participant
getTransportUris
in class Participant
null
Copyright © 2018 CoR-Lab. All rights reserved.