|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.resolver.ResolverServiceInterface
public class ResolverServiceInterface
Provides a controlled interface to the Resolver Service.
Field Summary |
---|
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 | |
---|---|
ResolverServiceInterface(ResolverServiceImpl theRealThing)
Only authorized constructor |
Method Summary | |
---|---|
ModuleImplAdvertisement |
getImplAdvertisement()
Returns the advertisement for this service. |
ResolverService |
getInterface()
Service objects are not manipulated directly to protect usage of the service. |
void |
init(PeerGroup g,
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 rdvPeer,
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 |
Constructor Detail |
---|
ResolverServiceInterface(ResolverServiceImpl theRealThing)
theRealThing
- reference to the implMethod Detail |
---|
public ResolverService getInterface()
getInterface
in interface Service
public void init(PeerGroup g, ID assignedID, Advertisement impl)
init
in interface Module
g
- 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.
Does nothing in the interface object.
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.
Does nothing in the interface object.
stopApp
in interface Module
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 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 void sendQuery(String rdvPeer, ResolverQueryMsg query)
sendQuery
in interface ResolverService
rdvPeer
- 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 |