|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.resolver.ResolverServiceImpl
public class ResolverServiceImpl
Implements the ResolverService
using the standard
JXTA Endpoint Resolver Protocol (ERP).
ResolverService
,
JXTA Protocols Specification : Endpoint Resolver ProtocolNested Class Summary | |
---|---|
(package private) static class |
ResolverServiceImpl.CurrentCredential
Encapsulates current Membership Service credential. |
(package private) class |
ResolverServiceImpl.FailureListener
Listener to find bad destinations and clean srdi tables for them. |
Field Summary | |
---|---|
(package private) ResolverServiceImpl.CurrentCredential |
currentCredential
The current Membership service default credential. |
static String |
inQueNameShort
Resolver response endpoint postfix |
(package private) net.jxta.impl.resolver.ResolverServiceImpl.CredentialListener |
membershipCredListener
|
static String |
outQueNameShort
Resolver query endpoint postfix |
static String |
srdiQueNameShort
Resolver srdi endpoint postfix |
Fields inherited from interface net.jxta.resolver.ResolverService |
---|
OK, Repropagate |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
ResolverServiceImpl()
|
Method Summary | |
---|---|
QueryHandler |
getHandler(String name)
given a name returns the query handler associated with it |
ModuleImplAdvertisement |
getImplAdvertisement()
Returns the advertisement for this service. |
ResolverService |
getInterface()
Service objects are not manipulated directly to protect usage of the service. |
SrdiHandler |
getSrdiHandler(String name)
given a name returns the srdi handler associated with it |
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
Initialize the module, passing it its peer group and advertisement. |
QueryHandler |
registerHandler(String name,
QueryHandler handler)
Registers a given QueryHandler, returns the previous handler registered under this name. |
SrdiHandler |
registerSrdiHandler(String name,
SrdiHandler handler)
Registers a given SrdiHandler, returns the previous handler registered under this name. |
void |
sendQuery(String destPeer,
ResolverQueryMsg query)
Sends a resolver query. |
void |
sendResponse(String destPeer,
ResolverResponseMsg response)
Send a resolver response. |
void |
sendSrdi(String destPeer,
ResolverSrdiMsg srdi)
Send an SRDI message. |
int |
startApp(String[] arg)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
QueryHandler |
unregisterHandler(String name)
Unregisters a given QueryHandler, returns the previous handler registered under this name. |
SrdiHandler |
unregisterSrdiHandler(String name)
Unregisters a given SrdiHandler, returns the previous handler registered under this name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String outQueNameShort
public static final String inQueNameShort
public static final String srdiQueNameShort
ResolverServiceImpl.CurrentCredential currentCredential
final net.jxta.impl.resolver.ResolverServiceImpl.CredentialListener membershipCredListener
Constructor Detail |
---|
public ResolverServiceImpl()
Method Detail |
---|
public void init(PeerGroup group, ID assignedID, Advertisement impl)
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.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
public ResolverService getInterface()
getInterface
in interface Service
public ModuleImplAdvertisement getImplAdvertisement()
getImplAdvertisement
in interface Service
ModuleImplAdvertisement
.public QueryHandler registerHandler(String name, QueryHandler handler)
registerHandler
in interface ResolverService
name
- The name under which this handler is to be registered.handler
- The handler.
public QueryHandler unregisterHandler(String name)
unregisterHandler
in interface ResolverService
name
- The name of the handler to unregister.
public QueryHandler getHandler(String name)
name
- the handler to lookup
public SrdiHandler registerSrdiHandler(String name, SrdiHandler handler)
registerSrdiHandler
in interface ResolverService
name
- The name under which this handler is to be registered.handler
- The handler.
public SrdiHandler unregisterSrdiHandler(String name)
unregisterSrdiHandler
in interface ResolverService
name
- The name of the handler to unregister.
public SrdiHandler getSrdiHandler(String name)
name
- the handler to lookup
public void sendQuery(String destPeer, ResolverQueryMsg query)
sendQuery
in interface ResolverService
destPeer
- The destination peer of the query or null if
the query is to be propagated.query
- The query to match.public void sendResponse(String destPeer, ResolverResponseMsg response)
sendResponse
in interface ResolverService
destPeer
- The destination peer of the response or null if
the response is to be propagated.response
- The response to be sent.public void sendSrdi(String destPeer, ResolverSrdiMsg srdi)
sendSrdi
in interface ResolverService
destPeer
- is the destination of the SRDI message.srdi
- is the SRDI message to be sent.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |