Hub
insteadpublic class HubRunner extends Object
start()
method must be called to start it up.
The main(java.lang.String[])
method can be used to launch a hub from
the command line. Use the -help
flag for more information.
Constructor and Description |
---|
HubRunner(SampXmlRpcClientFactory xClientFactory,
SampXmlRpcServerFactory xServerFactory,
HubService hub,
File lockfile)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkExternalHubAvailability()
Deprecated.
Attempts to determine whether an external hub can be started using
runExternalHub(org.astrogrid.samp.xmlrpc.HubMode) . |
String |
createSecret()
Deprecated.
Used to generate the registration password.
|
HubService |
getHub()
Deprecated.
Returns the HubService object used by this runner.
|
LockInfo |
getLockInfo()
Deprecated.
Returns the lockfile information associated with this object.
|
static void |
main(String[] args)
Deprecated.
Main method.
|
URL |
publishLockfile()
Deprecated.
Returns an HTTP URL at which the lockfile for this hub can be found.
|
static void |
runExternalHub(HubMode hubMode)
Deprecated.
Static method which will attempt to start a hub running in
an external JVM.
|
static HubRunner |
runHub(HubMode hubMode,
XmlRpcKit xmlrpc)
Deprecated.
Static method which may be used to start a SAMP hub programmatically.
|
static HubRunner |
runHub(HubMode hubMode,
XmlRpcKit xmlrpc,
String secret,
File lockfile)
Deprecated.
Static method which may be used to start a SAMP hub programmatically,
with a supplied samp.secret string.
|
static int |
runMain(String[] args)
Deprecated.
Does the work for running the
main(java.lang.String[]) method. |
void |
shutdown()
Deprecated.
Shuts down the hub and tidies up.
|
void |
start()
Deprecated.
Starts the hub and writes the lockfile.
|
public HubRunner(SampXmlRpcClientFactory xClientFactory, SampXmlRpcServerFactory xServerFactory, HubService hub, File lockfile)
lockfile
is null, no lockfile will
be written at hub startup.xClientFactory
- XML-RPC client factory implementationxServerFactory
- XML-RPC server implementationhub
- object providing hub serviceslockfile
- location to use for hub lockfile, or nullpublic void start() throws IOException
IOException
- if a hub is already running or an error occurspublic void shutdown()
public HubService getHub()
public LockInfo getLockInfo()
start()
has been called.public URL publishLockfile() throws IOException
Use this with care; publishing your lockfile means that other people can connect to your hub and potentially do disruptive things.
IOException
public String createSecret()
public static void main(String[] args) throws IOException
args
- command-line argumentsIOException
public static int runMain(String[] args) throws IOException
main(java.lang.String[])
method.
System.exit() is not called from this method.
Use "-help" flag for more information.args
- command-line argumentsIOException
public static HubRunner runHub(HubMode hubMode, XmlRpcKit xmlrpc) throws IOException
start
has been called).
If the hub mode corresponds to one of the GUI options, one of two things will happen. An attempt will be made to install an icon in the "system tray"; if this is successful, the attached popup menu will provide options for displaying the hub window and for shutting it down. If no system tray is available, the hub window will be posted directly, and the hub will shut down when this window is closed. System tray functionality is only available when running under Java 1.6 or later, and when using a suitable display manager.
hubMode
- hub modexmlrpc
- XML-RPC implementation;
automatically determined if nullIOException
public static HubRunner runHub(HubMode hubMode, XmlRpcKit xmlrpc, String secret, File lockfile) throws IOException
start
has been called).
If the hub mode corresponds to one of the GUI options, one of two things will happen. An attempt will be made to install an icon in the "system tray"; if this is successful, the attached popup menu will provide options for displaying the hub window and for shutting it down. If no system tray is available, the hub window will be posted directly, and the hub will shut down when this window is closed. System tray functionality is only available when running under Java 1.6 or later, and when using a suitable display manager.
hubMode
- hub modexmlrpc
- XML-RPC implementation;
automatically determined if nullsecret
- samp.secret string to be used for hub connection;
chosen at random if nulllockfile
- location of lockfile to write,
or null for lock to be provided by HTTPIOException
public static void runExternalHub(HubMode hubMode) throws IOException
hubMode
- hub modeIOException
checkExternalHubAvailability()
public static void checkExternalHubAvailability() throws IOException
runExternalHub(org.astrogrid.samp.xmlrpc.HubMode)
. If it can be determined that such an
attempt would fail, this method will throw an exception with
an informative message. This method succeeding is not a guarantee
that an external hub can be started successfullly.
The behaviour of this method is not expected to change over the
lifetime of a given JVM.IOException
Copyright © 2008–2024. All rights reserved.