You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemind.apache.org by hl...@apache.org on 2004/08/09 03:10:38 UTC
cvs commit: jakarta-hivemind/examples build.xml
hlship 2004/08/08 18:10:38
Modified: examples/src/documentation/content/xdocs/hivemind-examples
calc.xml panorama.xml
examples/src/descriptor/META-INF examples.xml
examples build.xml
Log:
More documentation updates re: removal of SDL.
This should be the last such changes.
Revision Changes Path
1.3 +26 -38 jakarta-hivemind/examples/src/documentation/content/xdocs/hivemind-examples/calc.xml
Index: calc.xml
===================================================================
RCS file: /home/cvs/jakarta-hivemind/examples/src/documentation/content/xdocs/hivemind-examples/calc.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- calc.xml 26 Jul 2004 19:07:11 -0000 1.2
+++ calc.xml 9 Aug 2004 01:10:37 -0000 1.3
@@ -98,44 +98,32 @@
The Registry is built from the following module deployment descriptor:
</p>
-<source><![CDATA[module (id=examples version="1.0.0")
-{
- service-point (id=Adder interface=org.apache.hivemind.examples.Adder)
- {
- create-instance (class=org.apache.hivemind.examples.impl.AdderImpl)
- interceptor (service-id=hivemind.LoggingInterceptor)
- }
-
- service-point (id=Subtracter interface=org.apache.hivemind.examples.Subtracter)
- {
- create-instance (class=org.apache.hivemind.examples.impl.SubtracterImpl)
- interceptor (service-id=hivemind.LoggingInterceptor)
- }
-
- service-point (id=Multiplier interface=org.apache.hivemind.examples.Multiplier)
- {
- create-instance (class=org.apache.hivemind.examples.impl.MultiplerImpl)
- interceptor (service-id=hivemind.LoggingInterceptor)
- }
-
- service-point (id=Divider interface=org.apache.hivemind.examples.Divider)
- {
- create-instance (class=org.apache.hivemind.examples.impl.DividerImpl)
- interceptor (service-id=hivemind.LoggingInterceptor)
- }
-
- service-point (id=Calculator interface=org.apache.hivemind.examples.Calculator)
- {
- invoke-factory (service-id=hivemind.BuilderFactory)
- {
- construct (class=org.apache.hivemind.examples.impl.CalculatorImpl)
-
- // Note: services are autowired (as long as there's exactly one
- // service-point implementing the interface).
- }
- interceptor (service-id=hivemind.LoggingInterceptor)
- }
-}]]></source>
+<source><![CDATA[
+<?xml version="1.0"?>
+<module id="examples" version="1.0.0">
+ <service-point id="Adder" interface="org.apache.hivemind.examples.Adder">
+ <create-instance class="org.apache.hivemind.examples.impl.AdderImpl"/>
+ <interceptor service-id="hivemind.LoggingInterceptor"/>
+ </service-point>
+ <service-point id="Subtracter" interface="org.apache.hivemind.examples.Subtracter">
+ <create-instance class="org.apache.hivemind.examples.impl.SubtracterImpl"/>
+ <interceptor service-id="hivemind.LoggingInterceptor"/>
+ </service-point>
+ <service-point id="Multiplier" interface="org.apache.hivemind.examples.Multiplier">
+ <create-instance class="org.apache.hivemind.examples.impl.MultiplerImpl"/>
+ <interceptor service-id="hivemind.LoggingInterceptor"/>
+ </service-point>
+ <service-point id="Divider" interface="org.apache.hivemind.examples.Divider">
+ <create-instance class="org.apache.hivemind.examples.impl.DividerImpl"/>
+ <interceptor service-id="hivemind.LoggingInterceptor"/>
+ </service-point>
+ <service-point id="Calculator" interface="org.apache.hivemind.examples.Calculator">
+ <invoke-factory service-id="hivemind.BuilderFactory">
+ <construct class="org.apache.hivemind.examples.impl.CalculatorImpl"/>
+ </invoke-factory>
+ <interceptor service-id="hivemind.LoggingInterceptor"/>
+ </service-point>
+</module>]]></source>
<p>
The service-point for the Calculator service is very simple ... as the comment
1.4 +51 -63 jakarta-hivemind/examples/src/documentation/content/xdocs/hivemind-examples/panorama.xml
Index: panorama.xml
===================================================================
RCS file: /home/cvs/jakarta-hivemind/examples/src/documentation/content/xdocs/hivemind-examples/panorama.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- panorama.xml 26 Jul 2004 19:07:11 -0000 1.3
+++ panorama.xml 9 Aug 2004 01:10:37 -0000 1.4
@@ -112,55 +112,51 @@
<p>
Special consideration was given to supporting legacy startup code in the tools and services; code that stays
in the form of a public static method. As HiveMind is adopted, these static methods will go away, and be replaced
-with either HiveMind services, or simple objects.
+with either HiveMind services, or simple objects. In the very long term, much of this startup logic will become uncessary,
+as more of the system will be implemented using HiveMind services, which will lazily initialize just as needed.
</p>
<p>
The schema definition (with desriptions removed, for compactness) follows:
</p>
-<source><![CDATA[ schema (id=Tasks)
- {
- element (name=task)
- {
- attribute (name=title required=true)
- attribute (name=id required=true)
- attribute (name=before)
- attribute (name=after)
- attribute (name=executable required=true translator=object)
+<source><![CDATA[
+<schema id="Tasks">
+ <element name="task">
+ <attribute name="title" required="true"/>
+ <attribute name="id" required="true"/>
+ <attribute name="before"/>
+ <attribute name="after"/>
+ <attribute name="executable" required="true" translator="object"/>
- conversion (class=com.panorama.startup.impl.Task)
- }
-
- element (name=static-task)
- {
- attribute (name=title required=true)
- attribute (name=id required=true)
- attribute (name=before)
- attribute (name=after)
- attribute (name=class translator=class required=true)
- attribute (name=method)
+ <conversion class="com.panorama.startup.impl.Task"/>
+ </element>
+
+ <element name="static-task">
+ <attribute name="title" required="true"/>
+ <attribute name="id" required="true"/>
+ <attribute name="before"/>
+ <attribute name="after"/>
+ <attribute name="class" translator="class" required="true"/>
+ <attribute name="method"/>
- rules
- {
- create-object (class=com.panorama.startup.impl.Task)
- invoke-parent (method=addElement)
+ <rules>
+ <create-object class="com.panorama.startup.impl.Task"/>
+ <invoke-parent method="addElement"/>
- read-attribute (attribute=id property=id)
- read-attribute (attribute=title property=title)
- read-attribute (attribute=before property=before)
- read-attribute (attribute=after property=after)
+ <read-attribute attribute="id" property="id"/>
+ <read-attribute attribute="title" property="title"/>
+ <read-attribute attribute="before" property="before"/>
+ <read-attribute attribute="after" property="after"/>
- create-object (class=com.panorama.startup.impl.ExecuteStatic)
- invoke-parent (method=setExecutable)
+ <create-object class="com.panorama.startup.impl.ExecuteStatic"/>
+ <invoke-parent method="setExecutable"/>
- read-attribute (attribute=class property=targetClass)
- read-attribute (attribute=method property=methodName)
- }
- }
- }
-
-]]></source>
+ <read-attribute attribute="class" property="targetClass"/>
+ <read-attribute attribute="method" property="methodName"/>
+ </rules>
+ </element>
+</schema>]]></source>
<note>
For more details, see <link href="hivedocs/schema/panorama.startup.Tasks.html">the HiveDoc for
@@ -173,8 +169,7 @@
</p>
<source><![CDATA[
- task (id=mail title=Mail executable=service:MailStartup)
-]]></source>
+<task id="mail" title="Mail" executable="service:MailStartup"/>]]></source>
<p>
The <code>executable</code> attribute is converted into an object or service; here the <code>service:</code>
@@ -186,11 +181,8 @@
<p>
To support legacy code, a second option, <code>static-task</code>, is provided:
</p>
-<source><![CDATA[ contribution (configuration-id=panorama.startup.Startup)
- {
- static-task (id=discussions title=Discussions after=mail class=com.panorama.discussions.DiscussionsStartup)
- }
-]]></source>
+<source><![CDATA[
+<static-task id="discussions" title="Discussions" after="mail" class="com.panorama.discussions.DiscussionsStartup"/>]]></source>
<p>
The <code>static-task</code> element duplicates the <code>id</code>, <code>title</code>,
@@ -210,25 +202,21 @@
a Startup service that uses the configuration point.
</p>
-<source><![CDATA[ configuration-point (id=Startup schema-id=Tasks)
-
- service-point (id=Startup interface=java.lang.Runnable)
- {
- invoke-factory (service-id=hivemind.BuilderFactory)
- {
- construct (class=com.panorama.startup.impl.TaskExecutor)
- {
- set-configuration (property=tasks configuration-id=Startup)
- }
- }
- }
-
- contribution (configuration-id=hivemind.Startup)
- {
- service (service-id=Startup)
- }]]></source>
-
+<source><![CDATA[
+<configuration-point id="Startup" schema-id="Tasks"/>
+<service-point id="Startup" interface="java.lang.Runnable">
+ <invoke-factory service-id="hivemind.BuilderFactory">
+ <construct class="com.panorama.startup.impl.TaskExecutor">
+ <set-configuration property="tasks" configuration-id="Startup"/>
+ </construct>
+ </invoke-factory>
+</service-point>
+
+<contribution id="hivemind.Startup">
+ <service service-id="Startup"/>
+</contribution>]]></source>
+
<p>
The <code>hivemind.Startup</code> configuration point is used to ensure that the Panorama Startup service is
1.2 +2 -0 jakarta-hivemind/examples/src/descriptor/META-INF/examples.xml
Index: examples.xml
===================================================================
RCS file: /home/cvs/jakarta-hivemind/examples/src/descriptor/META-INF/examples.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- examples.xml 3 Aug 2004 14:02:14 -0000 1.1
+++ examples.xml 9 Aug 2004 01:10:37 -0000 1.2
@@ -34,6 +34,8 @@
</service-point>
<service-point id="Calculator" interface="org.apache.hivemind.examples.Calculator">
<invoke-factory service-id="hivemind.BuilderFactory">
+
+ <!-- Most properties are autowired by the BuilderFactory -->
<construct class="org.apache.hivemind.examples.impl.CalculatorImpl"/>
</invoke-factory>
<interceptor service-id="hivemind.LoggingInterceptor"/>
1.6 +6 -0 jakarta-hivemind/examples/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-hivemind/examples/build.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- build.xml 3 Aug 2004 14:02:18 -0000 1.5
+++ build.xml 9 Aug 2004 01:10:37 -0000 1.6
@@ -42,6 +42,12 @@
</fileset>
<pathelement location="${java.classes.dir}"/>
<pathelement location="${conf.src.dir}"/>
+
+ <!-- Not sure why, but running the examples failed with a missing XML parser.
+ Haven't tracked this down yet, but adding in the libraries, including Xerces,
+ provided with Ant helps. -->
+
+ <fileset dir="${ant.home}/lib" includes="*.jar"/>
</path>
<property name="hivedoc.output.dir" location="${module.docs.target.dir}/hivedocs"/>
<import file="${hivebuild.dir}/hivedoc-report.xml"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org