You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2003/01/07 09:32:23 UTC
cvs commit: jakarta-turbine-maven/src/plugins-build/plexus/src/test-data plexus-roles-test.conf
jvanzyl 2003/01/07 00:32:23
Modified: src/plugins-build/plexus plugin.jelly
src/plugins-build/plexus/src/java/org/apache/maven/plexus
PlexusRoleFinder.java
src/plugins-build/plexus/src/test/org/apache/maven/plexus
PlexusRoleFinderTest.java
Added: src/plugins-build/plexus/src/test-data
plexus-roles-test.conf
Log:
o Make the finder bean-use friendly.
o Adding jelly bean to dyna tag for gleaning required resources from
plexus configuration files.
Revision Changes Path
1.8 +9 -0 jakarta-turbine-maven/src/plugins-build/plexus/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/plugin.jelly,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- plugin.jelly 6 Jan 2003 06:21:05 -0000 1.7
+++ plugin.jelly 7 Jan 2003 08:32:23 -0000 1.8
@@ -2,10 +2,19 @@
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:util="jelly:util"
+ xmlns:define="jelly:define"
xmlns:velocity="jelly:org.apache.maven.jelly.tags.velocity.VelocityTagLibrary"
xmlns:reactor="reactor"
xmlns:deploy="deploy"
xmlns:plexus="plexus">
+
+ <define:taglib uri="plexus">
+ <define:jellybean name="find-resources">
+ name="find-resources"
+ className="org.apache.maven.plexus.PlexusRoleFinder"
+ method="parse"
+ />
+ </define:taglib>
<!-- ===================================================================== -->
<!-- D E P L O Y P L E X U S -->
1.2 +13 -2 jakarta-turbine-maven/src/plugins-build/plexus/src/java/org/apache/maven/plexus/PlexusRoleFinder.java
Index: PlexusRoleFinder.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/src/java/org/apache/maven/plexus/PlexusRoleFinder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PlexusRoleFinder.java 7 Jan 2003 08:14:17 -0000 1.1
+++ PlexusRoleFinder.java 7 Jan 2003 08:32:23 -0000 1.2
@@ -76,7 +76,18 @@
private static SAXParserFactory saxFactory;
private StringBuffer bodyText = new StringBuffer();
private Set uniqueRoles = new HashSet();
+ private File configuration;
+
+ public void setConfiguration( File configuration )
+ {
+ this.configuration = configuration;
+ }
+ public File getConfiguration()
+ {
+ return configuration;
+ }
+
/**
* Gets the dependencies attribute of the Bootstrap object
*/
@@ -87,13 +98,13 @@
/**
*/
- public void parse(File project)
+ public void parse()
{
try
{
saxFactory = SAXParserFactory.newInstance();
SAXParser parser = saxFactory.newSAXParser();
- InputSource is = new InputSource(new FileInputStream(project));
+ InputSource is = new InputSource(new FileInputStream( getConfiguration() ));
parser.parse(is, this);
}
catch (Exception e)
1.2 +3 -2 jakarta-turbine-maven/src/plugins-build/plexus/src/test/org/apache/maven/plexus/PlexusRoleFinderTest.java
Index: PlexusRoleFinderTest.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/plexus/src/test/org/apache/maven/plexus/PlexusRoleFinderTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PlexusRoleFinderTest.java 7 Jan 2003 08:14:33 -0000 1.1
+++ PlexusRoleFinderTest.java 7 Jan 2003 08:32:23 -0000 1.2
@@ -88,7 +88,8 @@
public void testRoleFinder()
{
PlexusRoleFinder finder = new PlexusRoleFinder();
- finder.parse( new File( TEST_CONF ) );
+ finder.setConfiguration( new File( TEST_CONF ) );
+ finder.parse();
List roles = finder.getRoles();
1.1 jakarta-turbine-maven/src/plugins-build/plexus/src/test-data/plexus-roles-test.conf
Index: plexus-roles-test.conf
===================================================================
<plexus>
<load-on-start>
<service role="org.apache.plexus.jetty.ServletContainer" id="jetty"/>
<service role="org.apache.plexus.transactor.Transactor" id="transactor"/>
<service role="com.werken.werkflow.agent.AgentManager" id="agent-manager"/>
</load-on-start>
<factories>
<factory>
<id>velocity</id>
<role>org.apache.plexus.velocity.VelocityComponent</role>
<class>org.apache.plexus.velocity.DefaultVelocityComponent</class>
</factory>
<factory>
<id>script-agent-factory</id>
<role>com.werken.werkflow.agent.ScriptAgent</role>
<class>com.werken.werkflow.agent.ScriptAgent</class>
</factory>
</factories>
<components>
<component>
<id>xmlrpc</id>
<role>org.apache.plexus.xmlrpc.XmlRpcComponent</role>
<class>org.apache.plexus.xmlrpc.DefaultXmlRpcComponent</class>
<configuration>
<port>9000</port>
<parser>org.apache.xerces.parsers.SAXParser</parser>
<secureServer>false</secureServer>
<!-- Handlers -->
<handler name="file" class="org.apache.plexus.xmlrpc.handler.FileHandler"/>
<handler name="directfile" class="org.apache.plexus.xmlrpc.handler.DirectFileHandler"/>
<handler name="echo" class="org.apache.xmlrpc.Echo"/>
<paranoid>false</paranoid>
<!--
<acceptedClients/>
<deniedClients/>
-->
<systemProperty name="sendDirectory" value="send"/>
<systemProperty name="receiveDirectory" value="receive"/>
<systemProperty name="transDir" value="trans"/>
<!-- These are relative to the application root -->
<sendQueueDirectory>send</sendQueueDirectory>
<receiveQueueDirectory>receive</receiveQueueDirectory>
</configuration>
</component>
<component>
<id>scheduler</id>
<role>org.apache.plexus.scheduler.Scheduler</role>
<class>org.apache.plexus.scheduler.DefaultScheduler</class>
<configuration>
<job-directory>jobs</job-directory>
<scheduler>
<!-- logger -->
<property name="org.quartz.logger.commonsLogger.class" value="org.apache.plexus.scheduler.CommonsLogger"/>
<!-- scheduler -->
<property name="org.quartz.scheduler.instanceName" value="scheduler1"/>
<property name="org.quartz.scheduler.logger" value="commonsLogger"/>
<!-- thread pool -->
<property name="org.quartz.threadPool.class" value="org.quartz.simpl.SimpleThreadPool"/>
<property name="org.quartz.threadPool.threadCount" value="15"/>
<property name="org.quartz.threadPool.threadPriority" value="4"/>
<property name="org.quartz.threadPool.logger" value="commonsLogger"/>
<!-- job store -->
<property name="org.quartz.jobStore.class" value="org.quartz.simpl.RAMJobStore"/>
<property name="org.quartz.jobStore.logger" value="commonsLogger"/>
</scheduler>
</configuration>
</component>
<component>
<id>jetty</id>
<logger>test</logger>
<role>org.apache.plexus.jetty.ServletContainer</role>
<class>org.apache.plexus.jetty.JettyServletContainer</class>
<configuration>
<host>localhost</host>
<port>8080</port>
<webappsDirectory>webapps</webappsDirectory>
<unpackWars>true</unpackWars>
<stopGracefully>true</stopGracefully>
<extractWars>true</extractWars>
</configuration>
</component>
<component>
<id>transactor</id>
<role>org.apache.plexus.transactor.Transactor</role>
<class>org.apache.plexus.transactor.DefaultTransactor</class>
<configuration>
<marDirectory>mars</marDirectory>
<transactionDirectory>transactions</transactionDirectory>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://127.0.0.1:5432/buyer</url>
<userid>tambora</userid>
<password>tambora</password>
<transporter-role>org.apache.plexus.xmlrpc.XmlRpcComponent</transporter-role>
<transporter-id>xmlrpc</transporter-id>
</configuration>
</component>
<!-- W E R K F L O W -->
<component>
<id>werkflow</id>
<role>com.werken.werkflow.WorkflowEngine</role>
<class>com.werken.werkflow.engine.WorkflowEngineImpl</class>
<configuration>
<engine>
<min-threads>1</min-threads>
<max-threads>10</max-threads>
<keep-alive>60000</keep-alive>
</engine>
<process-repos>
<repo>jelly-repo</repo>
</process-repos>
</configuration>
</component>
<!-- P R O C E S S R E P O S I T O R Y -->
<component>
<id>jelly-repo</id>
<role>com.werken.werkflow.process.ProcessDefinitionRepository</role>
<class>com.werken.werkflow.jelly.JellyProcessDefinitionRepository</class>
<configuration>
<url>conf/po.werk</url>
</configuration>
</component>
<component>
<id>agent-manager</id>
<role>com.werken.werkflow.agent.AgentManager</role>
<class>com.werken.werkflow.agent.SimpleAgentManager</class>
<configuration>
<engine>werkflow</engine>
<bind>
<process>po</process>
<agent>com.werken.werkflow.agent.ScriptAgent</agent>
<configuration>
</configuration>
</bind>
<bind>
<process>oc</process>
<agent>com.werken.werkflow.agent.ScriptAgent</agent>
<configuration>
<trigger>supplier.accept</trigger>
<!--
<pause>3</pause>
<trigger>supplier.amend</trigger>
<pause>3</pause>
<trigger>supplier.accept</trigger>
-->
</configuration>
</bind>
</configuration>
</component>
</components>
</plexus>