org.xngr.context
Class ServiceContext

java.lang.Object
  extended by org.xngr.context.ServiceContext
Direct Known Subclasses:
NodeContext, URIServiceContext

public abstract class ServiceContext
extends java.lang.Object

The context for an object, containing all the associated services and actions.

Version:
$Revision: 40 $, $Date: 2009-03-17 21:44:32 +0000 (Tue, 17 Mar 2009) $
Author:
Edwin Dankert

Method Summary
 void addServiceContextListener(ServiceContextListener listener)
          Adds a service context listener, duplicate listeners will only be added once.
 void dispose()
          Removes all listeners and the reference to the manager.
protected  void fireActionsChanged(Action action, ServiceContextEvent.Type type)
          Fire an event when an action has been changed, added or removed.
protected  void fireMarkersChanged(Marker marker, ServiceContextEvent.Type type)
          Fire an event when a marker has been changed, added or removed.
protected  void fireServicesChanged(Service service, ServiceContextEvent.Type type)
          Fire an event when a service has been changed, added or removed.
 java.util.List<Action> getActions()
           
abstract  java.util.List<Marker> getMarkers()
           
abstract  java.util.List<Service> getServices()
           
 void removeServiceContextListener(ServiceContextListener listener)
          Remove the service context listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getActions

public java.util.List<Action> getActions()
Returns:
the latest list of actions for all the services specified for the context.

getServices

public abstract java.util.List<Service> getServices()
Returns:
a list of all the services associated with the context, this is not a 'live' list.

getMarkers

public abstract java.util.List<Marker> getMarkers()
Returns:
a list of all the markers associated with the context, this is not a 'live' list.

addServiceContextListener

public void addServiceContextListener(ServiceContextListener listener)
Adds a service context listener, duplicate listeners will only be added once.

Parameters:
listener - the listener to add to the listener list.

removeServiceContextListener

public void removeServiceContextListener(ServiceContextListener listener)
Remove the service context listener.

Parameters:
listener - the listener to be removed from the listener list.

fireMarkersChanged

protected void fireMarkersChanged(Marker marker,
                                  ServiceContextEvent.Type type)
Fire an event when a marker has been changed, added or removed.

Parameters:
marker - the changed, added or removed marker.
type - the event-type.

fireServicesChanged

protected void fireServicesChanged(Service service,
                                   ServiceContextEvent.Type type)
Fire an event when a service has been changed, added or removed.

Parameters:
service - the changed, added or removed service.
type - the event-type.

fireActionsChanged

protected void fireActionsChanged(Action action,
                                  ServiceContextEvent.Type type)
Fire an event when an action has been changed, added or removed.

Parameters:
action - the changed, added or removed action.
type - the event-type.

dispose

public void dispose()
Removes all listeners and the reference to the manager.



Copyright © 2002-2009 Edwin Dankert. All Rights Reserved.