|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.jxta.Peer
Provides generic jxta peer capablilities for cyc agents.
See www.jxta.org for more information on the Juxtaposition peer to peer infrastructure. OpenCyc uses the JXTA Resolver Service to pass messages to discovered JXTA peers. Between OpenCyc peers, the message content is a FIPA-OS envelope and an enclosed FIPA-OS message represented in XML format.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Field Summary | |
protected CycAccess |
cycAccess
CycAccess connection to the local cyc server. |
static int |
DEFAULT_VERBOSITY
The default verbosity of the solution output. |
static java.lang.String |
ECHO_HANDLER_NAME
A name to use to register the example handler with the Resolver service. |
static java.lang.String |
JXTA_CREDENTIALS
JXTA credentials |
int |
msgSerialNumber
outbound message serial number |
protected net.jxta.peergroup.PeerGroup |
peerGroup
jxta peer group |
int |
queryId
jxta ResolverService query id |
protected net.jxta.resolver.ResolverService |
resolverService
jxta ResolverService |
protected int |
verbosity
Sets verbosity of the constraint solver output. |
Constructor Summary | |
Peer()
Constructs a new Peer object. |
Method Summary | |
void |
close()
Closes the peer's local cyc connection and disconnects the peer from JXTA. |
void |
doResolverEcho(java.lang.String echoMessageText,
int waitSeconds)
Sends the echo message to peers via the ResolverService, and displays the echo responses. |
static void |
main(java.lang.String[] args)
Provides a main method for testing this class. |
java.lang.String |
nextMessageId()
Returns the next message serial number identifier. |
net.jxta.protocol.ResolverResponseMsg |
processQuery(net.jxta.protocol.ResolverQueryMsg resolverQueryMsg)
Receives the echo query from a peer, and generates the echo response. |
void |
processResponse(net.jxta.protocol.ResolverResponseMsg resolverResponseMsg)
Processes the echo response messages. |
protected void |
registerEchoService()
Registers the echo service. |
protected void |
sendQuery(java.lang.String receivingPeer,
net.jxta.protocol.ResolverQueryMsg resolverQueryMsg)
Sends the query to the given peer. |
void |
setVerbosity(int verbosity)
Sets verbosity of the output. |
protected void |
startJxta()
Starts the JXTA system and obtains a reference to the netPeerGroup. |
protected void |
test()
Tests the Peer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ECHO_HANDLER_NAME
public static final java.lang.String JXTA_CREDENTIALS
public int msgSerialNumber
public int queryId
protected net.jxta.peergroup.PeerGroup peerGroup
protected net.jxta.resolver.ResolverService resolverService
public static final int DEFAULT_VERBOSITY
protected int verbosity
protected CycAccess cycAccess
Constructor Detail |
public Peer()
Method Detail |
public void close()
public static void main(java.lang.String[] args)
args
- not usedprotected void test()
public void doResolverEcho(java.lang.String echoMessageText, int waitSeconds)
echoMessageText
- the echo messagewaitSeconds
- seconds to wait for peer responsesprotected void startJxta()
protected void registerEchoService()
protected void sendQuery(java.lang.String receivingPeer, net.jxta.protocol.ResolverQueryMsg resolverQueryMsg)
resolverQueryMsg
- the queryreceivingPeer
- the peer to which the query will be sentpublic net.jxta.protocol.ResolverResponseMsg processQuery(net.jxta.protocol.ResolverQueryMsg resolverQueryMsg) throws java.io.IOException, net.jxta.exception.NoResponseException, net.jxta.exception.DiscardQueryException, net.jxta.exception.ResendQueryException
processQuery
in interface net.jxta.resolver.QueryHandler
resolverQueryMsg
- the message which this handler processespublic void processResponse(net.jxta.protocol.ResolverResponseMsg resolverResponseMsg)
processResponse
in interface net.jxta.resolver.QueryHandler
resolverResponseMsg
- the response message to a previous query.public java.lang.String nextMessageId()
public void setVerbosity(int verbosity)
verbosity
- 0 --> quiet ... 9 -> maximum diagnostic input
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |