|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.starlink.plastic.MinimalHub uk.ac.starlink.plastic.PlasticHub
Plastic hub implementation which provides some user friendly featuers
such as logging, message validation,
a ListModel
which keeps track of
registered applications, and a main(java.lang.String[])
method to start it up.
Field Summary |
Fields inherited from interface org.votech.plastic.PlasticHubListener |
PLASTIC_CONFIG_FILENAME, PLASTIC_RMI_PORT_KEY, PLASTIC_VERSION_KEY, PLASTIC_XMLRPC_URL_KEY |
Constructor Summary | |
PlasticHub(ServerSet servers)
Constructs a new hub, given running server objects. |
Method Summary | |
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. |
Methods inherited from class uk.ac.starlink.plastic.MinimalHub |
execute, finalize, getHubId, getMessageRegisteredIds, getRegisteredIds, pollForMessages, registerNoCallBack, registerPolling, registerRMI, registerXMLRPC, request, requestAsynch, requestToSubset, requestToSubsetAsynch |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlasticHub(ServerSet servers) throws RemoteException
servers
- object encapsulating listening serversMethod Detail |
public void unregister(URI id)
PlasticHubListener
unregister
in interface PlasticHubListener
unregister
in class MinimalHub
public String getName(URI id)
PlasticHubListener
getName
in interface PlasticHubListener
getName
in class MinimalHub
public List getUnderstoodMessages(URI id)
PlasticHubListener
getUnderstoodMessages
in interface PlasticHubListener
getUnderstoodMessages
in class MinimalHub
public ListModel getApplicationListModel()
public void stop()
MinimalHub
stop
in class MinimalHub
public 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)
IOException
RemoteException
public 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)
RemoteException
IOException
public static void main(String[] args) throws RemoteException, IOException
RemoteException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |