You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/03/09 05:50:21 UTC
cvs commit: jakarta-avalon-apps/enterprise/tools/src/java/org/apache/demo DirectoryBlock.xinfo ReferralBlock.xinfo
mcconnell 02/03/08 20:50:21
Modified: enterprise/orb build.properties build.xml
enterprise/orb/src/examples/hello/java/hello HelloDemo.java
enterprise/time build.xml
enterprise/time/src/etc time.mf
enterprise/time/src/java/org/apache/time
DefaultTimerEventHandler.java TimeUtils.java
enterprise/tools build.xml
enterprise/tools/lib merlin.jar
enterprise/tools/src/java/org/apache/avalon/excalibur/configuration
CascadingConfiguration.java
enterprise/tools/src/java/org/apache/avalon/excalibur/service
ServiceLoader.java package.html
enterprise/tools/src/java/org/apache/demo
DirectoryBlock.xinfo ReferralBlock.xinfo
Log:
cleanup of interrupt handling
Revision Changes Path
1.4 +3 -4 jakarta-avalon-apps/enterprise/orb/build.properties
Index: build.properties
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/orb/build.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- build.properties 7 Mar 2002 21:34:47 -0000 1.3
+++ build.properties 9 Mar 2002 04:50:20 -0000 1.4
@@ -1,12 +1,11 @@
#
-# The pss.properties file is read in by the build.xml file. It
-# contains information related to resource dependencies and paths
-# to related cornerstone resource
-#
+# The build.properties file is read in by Ant. It contains information
+# related to resource dependencies and paths to related project resource
#
# demo configuration
#
hello.verbose=false
hello.priority=debug
+hello.disposal=false
1.7 +1 -1 jakarta-avalon-apps/enterprise/orb/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/orb/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 7 Mar 2002 21:44:55 -0000 1.6
+++ build.xml 9 Mar 2002 04:50:20 -0000 1.7
@@ -223,7 +223,7 @@
pipeline processing to the class referenced in the target attribute.
-->
- <load target="hello.HelloDemo" priority="DEBUG" disposal="${hello.disposal}" verbose="${hello.verbose}">
+ <load target="hello.HelloDemo" priority="${hello.priority}" disposal="${hello.disposal}" verbose="${hello.verbose}">
<classpath>
<fileset dir="${tools.lib.path}">
1.5 +1 -0 jakarta-avalon-apps/enterprise/orb/src/examples/hello/java/hello/HelloDemo.java
Index: HelloDemo.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/orb/src/examples/hello/java/hello/HelloDemo.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HelloDemo.java 6 Mar 2002 18:35:02 -0000 1.4
+++ HelloDemo.java 9 Mar 2002 04:50:20 -0000 1.5
@@ -83,6 +83,7 @@
{
public void run()
{
+ System.out.println("shutdown hook in hello demo");
demo.dispose();
}
}
1.2 +83 -0 jakarta-avalon-apps/enterprise/time/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/time/build.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build.xml 8 Mar 2002 05:55:06 -0000 1.1
+++ build.xml 9 Mar 2002 04:50:20 -0000 1.2
@@ -28,6 +28,7 @@
clean - destroy the build directory
build - invokes the general build target
dist - executes build, javadoc and support file creation
+ demo - run the time server though it's full lifecycle
</echo>
</target>
@@ -55,6 +56,9 @@
<property name="avalon.href" value="http://jakarta.apache.org/avalon/api/" />
<property name="jdk.href" value="http://java.sun.com/j2se/1.4/docs/api/" />
+ <property name="demo.disposal" value="false" />
+ <property name="demo.verbose" value="true" />
+
<!-- the following properties must be updated locally using the local.properties file -->
<property name="orb.href" value="../orb" />
@@ -159,8 +163,26 @@
</target>
<target name="time" depends="build.context,idl" unless="time.uptodate" >
+
<echo message="Building ORB Time Implementation."/>
+
+ <taskdef resource="checkstyletask.properties"/>
+ <!--
+ <checkstyle allowNoAuthor="true"
+ ignoreBraces="true"
+ lcurlyType="ignore"
+ lcurlyMethod="ignore"
+ lcurlyOther="ignore"
+ rcurly="ignore"
+ >
+ <fileset dir="${src}/java">
+ <include name="**/*.*"/>
+ </fileset>
+ </checkstyle>
+ -->
+
<mkdir dir="${build}/time/lib"/>
+
<javac debug="off" destdir="${build}/time/lib" deprecation="true" target="1.2">
<classpath>
<path refid="project.classpath" />
@@ -170,13 +192,16 @@
<src path="${src}/java" />
<include name="**"/>
</javac>
+
<copy todir="${build}/time/lib">
<fileset dir="${src}/java">
<include name="**/*.xinfo"/>
<include name="**/*.xml"/>
</fileset>
</copy>
+
<jar jarfile="${dist}/${time.jar}" basedir="${build}/time/lib" manifest="${etc}/time.mf" />
+
</target>
<!-- UTILITY TARGETS -->
@@ -218,6 +243,64 @@
<link href="${avalon.href}" />
<link href="${orb.href}" />
</javadoc>
+ </target>
+
+ <target name="loader.context">
+ <available property="loader.available" file="${tools.lib.path}/merlin.jar"/>
+ </target>
+
+ <target name="loader.defintion" depends="loader.context" if="loader.available">
+ <taskdef name="load" classname="org.apache.avalon.excalibur.service.ant.Load">
+ <classpath>
+ <pathelement location="${tools.lib.path}/merlin.jar"/>
+ <pathelement location="${tools.lib.path}/avalon-framework.jar"/>
+ <pathelement location="${tools.lib.path}/logkit.jar"/>
+ </classpath>
+ </taskdef>
+ </target>
+
+ <target name="demo" depends="loader.defintion,time" if="loader.available">
+
+ <echo message="Executing time service demo."/>
+
+ <!--
+ After loading jar files declared under a fileset, apply lifecycle
+ pipeline processing to the class referenced in the target attribute.
+ -->
+
+ <load target="org.apache.time.Provider" priority="DEBUG" disposal="${demo.disposal}" verbose="${demo.verbose}">
+
+ <classpath>
+ <fileset dir="${tools.lib.path}">
+ <include name="merlin.jar"/>
+ <include name="avalon-framework.jar"/>
+ <include name="logkit.jar"/>
+ </fileset>
+ </classpath>
+
+ <!--
+ For all of the jar files in the fileset, load the jar file
+ into the classloader.
+ -->
+
+ <fileset dir="${lib}">
+ <include name="*.jar"/>
+ </fileset>
+
+ <fileset dir="${orb.lib.path}">
+ <include name="*.jar"/>
+ </fileset>
+
+ <fileset dir="${tools.lib.path}">
+ <include name="*.jar"/>
+ </fileset>
+
+ <fileset dir="${dist}">
+ <include name="*.jar"/>
+ </fileset>
+
+ </load>
+
</target>
</project>
1.2 +1 -1 jakarta-avalon-apps/enterprise/time/src/etc/time.mf
Index: time.mf
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/time/src/etc/time.mf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- time.mf 8 Mar 2002 05:55:06 -0000 1.1
+++ time.mf 9 Mar 2002 04:50:20 -0000 1.2
@@ -8,5 +8,5 @@
Implementation-Vendor: Apache Foundation
Implementation-Version: 1.0
-Name: org/apache/time/TimeServer.class
+Name: org/apache/time/Provider.class
Avalon-Block: true
1.2 +4 -1 jakarta-avalon-apps/enterprise/time/src/java/org/apache/time/DefaultTimerEventHandler.java
Index: DefaultTimerEventHandler.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/time/src/java/org/apache/time/DefaultTimerEventHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultTimerEventHandler.java 8 Mar 2002 05:55:06 -0000 1.1
+++ DefaultTimerEventHandler.java 9 Mar 2002 04:50:20 -0000 1.2
@@ -9,7 +9,10 @@
package org.apache.time;
import java.util.Date;
-import org.omg.CORBA.*;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Any;
+import org.omg.CORBA.BAD_PARAM;
+import org.omg.CORBA.COMM_FAILURE;
import org.omg.CosEventComm.Disconnected;
import org.omg.CosEventComm.PushConsumer;
import org.omg.CosTime.UTO;
1.2 +0 -1 jakarta-avalon-apps/enterprise/time/src/java/org/apache/time/TimeUtils.java
Index: TimeUtils.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/time/src/java/org/apache/time/TimeUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TimeUtils.java 8 Mar 2002 05:55:06 -0000 1.1
+++ TimeUtils.java 9 Mar 2002 04:50:20 -0000 1.2
@@ -14,7 +14,6 @@
import java.util.Date;
import java.util.GregorianCalendar;
-import java.util.Calendar;
/**
1.5 +13 -19 jakarta-avalon-apps/enterprise/tools/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/tools/build.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- build.xml 6 Mar 2002 18:35:55 -0000 1.4
+++ build.xml 9 Mar 2002 04:50:20 -0000 1.5
@@ -108,6 +108,7 @@
</srcfiles>
<srcfiles dir="${etc}">
<include name="loader.mf"/>
+ <include name="merlin.properties"/>
</srcfiles>
</uptodate>
</target>
@@ -128,6 +129,11 @@
<include name="org/apache/avalon/excalibur/**/*.xml"/>
</fileset>
</copy>
+ <copy todir="${build}/lib">
+ <fileset dir="${etc}">
+ <include name="merlin.properties"/>
+ </fileset>
+ </copy>
<jar jarfile="${dist}/${merlin.jar}" basedir="${build}/lib" manifest="${etc}/loader.mf" />
</target>
@@ -193,33 +199,21 @@
</target>
<target name="loader.context">
- <available property="merlin.available" file="${dist}/${merlin.jar}"/>
+ <available property="merlin.available" file="${ant.home}/lib/${merlin.jar}"/>
</target>
<target name="loader.defintion" depends="loader.context" if="merlin.available">
- <taskdef name="load" classname="org.apache.avalon.excalibur.service.ant.Load">
- <classpath>
- <pathelement location="${dist}/${merlin.jar}"/>
- <pathelement location="${tools.lib.path}/avalon-framework.jar"/>
- <pathelement location="${tools.lib.path}/logkit.jar"/>
- </classpath>
- </taskdef>
+ <taskdef resource="merlin.properties"/>
</target>
- <target name="demo" depends="loader.defintion,examples" if="merlin.available">
+ <target name="loader.validation" depends="loader.defintion" unless="merlin.available">
+ <echo message="Merlin is not istalled in your Ant library."/>
+ </target>
+
+ <target name="demo" depends="loader.validation,examples" if="merlin.available">
<load target="org.apache.demo.ReferralBlock" priority="${demo.priority}"
disposal="false" verbose="${demo.verbose}">
-
- <classpath>
- <fileset dir="${dist}">
- <include name="merlin.jar"/>
- </fileset>
- <fileset dir="${lib}">
- <include name="avalon-framework.jar"/>
- <include name="logkit.jar"/>
- </fileset>
- </classpath>
<!--
For all of the jar files in the fileset, load the jar file
1.8 +77 -72 jakarta-avalon-apps/enterprise/tools/lib/merlin.jar
<<Binary file>>
1.2 +8 -5 jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/configuration/CascadingConfiguration.java
Index: CascadingConfiguration.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/configuration/CascadingConfiguration.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CascadingConfiguration.java 3 Mar 2002 15:45:58 -0000 1.1
+++ CascadingConfiguration.java 9 Mar 2002 04:50:20 -0000 1.2
@@ -1,8 +1,11 @@
-/**
- * File: CascadingConfiguration.java
- * License: etc/LICENSE.TXT
- * Copyright: Copyright (C) The Apache Software Foundation. All rights reserved.
- * Copyright: OSM SARL 2001-2002, All Rights Reserved.
+/*
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
+ *
+ * This software is published under the terms of the Apache Software License
+ * version 1.1, a copy of which has been included with this distribution in
+ * the LICENSE.TXT file.
+ *
+ * Original contribution by OSM SARL, http://www.osm.net
*/
package org.apache.avalon.excalibur.configuration;
1.6 +15 -7 jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/ServiceLoader.java
Index: ServiceLoader.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/ServiceLoader.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ServiceLoader.java 6 Mar 2002 18:27:54 -0000 1.5
+++ ServiceLoader.java 9 Mar 2002 04:50:21 -0000 1.6
@@ -276,21 +276,17 @@
catch( PipelineException e )
{
System.err.println( e );
+ if( pipeline != null ) pipeline.dispose();
}
catch( PipelineRuntimeException e )
{
System.err.println( e );
+ if( pipeline != null ) pipeline.dispose();
}
catch( Throwable e )
{
ExceptionUtil.printStackTrace( e, true );
- }
- finally
- {
- if( pipeline != null )
- {
- pipeline.dispose();
- }
+ if( pipeline != null ) pipeline.dispose();
}
}
@@ -464,6 +460,8 @@
{
public void run()
{
+ if( getVerbose() && (getLogger() != null) && getLogger().isDebugEnabled() )
+ getLogger().debug("shutdown hook");
terminate();
dispose();
}
@@ -479,6 +477,7 @@
if( m_terminated ) return;
m_terminated = true;
if( m_object == null ) return;
+
if( getVerbose() && getLogger().isDebugEnabled() ) getLogger().debug(
"terminating " + m_object.getClass().getName() );
@@ -809,6 +808,15 @@
public Priority getLoggingPriority()
{
return m_priority;
+ }
+
+ /**
+ * Returns the disposal policy.
+ * @return boolean the disposal policy.
+ */
+ public boolean getDisposalPolicy()
+ {
+ return m_policy;
}
}
}
1.6 +43 -3 jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/avalon/excalibur/service/package.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- package.html 6 Mar 2002 18:27:54 -0000 1.5
+++ package.html 9 Mar 2002 04:50:21 -0000 1.6
@@ -37,8 +37,44 @@
org.apache.avalon.excalibur.service.ServiceLoader
<supporting-jar-files> -target <class-name>
</pre>
- </ul>
+ <p><strong>Ant task</strong></p>
+ <p>Execution of Merlin as an Ant task requires the presence
+ of the following files under the ${ant.home}/lib directory:</p>
+ <ul>
+ <li><code>merlin.jar</code>
+ <li><code>avalon-framework.jar</code>
+ <li><code>logkit.jar</code>
+ </ul>
+ <p>An example load task is included below:</p>
+ <pre>
+ <task name="my-task">
+ <font color="blue"><i><!--
+ Declare the ant task.
+ --></i></font>
+
+ <taskdef resource="merlin.properties"/>
+
+ <font color="blue"><i><!--
+ Invoke the loading of a target and supporting services.
+ --></i></font>
+
+ <load target="org.apache.demo.ReferralBlock" priority="DEBUG"
+ disposal="true" verbose="false">
+
+ <font color="blue"><i><!--
+ For all of the jar files in the fileset, load the jar file
+ into the service classloader.
+ --></i></font>
+
+ <fileset dir="${dist}">
+ <include name="examples.jar"/>
+ </fileset>
+
+ </load>
+
+ </task">
+ </pre>
</td></tr>
</table>
@@ -161,10 +197,14 @@
<font color="blue"><i><!--
The default configuration for a component is declared under the <strong>configuration</strong>
element. This configuration value may be modified and/or supplimented by a
- configuration supplied by a managing container.
+ configuration supplied by a managing container. If the <strong>configuration</strong>
+ elements includes the <string>extends</string> attribute, the configuration will be created
+ as a <code>CascadingConfiguration<code> where the default configuration is a resource derived
+ from the extends path value and the primary configuration will be the content of the
+ configuration element.
--></i></font>
- <configuration extends=org/apache/"copyright.xml">
+ <configuration extends=org/apache/"credits.xml">
<about>Example default configuration for this component.</about>
</configuration>
1.4 +1 -1 jakarta-avalon-apps/enterprise/tools/src/java/org/apache/demo/DirectoryBlock.xinfo
Index: DirectoryBlock.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/demo/DirectoryBlock.xinfo,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DirectoryBlock.xinfo 6 Mar 2002 18:27:54 -0000 1.3
+++ DirectoryBlock.xinfo 9 Mar 2002 04:50:21 -0000 1.4
@@ -29,7 +29,7 @@
<implementation policy="SINGLETON" />
- <configuration extends="org/apache/demo/copyright.xml">
+ <configuration extends="org/apache/demo/credits.xml">
<about>Demonstration singleton block.</about>
<policy value="LIST"/>
</configuration>
1.3 +1 -1 jakarta-avalon-apps/enterprise/tools/src/java/org/apache/demo/ReferralBlock.xinfo
Index: ReferralBlock.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/tools/src/java/org/apache/demo/ReferralBlock.xinfo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ReferralBlock.xinfo 6 Mar 2002 18:27:54 -0000 1.2
+++ ReferralBlock.xinfo 9 Mar 2002 04:50:21 -0000 1.3
@@ -33,7 +33,7 @@
</dependency>
</dependencies>
- <configuration extends="org/apache/demo/copyright.xml">
+ <configuration extends="org/apache/demo/credits.xml">
<about>Demonstration composite block.</about>
</configuration>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>