Package org.astrogrid.samp.gui
Class GuiHubService
java.lang.Object
org.astrogrid.samp.hub.BasicHubService
org.astrogrid.samp.gui.GuiHubService
- All Implemented Interfaces:
HubService
- Direct Known Subclasses:
MessageTrackerHubService
BasicHubService subclass which provides a GUI window displaying hub
status as well as the basic hub services.
- Since:
- 16 Jul 2008
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class org.astrogrid.samp.hub.BasicHubService
MAX_TIMEOUT, MAX_WAITERS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientSet
Factory method used to create the client set used by this hub service.Creates a new component containing a display of the current hub internal state.Creates a new window which maintains a display of the current hub internal state.JMenu[]
Returns an array of menus which may be added to a window containing this service's window.protected void
declareMetadata
(HubClient caller, Map meta) Does the work for thedeclareMetadata
method of connections registered with this service.protected void
declareSubscriptions
(HubClient caller, Map subscriptions) Does the work for thedeclareSubscriptions
method of connections registered with this service.Returns a ListModel containing information about clients currently registered with this hub.Returns the selection model corresponding to this service's client list model.void
start()
Begin operation.Methods inherited from class org.astrogrid.samp.hub.BasicHubService
call, callAll, callAndWait, createClient, createConnection, createHubMessageHandlers, disconnect, disconnectAll, getClientSet, getIdComparator, getMetadata, getRegisteredClients, getServiceConnection, getSubscribedClients, getSubscriptions, isHubRunning, notify, notifyAll, register, reply, setCallable, shutdown, unregister
-
Constructor Details
-
GuiHubService
Constructor.- Parameters:
random
- random number generator used for message tags etc
-
-
Method Details
-
start
public void start()Description copied from interface:HubService
Begin operation. TheHubService.register(org.astrogrid.samp.hub.ProfileToken)
method should not be called until the hub has been started.- Specified by:
start
in interfaceHubService
- Overrides:
start
in classBasicHubService
-
createClientSet
Description copied from class:BasicHubService
Factory method used to create the client set used by this hub service.- Overrides:
createClientSet
in classBasicHubService
- Returns:
- client set
-
createHubPanel
Creates a new component containing a display of the current hub internal state.- Returns:
- new hub viewer panel
-
createHubWindow
Creates a new window which maintains a display of the current hub internal state.- Returns:
- new hub viewer window
-
declareMetadata
Description copied from class:BasicHubService
Does the work for thedeclareMetadata
method of connections registered with this service.- Overrides:
declareMetadata
in classBasicHubService
- Parameters:
caller
- clientmeta
- new metadata for client- Throws:
SampException
- See Also:
-
declareSubscriptions
Description copied from class:BasicHubService
Does the work for thedeclareSubscriptions
method of connections registered with this service.- Overrides:
declareSubscriptions
in classBasicHubService
- Parameters:
caller
- clientsubscriptions
- new subscriptions for client- Throws:
SampException
- See Also:
-
getClientListModel
Returns a ListModel containing information about clients currently registered with this hub.- Returns:
- list model in which each element is a
Client
-
getClientSelectionModel
Returns the selection model corresponding to this service's client list model.- Returns:
- list selection model for client selection
-
createMenus
Returns an array of menus which may be added to a window containing this service's window.- Returns:
- menu array
-