Participant

public abstract class Participant extends AbstractActivatable

Base class for all bus participants with an associated scope. Mainly holds references to the router and configuration-level objects. Implementing classes need to ensure that activate() and deactivate() are called in case these methods are overridden. Method activate() has to be called before setting up the active state. Method activated() needs to be called once all required internal details are set up and processing is possible now and deactivate() needs to be called before functionality is teared down.

Author

jwienke, swrede

Constructors

Participant

protected Participant(ParticipantCreateArgs<?> args)

Creates a new participant on the specified scope.

Parameters

args – arguments used to create this participant

Methods

activate

public void activate()

activated

protected void activated()

Post-activation hook. To be called by subclasses after their activation has finished and they have effectively entered the active state.

Throws

RSBException – activation hook failed

deactivate

public void deactivate()

getConfig

public ParticipantConfig getConfig()

Returns the ParticipantConfig used for this participant.

Returns

instance not null

getDataType

public abstract Class<?> getDataType()

Returns the data type transfered by this participant.

Returns

type class, null if not applicable for this type of participant

getId

public ParticipantId getId()

Returns the unique ID of this participant.

Returns

the unique id of the participant

getKind

public abstract String getKind()

Returns kind of participant in RSB terminology.

Returns

Key describing participant. One of listener, informer, local-server, local-method, remote-server, remote-method

getObserverManager

protected ParticipantObserverManager getObserverManager()

Returns the observer manager to notify about participant changes.

Returns

manager or null

getScope

public Scope getScope()

Returns the scope of this participant.

Returns

scope of the participant, not null

getTransportUris

public abstract Set<URI> getTransportUris()

Returns URIs describing the transports configured for this participants. Only valid if activated.

Throws

IllegalStateException – participant is in wrong state to get these URIs

Returns

set of transport URIs, not null

setObserverManager

public void setObserverManager(ParticipantObserverManager observerManager)

Sets the observer manager to use for notifying deactivation. Internal use only!

Parameters

observerManager – the observer manager to use or null if not required