1. Introduction | ||
---|---|---|
Prev | Next |
These two features make a Chaupal JP2P project! Behind the scenes, the activator is busy checking the OSGI container for bundles that contain the resources that are defined in the jp2p XML file, and when it finds all the required resource, it creates a jp2p container that will hold these resources.
If you are a seasoned JXTA developer, you may also notice that the project actually represents a JXTATM Rendezvous Service.In Chaupal, the functionality provided by JXTATM is transformed in a format that the Chaupal JP2P container can understand (and parse). In fact, the Chaupal JP2P container is little more than a light-weight OSGI wrapper around the core JXTATM functionality. You may wonder why we decided to take this approach and not embed the JXTATM classes in a more straightforward fashion.
There are a number of reasons for doing so:
<?xml version='1.0' encoding='UTF-8'?> <jp2p-container id="org.chaupal.rdv" name="RDV" auto-start="true"> <properties> <home-folder>${user.home}/.jxta/${bundle-id}</home-folder> </properties> <persistence-service context="chaupal"/> <network-manager clear-config="true"> <properties> <config-mode>RENDEZVOUS</config-mode> <peer-id create="true" persist="true"/> </properties> <network-configurator> <properties></properties> <tcp> <properties> <port>9715</port> <incoming-status>true</incoming-status> <outgoing-status>true</outgoing-status> </properties> </tcp> <http> <properties> <port>8081</port> <incoming-status>true</incoming-status> <outgoing-status>true</outgoing-status> </properties> </http> <multicast enabled="true"/> </network-configurator> </network-manager> </jp2p-container>
JXTA developers will immediately see the familiar outlines of a
very common Rendezvous configuration. In fact, it is one of the
first examples which is presented in the book Practical
JXTA II by Jérôme Verstrynge. However, with a few
modifications! Let's examine the code above a bit closer:
<?xml version='1.0' encoding='UTF-8'?> <jp2p-container id="org.chaupal.rdv" name="RDV" auto-start="true"> <properties> <home-folder>${user.home}/.jxta/${bundle-id}</home-folder> </properties> <persistence-service context="chaupal"/> </jp2p-container>The first few lines of the jp2p file (you can actually run this without problems, try it!) has no relationships with any JXTATM code whatsoever. The code tells the system to:
It may be clear that JXTATMs NetworkConfigurator will use this location, so it is no longer available there. Instead, Chaupal takes care that the load and save configuration of the NetworkConfigurator use the locations provided by the configuration file. The other settings are rather straightforward for JXTATMdevelopers. If you are new to JXTATM, you can read the section "Jack the Rendezvous peer" in Jérôme Verstrynge's book. You will see that the JP2P configuration file is a representation of the settings that are coded there.
Prev | Next | |
Chaupal User Guide | Home | 1.2 Setting up the Eclipse IDE and Chaupal Tools |
Hosted on GitHub Pages � Theme by orderedlist