You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by hl...@apache.org on 2003/09/20 14:48:20 UTC
cvs commit: jakarta-commons-sandbox/hivemind/framework/src/descriptor/META-INF hivemodule.xml
hlship 2003/09/20 05:48:20
Modified: hivemind/framework/src/test/hivemind/test
FrameworkTestCase.java TestRegistryBuilder.java
hivemind/framework project.xml maven.xml .cvsignore
project.properties
hivemind/framework/src/test/hivemind/test/config
TestConfigurationPoint.java
hivemind/framework/src/test/hivemind/test/ant
TestConstructRegistry.java
hivemind/framework/src/java/org/apache/commons/hivemind/test
HiveMindTestCase.java
hivemind .classpath project.properties
hivemind/library .cvsignore project.properties
Added: hivemind/framework/src/descriptor/META-INF hivemodule.xml
Removed: hivemind/framework/src/META-INF hivemodule.xml
Log:
Clean up and simplify the unit test suite.
Revision Changes Path
1.3 +11 -1 jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/FrameworkTestCase.java
Index: FrameworkTestCase.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/FrameworkTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FrameworkTestCase.java 19 Sep 2003 22:10:59 -0000 1.2
+++ FrameworkTestCase.java 20 Sep 2003 12:48:19 -0000 1.3
@@ -74,6 +74,16 @@
{
protected ClassResolver _resolver = new DefaultClassResolver();
+ private static final boolean UNIT_TEST_FROM_IDE = Boolean.getBoolean("unit-test-from-ide");
+
+ protected String getFrameworkPath(String path)
+ {
+ if (UNIT_TEST_FROM_IDE)
+ return "framework/" + path;
+
+ return path;
+ }
+
public FrameworkTestCase(String name)
{
super(name);
1.6 +10 -27 jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/TestRegistryBuilder.java
Index: TestRegistryBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/TestRegistryBuilder.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TestRegistryBuilder.java 19 Sep 2003 22:10:59 -0000 1.5
+++ TestRegistryBuilder.java 20 Sep 2003 12:48:19 -0000 1.6
@@ -99,7 +99,9 @@
}
catch (ApplicationRuntimeException ex)
{
- assertExceptionSubstring(ex, "Registry does not contain module 'org.apache.commons.hivemind'.");
+ assertExceptionSubstring(
+ ex,
+ "Registry does not contain module 'org.apache.commons.hivemind'.");
}
}
@@ -110,10 +112,9 @@
public void testLookup() throws Exception
{
- File f1 = new File("src");
- File f2 = new File("src/test-data/TestRegistryBuilder");
+ File f = new File(getFrameworkPath("src/test-data/TestRegistryBuilder"));
- URL[] urls = new URL[] { f1.toURL(), f2.toURL()};
+ URL[] urls = new URL[] { f.toURL()};
ClassLoader loader =
new URLClassLoader(urls, Thread.currentThread().getContextClassLoader());
@@ -136,29 +137,11 @@
public void testConstructDefaultRegistry() throws Exception
{
- ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
+ Registry r = RegistryBuilder.constructDefaultRegistry();
- try
- {
- // Add src to the classpath, so that META-INF will be picked up properly.
+ ClassFactory factory =
+ (ClassFactory) r.getService("hivemind.ClassFactory", ClassFactory.class);
- File file = new File("src");
-
- URLClassLoader testLoader =
- new URLClassLoader(new URL[] { file.toURL()}, originalLoader);
-
- Thread.currentThread().setContextClassLoader(testLoader);
-
- Registry r = RegistryBuilder.constructDefaultRegistry();
-
- ClassFactory factory =
- (ClassFactory) r.getService("hivemind.ClassFactory", ClassFactory.class);
-
- assertNotNull(factory);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(originalLoader);
- }
+ assertNotNull(factory);
}
}
1.6 +4 -2 jakarta-commons-sandbox/hivemind/framework/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/project.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- project.xml 19 Sep 2003 22:10:59 -0000 1.5
+++ project.xml 20 Sep 2003 12:48:19 -0000 1.6
@@ -184,7 +184,9 @@
</includes>
</resource>
- <!-- We don't package src/META-INF here, because it screws up some of the unit tests. -->
+ <resource>
+ <directory>${basedir}/src/descriptor</directory>
+ </resource>
</resources>
1.2 +4 -31 jakarta-commons-sandbox/hivemind/framework/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/maven.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- maven.xml 16 Sep 2003 18:51:21 -0000 1.1
+++ maven.xml 20 Sep 2003 12:48:19 -0000 1.2
@@ -1,34 +1,7 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<project xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:ant="jelly:ant">
- <postGoal name="jar:jar">
- <echo>Adding META-INF/hivemodule.xml to ${maven.final.name}.jar</echo>
- <taskdef name="manifestClassPath"
- classname="org.apache.commons.hivemind.ant.ManifestClassPath">
- <classpath>
- <pathelement location="${maven.build.dest}"/>
- </classpath>
- </taskdef>
- <manifestClassPath property="hivemind.manifest.class.path">
- <classpath>
-
- <!-- This, unfortunately, includes a few dependencies we don't want, but
- that's largely OK. -->
-
- <path refid="maven.dependency.classpath"/>
- </classpath>
- </manifestClassPath>
- <jar jarfile="${maven.build.dir}/${maven.final.name}.jar"
- basedir="${maven.build.dest}" update="true"
- excludes="${maven.jar.excludes}">
- <fileset dir="src">
- <include name="META-INF/**"/>
- </fileset>
- <manifest>
- <attribute name="Class-Path" value="${hivemind.manifest.class.path}"/>
- </manifest>
- </jar>
- </postGoal>
+
<preGoal name="xdoc:jelly-transform">
<!-- Some kind of voodoo magic I picked up from the docbook plugin. -->
<echo>Building HiveModule Registry docs ...</echo>
@@ -40,7 +13,7 @@
</taskdef>
<constructRegistry output="target/base-registry.xml">
<descriptors>
- <fileset dir="src/META-INF">
+ <fileset dir="src/descriptor/META-INF">
<include name="hivemodule.xml"/>
</fileset>
</descriptors>
@@ -63,7 +36,7 @@
<constructRegistry output="${sample.registry}">
<descriptors>
- <fileset dir="src/META-INF">
+ <fileset dir="src/descriptor/META-INF">
<include name="hivemodule.xml"/>
</fileset>
<fileset dir="src/test-data/sample">
1.2 +1 -0 jakarta-commons-sandbox/hivemind/framework/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 16 Sep 2003 18:51:21 -0000 1.1
+++ .cvsignore 20 Sep 2003 12:48:19 -0000 1.2
@@ -1,2 +1,3 @@
target
*.log
+bin
1.4 +4 -6 jakarta-commons-sandbox/hivemind/framework/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/project.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- project.properties 19 Sep 2003 22:29:03 -0000 1.3
+++ project.properties 20 Sep 2003 12:48:19 -0000 1.4
@@ -1,9 +1,7 @@
# $Id$
-maven.xdoc.date=left
+# Alas, this is still necessary, due to a conflict between the version of Xerces as a dependency
+# and the version used by Maven and/or Ant. It causes TestConstructRegistry to fail
+# with an IncompatibleClassChange exception if fork is false.
maven.junit.fork=yes
-maven.jar.index=true
-maven.junit.sysproperties=testing-hivemind-framework
-
-testing-hivemind-framework=true
\ No newline at end of file
1.3 +3 -3 jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/config/TestConfigurationPoint.java
Index: TestConfigurationPoint.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/config/TestConfigurationPoint.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestConfigurationPoint.java 19 Sep 2003 22:10:59 -0000 1.2
+++ TestConfigurationPoint.java 20 Sep 2003 12:48:19 -0000 1.3
@@ -505,9 +505,9 @@
Resource moduleResource =
new ClasspathResource(_resolver, "/hivemind/test/config/ResourceTranslator.xml");
+ builder.processModules(_resolver);
builder.processModule(_resolver, moduleResource);
- builder.processModule(_resolver, getMasterModuleDescriptorResource());
-
+
Registry r = builder.constructRegistry(Locale.FRENCH);
List l = r.getConfiguration("hivemind.test.config.ResourceTranslator");
1.3 +32 -24 jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/ant/TestConstructRegistry.java
Index: TestConstructRegistry.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/ant/TestConstructRegistry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestConstructRegistry.java 19 Sep 2003 18:25:19 -0000 1.2
+++ TestConstructRegistry.java 20 Sep 2003 12:48:19 -0000 1.3
@@ -148,8 +148,10 @@
Path p = cr.createDescriptors();
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/master.xml"));
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/Symbols.xml"));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.xml")));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/Symbols.xml")));
File output = File.createTempFile("testBasic-", ".xml");
@@ -161,29 +163,30 @@
cr.execute();
- compare(output, "src/test-data/TestConstructRegistry/testBasic.xml");
+ compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testBasic.xml"));
}
-
- public void testLocalRefs() throws Exception
- {
- ConstructRegistry cr = create();
- Path p = cr.createDescriptors();
+ public void testLocalRefs() throws Exception
+ {
+ ConstructRegistry cr = create();
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/LocalRefs.xml"));
+ Path p = cr.createDescriptors();
- File output = File.createTempFile("testLocalRefs-", ".xml");
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/LocalRefs.xml")));
- // Delete the file, to force the task to re-create it.
+ File output = File.createTempFile("testLocalRefs-", ".xml");
- output.delete();
+ // Delete the file, to force the task to re-create it.
- cr.setOutput(output);
+ output.delete();
- cr.execute();
+ cr.setOutput(output);
+
+ cr.execute();
- compare(output, "src/test-data/TestConstructRegistry/testLocalRefs.xml");
- }
+ compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testLocalRefs.xml"));
+ }
public void testUptoDate() throws Exception
{
@@ -191,8 +194,10 @@
Path p = cr.createDescriptors();
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/master.xml"));
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/Symbols.xml"));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.xml")));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/Symbols.xml")));
File output = File.createTempFile("testUptoDate-", ".xml");
@@ -204,7 +209,7 @@
cr.execute();
- compare(output, "src/test-data/TestConstructRegistry/testUptoDate.xml");
+ compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testUptoDate.xml"));
long stamp = output.lastModified();
@@ -219,9 +224,12 @@
Path p = cr.createDescriptors();
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/master.xml"));
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/empty.jar"));
- p.createPath().setLocation(new File("src/test-data/TestConstructRegistry/module.jar"));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.xml")));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/empty.jar")));
+ p.createPath().setLocation(
+ new File(getFrameworkPath("src/test-data/TestConstructRegistry/module.jar")));
File output = File.createTempFile("testJars-", ".xml");
@@ -231,7 +239,7 @@
cr.execute();
- compare(output, "src/test-data/TestConstructRegistry/testJars.xml");
+ compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testJars.xml"));
}
protected void compare(File actual, String expectedPath) throws Exception
1.3 +1 -20 jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/test/HiveMindTestCase.java
Index: HiveMindTestCase.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/test/HiveMindTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HiveMindTestCase.java 19 Sep 2003 22:10:59 -0000 1.2
+++ HiveMindTestCase.java 20 Sep 2003 12:48:19 -0000 1.3
@@ -57,7 +57,6 @@
package org.apache.commons.hivemind.test;
-import java.io.File;
import java.net.URL;
import java.util.List;
import java.util.Locale;
@@ -103,9 +102,6 @@
super(name);
}
- protected static final boolean TESTING_HIVEMIND_FRAMEWORK =
- Boolean.getBoolean("testing-hivemind-framework");
-
/**
* Returns the given file as a {@link Resource} from the classpath. Typically,
* this is to find files in the same folder as the invoking class.
@@ -355,9 +351,6 @@
builder.processModules(resolver);
- if (TESTING_HIVEMIND_FRAMEWORK)
- builder.processModule(resolver, getMasterModuleDescriptorResource());
-
return builder.constructRegistry(Locale.getDefault());
}
@@ -372,18 +365,6 @@
builder.processModule(new DefaultClassResolver(), l);
return builder.constructRegistry(Locale.getDefault());
- }
-
- /**
- * Returns the location of the module deployment descriptor for the HiveMind library
- * itself. Because the tests may be run inside an IDE, this is resolved using
- * the filesystem (expecting the current directory to be the framework directory).
- */
- protected Resource getMasterModuleDescriptorResource() throws Exception
- {
- File f = new File("src/META-INF/hivemodule.xml");
-
- return new URLResource(f.toURL());
}
}
1.20 +2 -1 jakarta-commons-sandbox/hivemind/.classpath
Index: .classpath
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/.classpath,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- .classpath 19 Sep 2003 22:10:59 -0000 1.19
+++ .classpath 20 Sep 2003 12:48:19 -0000 1.20
@@ -5,7 +5,8 @@
<classpathentry kind="src" path="library/src/java"/>
<classpathentry kind="src" path="library/src/test"/>
<classpathentry kind="src" path="framework/src/conf"/>
- <classpathentry kind="src" path="library/src/descriptor"/>
+ <classpathentry kind="src" output="library/bin" path="library/src/descriptor"/>
+ <classpathentry kind="src" output="framework/bin" path="framework/src/descriptor"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.7.jar"/>
1.5 +4 -2 jakarta-commons-sandbox/hivemind/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/project.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- project.properties 16 Sep 2003 18:51:28 -0000 1.4
+++ project.properties 20 Sep 2003 12:48:19 -0000 1.5
@@ -2,6 +2,8 @@
maven.username=hlship
maven.xdoc.date=left
-maven.junit.fork=yes
+
+maven.jar.index=true
+
maven.multiproject.aggregateDir=
maven.xdoc.version=${pom.currentVersion}
1.2 +1 -0 jakarta-commons-sandbox/hivemind/library/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/library/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 19 Sep 2003 22:10:59 -0000 1.1
+++ .cvsignore 20 Sep 2003 12:48:19 -0000 1.2
@@ -1 +1,2 @@
target
+bin
1.2 +3 -2 jakarta-commons-sandbox/hivemind/library/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/library/project.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.properties 19 Sep 2003 22:10:59 -0000 1.1
+++ project.properties 20 Sep 2003 12:48:19 -0000 1.2
@@ -1,4 +1,5 @@
# $Id$
-maven.xdoc.date=left
+# This seems to be necessary to get the full code coverage.
+maven.jar.index=true
\ No newline at end of file
1.1 jakarta-commons-sandbox/hivemind/framework/src/descriptor/META-INF/hivemodule.xml
Index: hivemodule.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: hivemodule.xml,v 1.1 2003/09/20 12:48:20 hlship Exp $ -->
<!-- Defines configuration points used by HiveMind itself. -->
<module
id="hivemind" version="1.0.0">
<description>
The master module for HiveMind.
</description>
<configuration-point id="SymbolSource">
<description>Provides a list of sources for values of substitution symbols.</description>
<schema>
<element name="source">
<description>Describes a single source of symbol values.</description>
<attribute name="order">
<description>A number used to set the order in which sources are checked.</description>
</attribute>
<attribute name="class">
<description>Name of a class implementing the SymbolSource interface.</description>
</attribute>
<attribute name="service-id">
<description>Service configuration id for a service which implements the SymbolSource interface.</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.SymbolSourceContribution"/>
<read-attribute property="order" attribute="order" translator="int"/>
<read-attribute property="source" attribute="class" translator="class"/>
<read-attribute property="source" attribute="service-id" translator="service"/>
<invoke-parent method="addElement"/>
</rules>
</element>
</schema>
</configuration-point>
<contribution configuration-id="SymbolSource">
<source order="900000" service-id="ApplicationDefaultsSymbolSource"/>
<source order="1000000" service-id="FactoryDefaultsSymbolSource"/>
</contribution>
<configuration-point id="FactoryDefaults">
<description>
Extension point for setting "factory defaults" for symbol values.
</description>
<schema id="defaults">
<element name="default">
<description>
Provides a default symbol value.
</description>
<attribute name="symbol" required="true">
<description>
The id of the symbol to define a default value for.
</description>
</attribute>
<attribute name="value" required="true">
<description>
The value for the symbol.
</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.service.impl.FactoryDefault"/>
<read-attribute attribute="symbol" property="symbol"/>
<read-attribute attribute="value" property="value"/>
<invoke-parent method="addElement"/>
</rules>
</element>
</schema>
</configuration-point>
<configuration-point id="ApplicationDefaults">
<description>
Extension point for setting application defaults; these defaults will override
factory defaults specified in the FactoryDefaults configuration point.
</description>
<schema ref-id="defaults"/>
</configuration-point>
<service-point id="FactoryDefaultsSymbolSource" interface="org.apache.commons.hivemind.SymbolSource">
<description>
SymbolSource implementation driven by the FactoryDefaults configuration point.
</description>
<invoke-factory service-id="BuilderFactory">
<construct
class="org.apache.commons.hivemind.service.impl.DefaultsSymbolSource"
log-property="log">
<set-configuration configuration-id="FactoryDefaults" property="defaults"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="ApplicationDefaultsSymbolSource" interface="org.apache.commons.hivemind.SymbolSource">
<description>
SymbolSource implementation driven by the ApplicationDefaults configuration point.
</description>
<invoke-factory service-id="BuilderFactory">
<construct
class="org.apache.commons.hivemind.service.impl.DefaultsSymbolSource"
log-property="log">
<set-configuration configuration-id="ApplicationDefaults" property="defaults"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="ClassFactory" interface="org.apache.commons.hivemind.service.ClassFactory" model="singleton">
<description>Wrapper around Javassist used to dynamically create classes such as service interceptors.</description>
<create-instance class="org.apache.commons.hivemind.service.impl.ClassFactoryImpl"/>
</service-point>
<service-point id="LoggingInterceptor" interface="org.apache.commons.hivemind.ServiceInterceptorFactory" model="singleton">
<description>
An interceptor factory for adding method-level logging to a service.
Logging occurs at level DEBUG and uses the service id as the logger.
Method entry (with parameters) and method exit (with return value) are logged,
as are any exceptions.
</description>
<invoke-factory service-id="BuilderFactory">
<construct
class="org.apache.commons.hivemind.service.impl.LoggingInterceptorFactory"
point-id-property="extensionId">
<set-service property="factory" service-id="ClassFactory"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="BuilderFactory" interface="org.apache.commons.hivemind.ServiceImplementationFactory" model="singleton">
<description>
Used to construct a service from a class name and a set of properties and values to be set in the instantiated class.
</description>
<parameters-schema>
<element name="construct">
<description>
A single construct element identifies the class to instantiate.
</description>
<attribute name="class" required="true">
<description>The name of the class to instantiate.</description>
</attribute>
<attribute name="messages-property">
<description>
The name of a property to assign to invoking module's messages to.
</description>
</attribute>
<attribute name="log-property">
<description>
The name of a property to assign the Log instance for the service to.
The Log instance is built from the service configuration point id.
</description>
</attribute>
<attribute name="point-id-property">
<description>
The name of a property to assign the configuration point id of the service to.
</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.service.impl.BuilderParameter"/>
<read-attribute property="className" attribute="class"/>
<read-attribute attribute="messages-property" property="messagesPropertyName"/>
<read-attribute attribute="log-property" property="logPropertyName"/>
<read-attribute attribute="point-id-property" property="extensionPointIdPropertyName"/>
<invoke-parent method="addElement"/>
</rules>
<element name="set">
<description>
Configures a property of the service instance to a string value.
</description>
<attribute name="property" required="true">
<description>The name of a property of the service instance to configure.</description>
</attribute>
<attribute name="value" required="true">
<description>A literal string value to set the property to.</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
<read-attribute property="propertyName" attribute="property"/>
<read-attribute property="value" attribute="value"/>
<invoke-parent method="addProperty"/>
</rules>
</element>
<element name="set-int">
<description>
Configures a property of the service instance to an integer value.
</description>
<attribute name="property" required="true">
<description>The name of a property of the service instance to configure.</description>
</attribute>
<attribute name="value" required="true">
<description>An integer value to set the property to.</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
<read-attribute property="propertyName" attribute="property"/>
<read-attribute property="value" attribute="value" translator="int"/>
<invoke-parent method="addProperty"/>
</rules>
</element>
<element name="set-service">
<description>
Configures a property of the service instance to another service.
</description>
<attribute name="property" required="true">
<description>The name of the property of the service instance to configure.</description>
</attribute>
<attribute name="service-id" required="true">
<description>The id of the service.</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
<read-attribute property="propertyName" attribute="property"/>
<read-attribute property="value" attribute="service-id" translator="service"/>
<invoke-parent method="addProperty"/>
</rules>
</element>
<element name="set-configuration">
<description>Configures a property of the service instance to the elements
contributed to an configuration point.</description>
<attribute name="property" required="true">
<description>The name of the property of the service instance to configure.</description>
</attribute>
<attribute name="configuration-id" required="true">
<description>The id of the configuration point to access.</description>
</attribute>
<rules>
<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
<read-attribute property="propertyName" attribute="property"/>
<read-attribute property="value" attribute="configuration-id" translator="configuration"/>
<invoke-parent method="addProperty"/>
</rules>
</element>
</element>
</parameters-schema>
<create-instance class="org.apache.commons.hivemind.service.impl.BuilderFactory"/>
</service-point>
<service-point id="ThreadEventNotifier" interface="org.apache.commons.hivemind.service.ThreadEventNotifier">
<description>
Service used by other services to be alerted when a thread is cleaned up (typically, at
the end of a request or transaction).
</description>
<create-instance class="org.apache.commons.hivemind.service.impl.ThreadEventNotifierImpl"/>
</service-point>
<service-point id="ThreadLocalStorage" interface="org.apache.commons.hivemind.service.ThreadLocalStorage">
<description>
Service which manages a thread-local map of data items. This can be used
for temporary storage of information when local variables can't be used.
All stored items are released when the thread is cleaned up.
</description>
<invoke-factory service-id="BuilderFactory">
<construct class="org.apache.commons.hivemind.service.impl.ThreadLocalStorageImpl">
<set-service property="notifier" service-id="ThreadEventNotifier"/>
</construct>
</invoke-factory>
</service-point>
</module>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org