edu.ntnu.cikmr.services.context
Class ContextService

java.lang.Object
  extended by edu.ntnu.cikmr.services.AbstractService
      extended by edu.ntnu.cikmr.services.context.ContextService
All Implemented Interfaces:
PeerListener, Service, ServiceListener, java.util.EventListener

public class ContextService
extends AbstractService
implements ServiceListener, PeerListener


Field Summary
 
Fields inherited from class edu.ntnu.cikmr.services.AbstractService
listenerList
 
Constructor Summary
ContextService()
           
 
Method Summary
 void addContextItem(java.lang.String id, Relationship r, ContextItem item)
           
 void addEntity(Entity e)
           
 void addListener()
           
 void contextChanged(ContextEvent contextEvent)
           
 Entity[] getAllEntitiesByType(java.lang.Class c)
           
 Entity[] getAllLocalEntitiesByType(java.lang.Class c)
           
 Entity[] getAllRemoteEntitiesByType(java.lang.Class c)
           
 void init(ServiceManager manager)
           
 boolean isStarted()
           
 void peerAdded(PeerEvent e)
           
 void peerRemoved(PeerEvent e)
           
 void serviceStarted(ServiceEvent e)
           
 void serviceStopped(ServiceEvent e)
           
 void start(PeerGroup peerGroup)
           
 void stop()
           
 
Methods inherited from class edu.ntnu.cikmr.services.AbstractService
addServiceListener, fireServiceStarted, fireServiceStopped, removeServiceListner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextService

public ContextService()
Method Detail

addContextItem

public void addContextItem(java.lang.String id,
                           Relationship r,
                           ContextItem item)

addEntity

public void addEntity(Entity e)

getAllEntitiesByType

public Entity[] getAllEntitiesByType(java.lang.Class c)

getAllLocalEntitiesByType

public Entity[] getAllLocalEntitiesByType(java.lang.Class c)

getAllRemoteEntitiesByType

public Entity[] getAllRemoteEntitiesByType(java.lang.Class c)

init

public void init(ServiceManager manager)
Specified by:
init in interface Service

addListener

public void addListener()

start

public void start(PeerGroup peerGroup)
           throws java.io.IOException
Specified by:
start in interface Service
Throws:
java.io.IOException

stop

public void stop()
          throws java.io.IOException
Specified by:
stop in interface Service
Throws:
java.io.IOException

isStarted

public boolean isStarted()
Specified by:
isStarted in interface Service

serviceStarted

public void serviceStarted(ServiceEvent e)
Specified by:
serviceStarted in interface ServiceListener

serviceStopped

public void serviceStopped(ServiceEvent e)
Specified by:
serviceStopped in interface ServiceListener

peerAdded

public void peerAdded(PeerEvent e)
Specified by:
peerAdded in interface PeerListener

peerRemoved

public void peerRemoved(PeerEvent e)
Specified by:
peerRemoved in interface PeerListener

contextChanged

public void contextChanged(ContextEvent contextEvent)