Tutorials
Jini Example
Jxta Example
Web Services
Related
Jxta
Jini
Web Services
For More Info
From P2P to Web Services and Grids: Peers in a Client/Server World
Ian J. Taylor, 2004
Publisher: Springer
ISBN: 1-85233-869-5
|
Jxta Pipe Example
This a two part simple example primarily to
illustrate how to create a InputPipe, OutputPipeListener, and send and receive
messages. Refer to the README for running steps.
- PipeListener.java: JXTA application that creates an input pipe instance and waits
forever for messages to run it
- PipeExample.java: an OutputPipeListener
is created, and one attempt is made to resolve the InputPipe. Once it has been
resolved, a message (msg) is sent through the pipe.
Running
You have to run in the following order:
- run the PipeListener class first by using run3.bat
- run the PipeExample class by using run4.bat
The PipeListener and the PipeExample need
to be run in different directories. This is
because you will be running both on the same machine and will need to configure
each node to use a different TCP port. The default is 9701 – so set the PipeListener to use this port.
For the PipeExample, use 9702. The batch file run4.bat automatically
creates a directory to run the PipeExample in and
places the necessary class and resource files in this directory ready for
execution. The batch file looks like this:
mkdir RunPipeExample
copy PipeExample.class RunPipeExample
copy pipexample.adv RunPipeExample
cd RunPipeExample
set LIB_DIR=..\lib
java -classpath .\;%LIB_DIR%\jxta.jar;%LIB_DIR%\log4j.jar;%LIB_DIR%\jxtasecurity.jar;
%LIB_DIR%\jxtaptls.jar;%LIB_DIR%\minimalBC.jar;%LIB_DIR%\cryptix32.jar;
%LIB_DIR%\cryptix-asn1.jar PipeExample
Adapted From:
Pipe
Example by Mohamed Abdelaziz (jxta.org: hamada)
The Source Code can be found here:
Back to Trail
|