|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.starlink.plastic.PlasticUtils
Utility methods for use with the PLASTIC tool interop protocol.
Field Summary | |
static String |
PLASTIC_FILE
Location in the user's home directory of the PLASTIC rendezvous file. |
static String |
PLASTIC_VERSION
Version of PLASTIC interface implemented. |
static boolean |
WARN_ABOUT_NOSUCHELEMENTEXCEPTIONS
True if spurious java.util.NoSuchElementExceptions should be flagged. |
static String |
XMLRPC_PREFIX
Prefix for XML-RPC "perform" method. |
Method Summary | |
static URI |
createURI(String uri)
Convenience method to turn a String into a URI without throwing any pesky checked exceptions. |
static org.apache.xmlrpc.XmlRpcClient |
createXmlRpcClient(URL url)
Factory method for obtaining a new XmlRpcClient. |
static Icon |
getBroadcastIcon()
Returns an icon which conveys the idea of one-to-many transmission. |
static PlasticHubListener |
getLocalHub()
Returns the PLASTIC hub running on the local host. |
static Properties |
getPlasticProperties()
Returns the properties set which is stored in PLASTIC_FILE . |
static String |
getPlasticProperty(String key)
Returns the value of a given property defined in the PLASTIC_FILE file. |
static ApplicationItem[] |
getRegisteredApplications(PlasticHubListener hub)
Returns an array of ApplicationItem objects representing the applications currently registered with a given hub. |
static Icon |
getSendIcon()
Returns an icon which conveys the idea of point-to-point transmission. |
static URL |
getXmlRpcUrl()
Returns the URL to use for the hub's XML-RPC server. |
static boolean |
isHubRunning()
Attempts to determine if a plastic hub is currently running. |
static PlasticConnection |
registerRMI(PlasticApplication app)
Registers a PlasticApplication with the current hub using RMI-type communication. |
static PlasticConnection |
registerXMLRPC(PlasticApplication app)
Registers a PlasticApplication with the current hub using XML-RPC type communication. |
static void |
singleRequestAsynch(String name,
URI message,
List args)
Sends a single asynchronous message to the hub without registering for callback. |
static void |
startExternalHub(boolean gui)
Attempts to start a hub running in an external process. |
static Object |
targetRequest(String name,
URI message,
List args,
URI target)
Gets the result of a request to a single registered application without registering for callback. |
static Object |
targetRequest(URI sender,
URI message,
List args,
URI target)
Gets the result of a request to a single registered application using an existing connection to the hub. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PLASTIC_FILE
public static final String PLASTIC_VERSION
public static final String XMLRPC_PREFIX
public static boolean WARN_ABOUT_NOSUCHELEMENTEXCEPTIONS
Method Detail |
public static PlasticHubListener getLocalHub() throws IOException
IOException
public static URL getXmlRpcUrl() throws IOException
IOException
public static boolean isHubRunning()
public static Properties getPlasticProperties() throws IOException
PLASTIC_FILE
.
IOException
public static String getPlasticProperty(String key) throws IOException
PLASTIC_FILE
file. If it does not exist or has no value
an IOException is thrown. Null will not be returned.
key
- property key
IOException
public static PlasticConnection registerRMI(PlasticApplication app) throws IOException
app
- application to register
app
registered
with the hub
IOException
- if the application could not registerpublic static PlasticConnection registerXMLRPC(PlasticApplication app) throws IOException
app
- application to register
IOException
public static Object targetRequest(String name, URI message, List args, URI target) throws IOException
name
- application namemessage
- message IDargs
- message argumentstarget
- application ID of a registered application to which
the request is to be made
IOException
public static Object targetRequest(URI sender, URI message, List args, URI target) throws IOException
sender
- application ID of registered listener from which
the request will be mademessage
- message IDargs
- message argumentstarget
- application ID of a registered application to which
the request is to be made
IOException
public static void singleRequestAsynch(String name, URI message, List args) throws IOException
name
- application namemessage
- message IDargs
- message arguments
IOException
public static void startExternalHub(boolean gui) throws IOException
gui
- true iff a window representing the hub is to be posted
IOException
public static ApplicationItem[] getRegisteredApplications(PlasticHubListener hub)
hub
- the hub
hub
public static URI createURI(String uri)
uri
- URI text
IllegalArgumentException
- if uri doesn't look like a URIpublic static org.apache.xmlrpc.XmlRpcClient createXmlRpcClient(URL url)
url
- XML-RPC server URL
url
public static Icon getSendIcon()
public static Icon getBroadcastIcon()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |