solar.service.routing
Class ManualRoutingService
java.lang.Object
|
+--solar.service.BaseService
|
+--solar.service.routing.ManualRoutingService
- All Implemented Interfaces:
- Cache.CacheListener, EventHandler, RequestHandler, RoutingConstants, RoutingService, Service
- Direct Known Subclasses:
- DirectRoutingService
- public class ManualRoutingService
- extends BaseService
- implements RoutingService, Cache.CacheListener, RoutingConstants
The routing table is manually setup as the overlay network is being
constructed. The construction follows one simple rule: each node is
added peering with an existing one. The spanning tree resulted from
such construction forms the routing table. This service requires
a transport, a cache, and a timer services.
The valid properties are:
- interval: periodic probing interval, default as 5 seconds.
- bootstrap: the peer node to connect at startup.
- cache: the name of required cache service, default as "cache".
- timer: the name of required timer service, default as "timer".
- Version:
- $Id: ManualRoutingService.java,v 1.27 2003/10/05 18:51:01 glchen Exp $
TODO:
To prevent loop (maintain a spanning tree) during recovery phase.
- Author:
- Guanling Chen
Methods inherited from class solar.service.BaseService |
assertInited, getDependentService, getName, getServiceManager, handleDispatchUnit, handleEvent, handleRequest, hasInited, init, setInited, setName, setServiceManager, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_log
protected org.apache.log4j.Logger _log
_peer
protected Address _peer
_interval
protected long _interval
_nearby
protected Cache _nearby
_remote
protected Cache _remote
_routingName
protected java.lang.String _routingName
_transportName
protected java.lang.String _transportName
_transportAddress
protected Address _transportAddress
_timer
protected java.util.Timer _timer
_dispatch
protected DispatchService _dispatch
ManualRoutingService
public ManualRoutingService()
init
public void init()
throws ServiceException
- Description copied from interface:
Service
- Initiate the service, do not try to init dependent services here.
- Specified by:
init
in interface Service
- Overrides:
init
in class BaseService
ServiceException
initDependents
public void initDependents()
throws ServiceException
- Description copied from interface:
Service
- Initialize dependent services here.
- Specified by:
initDependents
in interface Service
- Overrides:
initDependents
in class BaseService
ServiceException
notifyObjectExpired
public void notifyObjectExpired(CachedObject co)
- Description copied from interface:
Cache.CacheListener
- Notify when an object has expired from the cache.
- Specified by:
notifyObjectExpired
in interface Cache.CacheListener
handleEvent
public void handleEvent(Event evt)
throws java.lang.Exception
- Description copied from interface:
EventHandler
- Processing an event.
- Specified by:
handleEvent
in interface EventHandler
- Overrides:
handleEvent
in class BaseService
java.lang.Exception
getNextHop
public Address getNextHop(Address dest)
throws RoutingException
- Description copied from interface:
RoutingService
- Return the next hop for the messages with specified destination.
- Specified by:
getNextHop
in interface RoutingService
RoutingException