| 2. Architecture | ||
|---|---|---|
| Prev | Next | |
<?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>
we can see that the builder gets a directive to
auto-start the container, and that one of the properties of the
container itself is the location of the home folder.The build process of the components does not follow the tree structure of the property sources. Instead, every factory is notified of the various states that other factories are in, and they can proceed when the correct conditions are met. For instance, the net.jp2p.chaupal.jxta.platform;NetworkManagerFactory should not start if the net.jp2p.chaupal.jxta.platform.configurator.NetworkConfiguratorFactory is not ready. Therefore the construction of the NetworkManager component is delayed until all the configuration properties have been set.
The builder therefore dispatches a number of net.jp2p.container.builder.ICompositeBuilderListener.BuilderEvents to all the factories:
<?xml version='1.0' encoding='UTF-8'?>
<jp2p-container id="org.chaupal.rdv" name="RDV" auto-start="true">
...
<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>
...
</jp2p-container>
we see that the properties of the NetworkConfigurator have been grouped
together in logical units, such as http tcp, multicast and so on.
Internally, the NetworkConfiguratorFactory is
completed by a number of property source factories that complete
the platform settings. <?xml version='1.0' encoding='UTF-8'?>
<jp2p-container id="org.chaupal.rdv" name="RDV" auto-start="true">
<network-manager clear-config="true">
<network-configurator>
<tcp>...</tcp>
<http>...</http>
<multicast enabled="true"/>
</network-configurator>
</network-manager>
</jp2p-container>
The parent-child structure of the above XML file is more a matter of convention than that the parser requires this; as long as the factories start the creation of JP2P components at the correct moment, the container should be built in the cortrect fashion. The structure does have consequences for the way the components are stored in the container (and displayed in the UI). As a result, a JP2P container tends to be flatter than than the corresponding JXTATM application.
JXTA is a registered trademark of Sun Microsystems/Oracle.
JXSE is still governed by the JXTA license, which cannot be changed. New code by Chaupal that extends/modifies JXSE is governed by the Apache License, version 2.0, and must be committed to the JP2P GitHub repository.
| Prev |
Next | |
| Chaupal User Guide | Home | 2.5 |
Hosted on GitHub Pages — Theme by orderedlist