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
public class GuiHubService extends BasicHubService
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 Constructor Description GuiHubService(java.util.Random random)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClientSetcreateClientSet()Factory method used to create the client set used by this hub service.javax.swing.JComponentcreateHubPanel()Creates a new component containing a display of the current hub internal state.javax.swing.JFramecreateHubWindow()Creates a new window which maintains a display of the current hub internal state.javax.swing.JMenu[]createMenus()Returns an array of menus which may be added to a window containing this service's window.protected voiddeclareMetadata(HubClient caller, java.util.Map meta)Does the work for thedeclareMetadatamethod of connections registered with this service.protected voiddeclareSubscriptions(HubClient caller, java.util.Map subscriptions)Does the work for thedeclareSubscriptionsmethod of connections registered with this service.javax.swing.ListModelgetClientListModel()Returns a ListModel containing information about clients currently registered with this hub.javax.swing.ListSelectionModelgetClientSelectionModel()Returns the selection model corresponding to this service's client list model.voidstart()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
-
-
-
-
Method Detail
-
start
public void start()
Description copied from interface:HubServiceBegin operation. TheHubService.register(org.astrogrid.samp.hub.ProfileToken)method should not be called until the hub has been started.- Specified by:
startin interfaceHubService- Overrides:
startin classBasicHubService
-
createClientSet
protected ClientSet createClientSet()
Description copied from class:BasicHubServiceFactory method used to create the client set used by this hub service.- Overrides:
createClientSetin classBasicHubService- Returns:
- client set
-
createHubPanel
public javax.swing.JComponent createHubPanel()
Creates a new component containing a display of the current hub internal state.- Returns:
- new hub viewer panel
-
createHubWindow
public javax.swing.JFrame createHubWindow()
Creates a new window which maintains a display of the current hub internal state.- Returns:
- new hub viewer window
-
declareMetadata
protected void declareMetadata(HubClient caller, java.util.Map meta) throws SampException
Description copied from class:BasicHubServiceDoes the work for thedeclareMetadatamethod of connections registered with this service.- Overrides:
declareMetadatain classBasicHubService- Parameters:
caller- clientmeta- new metadata for client- Throws:
SampException- See Also:
HubConnection.declareMetadata(java.util.Map)
-
declareSubscriptions
protected void declareSubscriptions(HubClient caller, java.util.Map subscriptions) throws SampException
Description copied from class:BasicHubServiceDoes the work for thedeclareSubscriptionsmethod of connections registered with this service.- Overrides:
declareSubscriptionsin classBasicHubService- Parameters:
caller- clientsubscriptions- new subscriptions for client- Throws:
SampException- See Also:
HubConnection.declareSubscriptions(java.util.Map)
-
getClientListModel
public javax.swing.ListModel getClientListModel()
Returns a ListModel containing information about clients currently registered with this hub.- Returns:
- list model in which each element is a
Client
-
getClientSelectionModel
public javax.swing.ListSelectionModel getClientSelectionModel()
Returns the selection model corresponding to this service's client list model.- Returns:
- list selection model for client selection
-
createMenus
public javax.swing.JMenu[] createMenus()
Returns an array of menus which may be added to a window containing this service's window.- Returns:
- menu array
-
-