solar.service.routing
Class DirectRoutingService
java.lang.Object
|
+--solar.service.BaseService
|
+--solar.service.routing.ManualRoutingService
|
+--solar.service.routing.DirectRoutingService
- All Implemented Interfaces:
- Cache.CacheListener, EventHandler, RequestHandler, RoutingConstants, RoutingService, Service
- public class DirectRoutingService
- extends ManualRoutingService
The direct routing service uses same routing contruction as
ManualRoutingService, only to gain knowledge of all live hosts.
It does not attempt to route using the knowledge, but simply route
on IP. The services exchange information about each other so each
node eventually knows all other live nodes in the network. This
service requires a transport, a cache and a timer services.
The valid properties are:
- rtable: whether to use a daemon to build routing table.
- 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: DirectRoutingService.java,v 1.18 2003/10/05 18:51:01 glchen Exp $
- Author:
- Guanling Chen
|
Field Summary |
protected boolean |
_rtable
|
|
Method Summary |
Address |
getNextHop(Address dest)
Return the next hop for the messages with specified destination. |
void |
init()
Initiate the service, do not try to init dependent services here. |
void |
initDependents()
Initialize dependent services here. |
| 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 |
_rtable
protected boolean _rtable
DirectRoutingService
public DirectRoutingService()
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 ManualRoutingService
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 ManualRoutingService
ServiceException
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- Overrides:
getNextHop in class ManualRoutingService
RoutingException