|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.router.RouteCM
class RouteCM
Field Summary | |
---|---|
static long |
DEFAULT_EXPIRATION
Default expiration time for Route advertisements. |
static boolean |
USE_CM_DEFAULT
If true then the CM is used to persistently store route
advertisements. |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
RouteCM()
|
Method Summary | |
---|---|
protected void |
createRoute(RouteAdvertisement route)
Create a new persistent route to the cache only if we can find set of endpoint addresses |
(package private) void |
enableRouteCM(boolean enable)
toggles whether to use the RouteCM |
protected void |
flushRoute(ID peerID)
flush route adv from CM |
protected Iterator<RouteAdvertisement> |
getRouteAdv(ID peerID)
Get route advertisements from the local discovery cache. |
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
Initialize the module, passing it its peer group and advertisement. |
protected void |
publishRoute(RouteAdvertisement route)
Publish a route advertisement to the CM |
int |
startApp(String[] arg)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
protected boolean |
updateRoute(RouteAdvertisement route)
publish or update new route from the advertisement cache |
(package private) boolean |
useRouteCM()
return routeCM usage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_EXPIRATION
public static final boolean USE_CM_DEFAULT
true
then the CM is used to persistently store route
advertisements. If false
then only the in-memory route table is
used.
Constructor Detail |
---|
RouteCM()
Method Detail |
---|
public void init(PeerGroup group, ID assignedID, Advertisement impl) throws PeerGroupException
init
in interface Module
group
- The PeerGroup from which this Module can obtain services.
If this module is a Service, this is also the PeerGroup of which this
module is a service.assignedID
- Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictable by the
same module on another peer. This is normally the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.impl
- The implementation advertisement for this
Module. It is permissible to pass null if no implementation
advertisement is available. This may happen if the
implementation was selected by explicit class name rather than
by following an implementation advertisement. Modules are not
required to support that style of loading, but if they do, then
their documentation should mention it.
PeerGroupException
- This module failed to initialize.public int startApp(String[] arg)
startApp()
is completed. That is
also the opportunity to supply arbitrary arguments (mostly to
applications).
If this module is a PeerGroup
service, it may be invoked
several times depending on its return value.
startApp
in interface Module
arg
- An array of Strings forming the parameters for this
Module.
Module.START_OK
, Module.START_AGAIN_PROGRESS
,
Module.START_AGAIN_STALLED
, which indicates partial or complete
success, or any other value (negative values are
recommended for future compatibility), which indicates failure.public void stopApp()
init()
completes and should not assume that startApp()
has been
called or completed.
The Module cannot be forced to comply, but in the future
we might be able to deny it access to anything after some timeout.
stopApp
in interface Module
boolean useRouteCM()
void enableRouteCM(boolean enable)
enable
- if true
it enables use of persistent storeprotected Iterator<RouteAdvertisement> getRouteAdv(ID peerID)
peerID
- the target peer's ID.
protected void createRoute(RouteAdvertisement route)
route
- to be publishedprotected void publishRoute(RouteAdvertisement route)
route
- advertisement to be publishedprotected void flushRoute(ID peerID)
peerID
- the PeerIDprotected boolean updateRoute(RouteAdvertisement route)
route
- to be published or updated
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |