org.astrogrid.samp.gui
Class GuiHubService

java.lang.Object
  extended by org.astrogrid.samp.hub.BasicHubService
      extended by org.astrogrid.samp.gui.GuiHubService
All Implemented Interfaces:
ClientProfile, 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
GuiHubService(Random random)
          Constructor.
 
Method Summary
protected  ClientSet createClientSet()
          Factory method used to create the client set used by this hub service.
 JComponent createHubPanel()
          Creates a new component containing a display of the current hub internal state.
 JFrame createHubWindow()
          Creates a new window which maintains a display of the current hub internal state.
protected  void declareMetadata(HubClient caller, Map meta)
          Does the work for the declareMetadata method of connections registered with this service.
protected  void declareSubscriptions(HubClient caller, Map subscriptions)
          Does the work for the declareSubscriptions method of connections registered with this service.
 ListModel getClientListModel()
          Returns a ListModel containing information about clients currently registered with this hub.
 void start()
          Begin operation.
 
Methods inherited from class org.astrogrid.samp.hub.BasicHubService
call, callAll, callAndWait, createClient, createConnection, disconnect, getClientSet, getIdComparator, getMetadata, getRegisteredClients, getServiceConnection, getSubscribedClients, getSubscriptions, isHubRunning, notify, notifyAll, register, reply, setCallable, shutdown, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiHubService

public GuiHubService(Random random)
Constructor.

Parameters:
random - random number generator used for message tags etc
Method Detail

start

public void start()
Description copied from interface: HubService
Begin operation. The HubService.register() method should not be called until the hub has been started.

Specified by:
start in interface HubService
Overrides:
start in class BasicHubService

createClientSet

protected ClientSet createClientSet()
Description copied from class: BasicHubService
Factory method used to create the client set used by this hub service.

Overrides:
createClientSet in class BasicHubService
Returns:
client set

createHubPanel

public JComponent createHubPanel()
Creates a new component containing a display of the current hub internal state.

Returns:
new hub viewer panel

createHubWindow

public 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,
                               Map meta)
                        throws SampException
Description copied from class: BasicHubService
Does the work for the declareMetadata method of connections registered with this service.

Overrides:
declareMetadata in class BasicHubService
Parameters:
caller - client
meta - new metadata for client
Throws:
SampException
See Also:
HubConnection.declareMetadata(java.util.Map)

declareSubscriptions

protected void declareSubscriptions(HubClient caller,
                                    Map subscriptions)
                             throws SampException
Description copied from class: BasicHubService
Does the work for the declareSubscriptions method of connections registered with this service.

Overrides:
declareSubscriptions in class BasicHubService
Parameters:
caller - client
subscriptions - new subscriptions for client
Throws:
SampException
See Also:
HubConnection.declareSubscriptions(java.util.Map)

getClientListModel

public ListModel getClientListModel()
Returns a ListModel containing information about clients currently registered with this hub.

Returns:
list model in which each element is a Client


Copyright © 2008-2011 AstroGrid. All Rights Reserved.