Project JXTA

net.jxta.impl.resolver
Class ResolverServiceInterface

java.lang.Object
  extended bynet.jxta.impl.resolver.ResolverServiceInterface
All Implemented Interfaces:
GenericResolver, Module, ResolverService, Service

public class ResolverServiceInterface
extends Object
implements ResolverService


Field Summary
(package private)  ResolverServiceImpl impl
           
 
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_OK
 
Constructor Summary
(package private) ResolverServiceInterface(ResolverServiceImpl theRealThing)
          Only authorized constructor
 
Method Summary
 Advertisement getImplAdvertisement()
          Returns the advertisment for that service.
 Service getInterface()
          returns an interface object that permits to use this service without having access to the real object.
 void init(PeerGroup g, ID assignedID, Advertisement impl)
          

FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement.

 QueryHandler registerHandler(String name, QueryHandler handler)
          
 SrdiHandler registerSrdiHandler(String name, SrdiHandler handler)
          
 void sendQuery(String rdvPeer, ResolverQueryMsg query)
          
 void sendResponse(String destPeer, ResolverResponseMsg response)
          
 void sendSrdi(String destPeer, ResolverSrdiMsg srdi)
          
 int startApp(String[] arg)
          

This is here for temporary class hierarchy reasons.

 void stopApp()
          

This is here for temporary class hierarchy reasons.

 QueryHandler unregisterHandler(String name)
          
 SrdiHandler unregisterSrdiHandler(String name)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

impl

ResolverServiceImpl impl
Constructor Detail

ResolverServiceInterface

ResolverServiceInterface(ResolverServiceImpl theRealThing)
Only authorized constructor

Method Detail

getInterface

public Service getInterface()
returns an interface object that permits to use this service without having access to the real object. Since THIS is already such an object, it returns itself. FIXME: it is kind of absurd to have this method part of the interface but we do not want to define two levels of Service interface just for that.

Specified by:
getInterface in interface Service
Returns:
ResolverService An interface object that implements this service and nothing more.

getImplAdvertisement

public Advertisement getImplAdvertisement()
Returns the advertisment for that service.

Specified by:
getImplAdvertisement in interface Service
Returns:
Advertisement the advertisement.

registerHandler

public QueryHandler registerHandler(String name,
                                    QueryHandler handler)

Specified by:
registerHandler in interface ResolverService

unregisterHandler

public QueryHandler unregisterHandler(String name)

Specified by:
unregisterHandler in interface ResolverService

registerSrdiHandler

public SrdiHandler registerSrdiHandler(String name,
                                       SrdiHandler handler)

Specified by:
registerSrdiHandler in interface ResolverService

unregisterSrdiHandler

public SrdiHandler unregisterSrdiHandler(String name)

Specified by:
unregisterSrdiHandler in interface ResolverService

sendQuery

public void sendQuery(String rdvPeer,
                      ResolverQueryMsg query)

Specified by:
sendQuery in interface GenericResolver

sendResponse

public void sendResponse(String destPeer,
                         ResolverResponseMsg response)

Specified by:
sendResponse in interface GenericResolver

sendSrdi

public void sendSrdi(String destPeer,
                     ResolverSrdiMsg srdi)

Specified by:
sendSrdi in interface GenericResolver

init

public void init(PeerGroup g,
                 ID assignedID,
                 Advertisement impl)

FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement. Ultimately, the API should define two levels of interfaces: one for the real service implementation and one for the interface object. Right now it feels a bit heavy to so that since the only different between the two would be init() and may-be getName().

Specified by:
init in interface Module

startApp

public int startApp(String[] arg)

This is here for temporary class hierarchy reasons. it is ALWAYS ignored. By definition, the interface object protects the real object's start/stop methods from being called

Specified by:
startApp in interface Module

stopApp

public void stopApp()

This is here for temporary class hierarchy reasons. it is ALWAYS ignored. By definition, the interface object protects the real object's start/stop methods from being called

This request is currently ignored.

Specified by:
stopApp in interface Module

JXTA J2SE