public class PlasticHub extends MinimalHub
ListModel which keeps track of
registered applications, and a main(java.lang.String[]) method to start it up.PLASTIC_CONFIG_FILENAME, PLASTIC_RMI_PORT_KEY, PLASTIC_VERSION_KEY, PLASTIC_XMLRPC_URL_KEY| Constructor and Description |
|---|
PlasticHub(ServerSet servers)
Constructs a new hub, given running server objects.
|
| Modifier and Type | Method and Description |
|---|---|
ListModel |
getApplicationListModel()
Returns a ListModel which represents the listener applications
currently registered with this hub.
|
String |
getName(URI id)
Get the name of this application, as used at registration.
|
List |
getUnderstoodMessages(URI id)
Get the messages understood by this application.
|
static void |
main(String[] args)
Starts a hub.
|
void |
setLogStream(PrintStream out)
Sets a stream for this hub to perform logging to.
|
void |
setWarningStream(PrintStream out)
Sets a stream for this hub to log warnings (about validation of
messages etc) to.
|
static PlasticHub |
startHub(PrintStream logOut,
PrintStream warnOut)
Creates and starts a PlasticHub running, writing its config information
to the default file and optionally logging output to a print stream.
|
static PlasticHub |
startHub(PrintStream logOut,
PrintStream warnOut,
File configFile)
Creates and starts a PlasticHub running, optionally
writing the config information into a given file and
logging output to a print stream.
|
void |
stop()
Shuts down this hub and tidies up.
|
void |
unregister(URI id)
Unregister the application from the hub.
|
execute, finalize, getHubId, getMessageRegisteredIds, getRegisteredIds, pollForMessages, registerNoCallBack, registerPolling, registerRMI, registerXMLRPC, request, requestAsynch, requestToSubset, requestToSubsetAsynchpublic PlasticHub(ServerSet servers) throws RemoteException
servers - object encapsulating listening serversRemoteExceptionpublic void unregister(URI id)
PlasticHubListenerunregister in interface PlasticHubListenerunregister in class MinimalHubid - the application to unregisterpublic String getName(URI id)
PlasticHubListenergetName in interface PlasticHubListenergetName in class MinimalHubid - the plastic ID returned at registrationpublic List getUnderstoodMessages(URI id)
PlasticHubListenergetUnderstoodMessages in interface PlasticHubListenergetUnderstoodMessages in class MinimalHubid - the plastic ID returned at registrationpublic ListModel getApplicationListModel()
public void stop()
MinimalHubstop in class MinimalHubpublic void setLogStream(PrintStream out)
out is null (the default), no logging is performed.out - logging print streampublic void setWarningStream(PrintStream out)
out is null (the default), no logging is performed.out - warning print streampublic static PlasticHub startHub(PrintStream logOut, PrintStream warnOut) throws IOException, RemoteException
logOut - logging output stream (may be null for no logging)warnOut - logging stream for warnings (may be null for no logging)IOExceptionRemoteExceptionpublic static PlasticHub startHub(PrintStream logOut, PrintStream warnOut, File configFile) throws RemoteException, IOException
PlasticHubListener.PLASTIC_CONFIG_FILENAME
in the user's home directory. This file will be deleted automatically
under normal circumstances.configFile - file to write setup information to,
if null no file is writtenlogOut - logging output stream (may be null for no logging)warnOut - logging stream for warnings (may be null for no logging)RemoteExceptionIOExceptionpublic static void main(String[] args) throws RemoteException, IOException
RemoteExceptionIOExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.