public class ProtocolHandler extends AbstractEventHandler implements Activatable, IntrospectionModel.IntrospectionModelObserver
IntrospectionModel.IntrospectionModelObserver
.Activatable.State
Constructor and Description |
---|
ProtocolHandler(IntrospectionModel model,
String processDisplayName)
Creates a new instance operating on the provided introspection model.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
void |
close() |
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
void |
handleEvent(Event query)
Shall implement the real handling logic for an event.
|
boolean |
isActive()
Tells whether this class is currently active or not.
|
void |
participantAdded(ParticipantInfo info)
Called in case a new participant has been added to the model.
|
void |
participantRemoved(ParticipantInfo info)
Called in case a participant has been removed from the model.
|
internalNotify
public ProtocolHandler(IntrospectionModel model, String processDisplayName)
model
- the mode, not null
processDisplayName
- human-readable name of the process this instance operates in,
may be null
if not providedLacksOsInformationException
- thrown in case required information from the operating system
are not available. This makes the introspection unusable.public void activate() throws RSBException
Activatable
activate
in interface Activatable
RSBException
- generic error related to RSBpublic void deactivate() throws RSBException, InterruptedException
Activatable
deactivate
in interface Activatable
RSBException
- generic error related to RSBInterruptedException
- interrupted while waiting for proper deactivation. Object
might be in an undefined state nowpublic void handleEvent(Event query)
AbstractEventHandler
handleEvent
in class AbstractEventHandler
query
- the event to handlepublic boolean isActive()
Activatable
isActive
in interface Activatable
true
if activepublic void participantAdded(ParticipantInfo info)
IntrospectionModel.IntrospectionModelObserver
participantAdded
in interface IntrospectionModel.IntrospectionModelObserver
info
- information about the participant, not null
public void participantRemoved(ParticipantInfo info)
IntrospectionModel.IntrospectionModelObserver
participantRemoved
in interface IntrospectionModel.IntrospectionModelObserver
info
- information about the participant, not null
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2018 CoR-Lab. All rights reserved.