Project JXTA

net.jxta.impl.resolver
Class ResolverInterface

java.lang.Object
  |
  +--net.jxta.impl.resolver.ResolverInterface

public class ResolverInterface
extends java.lang.Object
implements net.jxta.resolver.Resolver

Since:
JXTA 1.0

Field Summary
protected  java.util.Vector rendezvous
           
 
Constructor Summary
ResolverInterface(ResolverService theRealThing)
          Only authorized constructor
 
Method Summary
 net.jxta.document.Advertisement getAdvertisement()
          Returns the advertisment for that service.
 net.jxta.resolver.QueryHandler getHandler(java.lang.String name)
          gets the handler registered under the given name.
 net.jxta.service.Service getInterface()
          returns an interface object that permits to use this service without having access to the real object.
 void init(net.jxta.peergroup.PeerGroup pg, net.jxta.document.Advertisement a)
          Initialize the application FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement.
 net.jxta.resolver.QueryHandler registerHandler(java.lang.String name, net.jxta.resolver.QueryHandler handler)
          Registers the given ResolveHandler.
 void sendQuery(java.lang.String rdvPeer, net.jxta.protocol.ResolverQueryMsg query)
          try getting a response for out query
 void sendResponse(java.lang.String destPeer, net.jxta.protocol.ResolverResponseMsg response)
          send a response to a peer.
 int startApp(java.lang.String[] arg)
          This is here for temporary class hierarchy reasons.
 void stopApp()
          This is here for temporary class hierarchy reasons.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rendezvous

protected java.util.Vector rendezvous
Constructor Detail

ResolverInterface

public ResolverInterface(ResolverService theRealThing)
Only authorized constructor
Method Detail

getInterface

public net.jxta.service.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.
Returns:
Resolver An interface object that implements this service and nothing more.

getAdvertisement

public net.jxta.document.Advertisement getAdvertisement()
Returns the advertisment for that service.
Returns:
Advertisement the advertisement.
Since:
JXTA 1.0

registerHandler

public net.jxta.resolver.QueryHandler registerHandler(java.lang.String name,
                                                      net.jxta.resolver.QueryHandler handler)
Registers the given ResolveHandler.
Specified by:
registerHandler in interface net.jxta.resolver.Resolver
Parameters:
name - The name under which this handler is known.
handler - The handler.
Returns:
The previous handler registered under this name

getHandler

public net.jxta.resolver.QueryHandler getHandler(java.lang.String name)
gets the handler registered under the given name.
Specified by:
getHandler in interface net.jxta.resolver.Resolver
Parameters:
name - Handler name
Returns:
ResolveHandler

sendQuery

public void sendQuery(java.lang.String rdvPeer,
                      net.jxta.protocol.ResolverQueryMsg query)
try getting a response for out query
Parameters:
address -  
query -  

sendResponse

public void sendResponse(java.lang.String destPeer,
                         net.jxta.protocol.ResolverResponseMsg response)
send a response to a peer.
Parameters:
destPeer - is the destination of the response
response - is the response to be sent

init

public void init(net.jxta.peergroup.PeerGroup pg,
                 net.jxta.document.Advertisement a)
Initialize the application 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().
Parameters:
group - PeerGroup this application is started from
Since:
JXTA 1.0

startApp

public int startApp(java.lang.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
Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

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.

Project JXTA