public class PlasticMonitor extends Object implements PlasticApplication
This class is intended to be used standalone from its main(java.lang.String[])
method.
CURRENT_VERSION
Constructor and Description |
---|
PlasticMonitor(String name,
boolean multiclient,
PrintStream logOut,
PrintStream warnOut)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the application generic name.
|
URI[] |
getSupportedMessages()
Returns the messages which the application will support.
|
static void |
main(String[] args)
Starts a monitor of the PLASTIC message bus which logs message
descriptions to standard output.
|
Object |
perform(URI sender,
URI message,
List args)
Request that the application perform an action based on a message.
|
void |
setHub(PlasticHubListener hub)
Sets the hub this monitor is listening to.
|
void |
setListModel(uk.ac.starlink.plastic.ApplicationListModel listModel)
Sets a list model this monitor should keep up to date.
|
static String |
stringify(Object value)
Stringifies an object for logging purposes.
|
public PlasticMonitor(String name, boolean multiclient, PrintStream logOut, PrintStream warnOut)
name
- application namemulticlient
- true if you want it to attempt to implement
all known messageslogOut
- logging output streamwarnOut
- warning output streampublic String getName()
PlasticApplication
getName
in interface PlasticApplication
public URI[] getSupportedMessages()
PlasticApplication
getSupportedMessages
in interface PlasticApplication
public Object perform(URI sender, URI message, List args)
PlasticListener
perform
in interface PlasticListener
sender
- the ID of the originating application.message
- the URI representing the action.args
- any arguments to pass.public void setHub(PlasticHubListener hub)
hub
- hubpublic void setListModel(uk.ac.starlink.plastic.ApplicationListModel listModel)
listModel
- model of registered applicationspublic static String stringify(Object value)
value
- object to stringifypublic static void main(String[] args) throws IOException
MessageDefinition
class)IOException
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.