froehlich 01/11/16 04:24:18 Added: docs/phoenix example-configuration.html Log: new doc example configuration Revision Changes Path 1.1 jakarta-avalon-site/docs/phoenix/example-configuration.html Index: example-configuration.html =================================================================== <html> <head> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Example Configuration</title> </head> <body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#023264" vlink="#023264" link="#525D76" text="#000000"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top"><a href="http://jakarta.apache.org/index.html"><img src="images/jakarta-logo.gif" border="0" vspace="0" hspace="0"></a></td><td bgcolor="#ffffff" align="left" valign="top" width="100%"><img src="images/header.gif" align="right" border="0" vspace="0" hspace="0"></td> </tr> <tr> <td colspan="2" height="2" width="100%"> <hr size="1" noshade=""> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" width="1%"></td><td nowrap="1" valign="top" width="14%"> <br> <font face="arial,helvetica,sanserif"> <br> <br> <a href="http://jakarta.apache.org/avalon"><font size="+1" color="#F3510C">Back to Avalon</font></a> <br> <br> <font size="+1" color="#000000">About</font> <br> <font size="-1"> <ul> <li> <a href="index.html"><font size="-1">Overview</font></a> </li> <li> <a href="features.html"><font size="-1">Features</font></a> </li> <li> <a href="http://jakarta.apache.org/builds/jakarta-avalon/release/phoenix"><font size="-1">Download</font></a> </li> <li> <a href="getting-started.html"><font size="-1">Getting Started</font></a> </li> <li> <a href="install.html"><font size="-1">Installation</font></a> </li> <li> <a href="todo.html"><font size="-1">Todo</font></a> </li> <li> <a href="changes.html"><font size="-1">Changes</font></a> </li> <li> <a href="api/index.html"><font size="-1">API Docs</font></a> </li> </ul> </font> <br> <br> <font size="+1" color="#000000">Administrators Guide</font> <br> <font size="-1"> <ul> <li> <a href="administrator-guide.html"><font size="-1">Overview</font></a> </li> </ul> </font> <br> <br> <font size="+1" color="#000000">Deployers Guide</font> <br> <font size="-1"> <ul> <li> <a href="deployers-guide.html"><font size="-1">Overview</font></a> </li> </ul> </font> <br> <br> <font size="+1" color="#000000">Assemblers Guide</font> <br> <font size="-1"> <ul> <li> <a href="assemblers-guide.html"><font size="-1">Overview</font></a> </li> <li> <a href="what-is-a-server-application.html"><font size="-1">What is a Server Application?</font></a> </li> <li> <a href="creating-a-server-application.html"><font size="-1">Creating a Server Application</font></a> </li> <li> <a href="config-xml-specification.html"><font size="-1">config.xml Specification</font></a> </li> <li> <a href="assembly-xml-specification.html"><font size="-1">assembly.xml Specification</font></a> </li> <li> <a href="environment-xml-specification.html"><font size="-1">environment.xml Specification</font></a> </li> </ul> </font> <br> <br> <font size="+1" color="#000000">Block Developers Guide</font> <br> <font size="-1"> <ul> <li> <a href="block-developers-guide.html"><font size="-1">Overview</font></a> </li> <li> <a href="what-is-a-block.html"><font size="-1">What is a Block?</font></a> </li> <li> <a href="what-is-a-block-listener.html"><font size="-1">What is a Block Listener?</font></a> </li> <li> <a href="blockinfo-specification.html"><font size="-1">BlockInfo Specification</font></a> </li> <li> <a href="creating-a-block.html"><font size="-1">Creating a Block</font></a> </li> </ul> </font> <br> <br> <font size="+1" color="#000000">All together</font> <br> <font size="-1"> <ul> <li> <a href="example-configuration.html"><font size="-1">Example configuration</font></a> </li> </ul> </font> <br> <br> </font></td><td align="left" valign="top" width="*"> <title>Example Configuration</title> <center> <table width="80%"> <tr> <td bgcolor="#F3DD61"> <br> <center> <b><font face="arial,helvetica,sanserif" color="#000000">Example Configuration</font></b> </center> <br> </td> </tr> </table> </center> <br> <font face="arial,helvetica,sanserif" color="#000000"></font> <br> <div align="right"> <table cellspacing="0" cellpadding="2" border="0" width="100%"> <tr> <td bgcolor="#525D76"><font face="arial,helvetica,sanserif" color="#ffffff" size="+1"><b>Introduction</b></font></td> </tr> <tr> <td><font face="arial,helvetica,sanserif" color="#000000"> <br> <p align="justify">This page contains a real production example of a block assembly and block .xinfo description based an extract from a B2B Enterprise Integration and Collaboration Platform developed by <a href="http://www.osm.net">OSM</a> </p>. <p align="justify">This example was originally a Mailing List response to a some user questions!</p> <p align="justify">The orginal post was written by Stephen McConnell from OSM.</p> </font></td> </tr> </table> </div> <br> <div align="right"> <table cellspacing="0" cellpadding="2" border="0" width="100%"> <tr> <td bgcolor="#525D76"><font face="arial,helvetica,sanserif" color="#ffffff" size="+1"><b>The example</b></font></td> </tr> <tr> <td><font face="arial,helvetica,sanserif" color="#000000"> <br> <p align="justify">First we start with a manifest file in a jar the contains a block. The manifest contains the declaration of the path to the block implementation. This path is also used to resolve the .xinfo file. In this case the <code>.xinfo</code> description will be located under <code>org/apache/acme/hub/gateway/pki/PKIProcessServer.xinfo</code> </p> <div align="center"> <table cellspacing="2" cellpadding="2" border="1"> <tr> <td> <pre> Manifest-Version: 1.0 Created-By: ACME Corporation Name: org/apache/acme/hub/gateway/pki/PKIProcessServer.class Avalon-Block: true </pre> </td> </tr> </table> </div> <p align="justify">The <code>.xinfo</code> file contains a description of a reasonably simple block that serves as a factory for business processes that handle PKI certification requests:</p> <div align="center"> <table cellspacing="2" cellpadding="2" border="1"> <tr> <td> <pre> <?xml version="1.0"?> <blockinfo> <block> <version>1.0</version> </block> <services> <!-- This block could be declaring several services that it supports. Unlike a Java interface, the service includes a version tag. So it's possible for a block to have several services with possibly different versions. If there are multiple services then just declare them with multiple service entries here. Phoenix will make sure that the class with the same name as the .xinfo file implements these interfaces (if it doesn't then Phoenix will terminate). --> <service name="org.apache.acme.hub.gateway.FactoryService" version="1.0" /> </services> <!-- So far, we have the definition of a class that supports possibly multiple version interfaces. But things get much more interesting, when we think about the services that this block requires in order to function properly. That's partly handled by the dependencies element and partly by the assembly.xml file (which I'll explain later). In the following dependency example there are seven "service" dependencies (i.e. 7 versioned interface dependencies that must be fulfilled for this block to function. --> <dependencies> <!-- Each dependency contains a declaration of a role name and a service interface and a version that can fulfil that role. The dependency does not say anything about where that service implementation should come from (that's the job the assembly.xml file). The role element is simply the label used in the implementation of your block configure method that distinguishes a particular instance of the service. --> <dependency> <role>GATEWAY</role> <service name="org.apache.acme.hub.gateway.GatewayContext" version="1.0"/> </dependency> <!-- This dependency declaration simply states that in order to function, this block requires a <service/> (in this case a wrapper to a CORBA ORB version 2.4) and that the block implementation will lookup this service using the "ORB" keyword. --> <dependency> <role>ORB</role> <service name="org.apache.acme.hub.gateway.ORBService" version="2.4"/> </dependency> <!-- This dependency declares a requirement for a PSS (Persistent State Service) Storage Home. --> <dependency> <role>PSS</role> <service name="org.apache.acme.hub.gateway.ProcessorStorageHomeService" version="1.0"/> </dependency> <!-- This dependency enables the block to establish a call-back to the block supplying the service. This block uses the Registry interface to publish a business process description to a higher level manager. --> <dependency> <role>REGISTRY</role> <service name="org.apache.acme.hub.gateway.Registry" version="1.0"/> </dependency> <!-- etc. --> <dependency> <role>DOMAIN</role> <service name="org.apache.acme.hub.gateway.DomainService" version="1.0"/> </dependency> <dependency> <role>RANDOM</role> <service name="org.apache.acme.hub.gateway.RandomService" version="1.0"/> </dependency> <dependency> <role>CLOCK</role> <service name="org.apache.acme.service.time.TimeService" version="1.0"/> </dependency> </dependencies> </blockinfo> </pre> </td> </tr> </table> </div> <p align="justify">Next is the block declaration (an extract from an <code>assembly.xml</code> file). This enables the declaration of WHERE the services are coming from. I.e. you may have a system with many blocks and even the potential for matching services available from more that one block. The class attribute provides the link to the <code>.xinfo</code> file and the implementation class. The name is used a key within the <code>assembly.xml</code> file when wiring things together. E.g. the provide element references a block by its name - and declares that the named block will serve as the provider of the service. The role attribute matches the role element in the <code>.xinfo</code> dependency declaration.</p> The name attribute also serves a the key to lookup a configuration element in the application configuration.xml file. <div align="center"> <table cellspacing="2" cellpadding="2" border="1"> <tr> <td> <pre> <?xml version="1.0"?> <assembly> <!-- other assembly information here --> <!-- Certification Request Processor Factory --> <block class="org.apache.acme.pki.process.CertificationRequestServer" name="certification" > <provide name="gateway" role="GATEWAY"/> <provide name="gateway" role="ORB"/> <provide name="gateway" role="PSS"/> <provide name="gateway" role="DOMAIN"/> <provide name="gateway" role="RANDOM"/> <provide name="pki" role="REGISTRY"/> <provide name="time" role="CLOCK"/> </block> <!-- more assembly information here --> </assembly> </pre> </td> </tr> </table> </div> <div align="right"> <table cellspacing="0" cellpadding="2" border="0" width="99%"> <tr> <td bgcolor="#525D76"><font face="arial,helvetica,sanserif" color="#ffffff" size="+0"><b></b></font></td> </tr> <tr> <td><font face="arial,helvetica,sanserif" color="#000000"> <br> </font></td> </tr> </table> </div> <br> <div align="right"> <table cellspacing="0" cellpadding="2" border="0" width="99%"> <tr> <td bgcolor="#525D76"><font face="arial,helvetica,sanserif" color="#ffffff" size="+0"><b>Why this seperation?</b></font></td> </tr> <tr> <td><font face="arial,helvetica,sanserif" color="#000000"> <br> </font></td> </tr> </table> </div> <br> <ul> <li>It forces structure and separation</li> <li>It provides a way of managing possibly multiple versions of the same interface in a single environment</li> <li>It enables explicit declaration of the source of service provision</li> </ul> <p align="justify">For example you can have multiple blocks providing a TimeService. One of those blocks uses an external time reference while the others use a local time reference. The local time block declare dependencies on the external source time block and is periodically synchronised. In this example all of the TimeService services are exposing the same interface, same version (i.e. same service), but the decision as to which service is the provider to another can be explicitly controlled. While the time example is perhaps trivial, there are significant policy security implications related to service provider selection.</p> </font></td> </tr> </table> </div> <br> </td> </tr> </table> <br> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td> <hr size="1" noshade=""> </td> </tr> <tr> <td align="center"><font color="#525D76" size="-1" face="arial,helvetica,sanserif"><i> Copyright ©1999-2001 by the Apache Software Foundation. All Rights Reserved. </i></font></td> </tr> </table> </body> </html>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
