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 2004/02/14 22:33:57 UTC
cvs commit: avalon/merlin/platform/xdocs/meta/kernel index.xml navigation.xml
mcconnell 2004/02/14 13:33:57
Modified: merlin external.xml maven.xml project.properties
merlin/activation/api/src/java/org/apache/avalon/activation
TransientApplianceException.java
merlin/activation/csi/src/java/org/apache/avalon/activation/csi
AbstractLifestyleManager.java
SecureComponentFactory.java
SecureInvocationHandler.java
SecureLifestyleFactory.java
SingletonLifestyleManager.java
ThreadLifestyleManager.java
TransientLifestyleManager.java package.html
merlin/activation/impl/src/java/org/apache/avalon/activation/impl
AbstractLifestyleManager.java
ApplianceInvocationHandler.java
DefaultComponentFactory.java
DefaultLifestyleFactory.java
SingletonLifestyleManager.java
ThreadLifestyleManager.java
TransientLifestyleManager.java
merlin/composition/api/src/java/org/apache/avalon/composition/data
SelectionDirective.java
merlin/composition/api/src/java/org/apache/avalon/composition/model
TransientRuntimeException.java
merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
DefaultContainmentModel.java
DefaultSystemContext.java StandardModelFactory.java
merlin/composition/spi/src/java/org/apache/avalon/composition/provider
SystemContext.java
merlin/kernel/api/src/java/org/apache/avalon/merlin
KernelCriteria.java
merlin/kernel/cli/src/java/org/apache/avalon/merlin/cli
Main.java
merlin/kernel/impl maven.xml project.properties
merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl
DefaultCriteria.java DefaultFactory.java
package.html
merlin/platform/xdocs/merlin/kernel properties.xml
merlin/platform/xdocs/meta/kernel index.xml navigation.xml
Added: merlin/composition/impl/src/test/org/apache/avalon/composition/model/test
ContextTestCase.java DependencyTestCase.java
IncludesTestCase.java TargetsTestCase.java
Log:
Cleaning up javadoc - updating api (classloader ref method names), addition of lifecycle extension access/relase hooks into lifestyle handler.
Revision Changes Path
1.2 +5 -0 avalon/merlin/external.xml
Index: external.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/external.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- external.xml 10 Feb 2004 18:11:47 -0000 1.1
+++ external.xml 14 Feb 2004 21:33:55 -0000 1.2
@@ -20,6 +20,11 @@
<version>1.2</version>
</dependency>
<dependency>
+ <groupId>avalon-repository</groupId>
+ <artifactId>avalon-repository-cli</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>avalon-logging</groupId>
<artifactId>avalon-logkit-api</artifactId>
<version>1.0-SNAPSHOT</version>
1.51 +122 -33 avalon/merlin/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/maven.xml,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- maven.xml 10 Feb 2004 19:52:05 -0000 1.50
+++ maven.xml 14 Feb 2004 21:33:55 -0000 1.51
@@ -18,6 +18,7 @@
<ant:property name="meta.plugin.version" value="1.4-SNAPSHOT"/>
<ant:property name="merlin.cli.version" value="3.3-SNAPSHOT"/>
<ant:property name="merlin.plugin.version" value="3.3-SNAPSHOT"/>
+ <ant:property name="repository.cli.version" value="1.3-SNAPSHOT"/>
<!--
==============================================================================
@@ -95,35 +96,71 @@
ignoreFailures="false"
postProcessing="true" />
<j:forEach var="child" items="${reactorProjects}">
- <ant:copy todir="${maven.build.dir}/merlin/system/${child.groupId}/jars"
+ <j:set var="dir"
+ value="${maven.build.dir}/merlin/system"/>
+ <j:set var="path"
+ value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:copy todir="${dir}/${child.groupId}/jars"
preserveLastModified="true">
- <ant:fileset dir="${child.file.parentFile}/target">
- <ant:include
+ <ant:fileset dir="${child.file.parentFile}/target">
+ <ant:include
name="${child.artifactId}-${child.currentVersion}.jar"/>
- <ant:include
+ <ant:include
name="${child.artifactId}-${child.currentVersion}.jar.meta"/>
+ </ant:fileset>
+ </ant:copy>
+ <checksum file="${path}"/>
+ <j:if test="${maven_gpg_exe != null}">
+ <ant:exec executable="${maven_gpg_exe}">
+ <ant:arg value="-a"/>
+ <ant:arg value="--yes"/>
+ <ant:arg value="-b"/>
+ <ant:arg value="${path}"/>
+ </ant:exec>
+ </j:if>
+ <j:set var="deps" value="${child.dependencies}"/>
+ <j:forEach var="dep" items="${deps}">
+ <ant:copy todir="${maven.build.dir}/merlin/system"
+ preserveLastModified="true">
+ <ant:fileset dir="${maven.repo.local}">
+ <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}"/>
</ant:fileset>
</ant:copy>
- <j:set var="deps" value="${child.dependencies}"/>
- <j:forEach var="dep" items="${deps}">
- <ant:copy todir="${maven.build.dir}/merlin/system"
- preserveLastModified="true">
- <ant:fileset dir="${maven.repo.local}">
- <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}"/>
- </ant:fileset>
- </ant:copy>
- </j:forEach>
+ </j:forEach>
</j:forEach>
</goal>
<goal name="avalon:build-kernel">
<maven:reactor basedir="${basedir}"
- includes="kernel/unit/project.xml,kernel/cli/project.xml,kernel/servlet/project.xml"
+ includes="kernel/unit/project.xml,kernel/cli/project.xml"
goals="jar:install"
banner="Installing:"
ignoreFailures="false"
postProcessing="true" />
<j:forEach var="child" items="${reactorProjects}">
+ <j:set var="dir"
+ value="${maven.build.dir}/merlin/system"/>
+ <j:set var="path"
+ value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:copy todir="${dir}/${child.groupId}/jars"
+ preserveLastModified="true">
+ <ant:fileset dir="${child.file.parentFile}/target">
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.jar.meta"/>
+ </ant:fileset>
+ </ant:copy>
+ <checksum file="${path}"/>
+ <j:if test="${maven_gpg_exe != null}">
+ <ant:exec executable="${maven_gpg_exe}">
+ <ant:arg value="-a"/>
+ <ant:arg value="--yes"/>
+ <ant:arg value="-b"/>
+ <ant:arg value="${path}"/>
+ </ant:exec>
+ </j:if>
+ <!-- FIXME update the cli scripts to reference cli under the merlin.system repo -->
<j:if test="${child.artifactId == 'merlin-cli'}">
<ant:copy todir="${maven.build.dir}/merlin/bin/lib"
preserveLastModified="true">
@@ -144,13 +181,35 @@
ignoreFailures="false"
postProcessing="true" />
<j:forEach var="child" items="${reactorProjects}">
- <ant:copy todir="${maven.build.dir}/merlin/plugins/"
+ <j:set var="dir"
+ value="${maven.build.dir}/merlin/system"/>
+ <j:set var="path"
+ value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:copy todir="${dir}/${child.groupId}/jars"
preserveLastModified="true">
- <ant:fileset dir="${child.file.parentFile}/target">
+ <ant:fileset dir="${child.file.parentFile}/target">
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.jar.meta"/>
+ </ant:fileset>
+ </ant:copy>
+ <checksum file="${path}"/>
+ <j:if test="${maven_gpg_exe != null}">
+ <ant:exec executable="${maven_gpg_exe}">
+ <ant:arg value="-a"/>
+ <ant:arg value="--yes"/>
+ <ant:arg value="-b"/>
+ <ant:arg value="${path}"/>
+ </ant:exec>
+ </j:if>
+ <ant:copy todir="${maven.build.dir}/merlin/plugins/"
+ preserveLastModified="true">
+ <ant:fileset dir="${child.file.parentFile}/target">
<ant:include
name="${child.artifactId}-${child.currentVersion}.jar"/>
- </ant:fileset>
- </ant:copy>
+ </ant:fileset>
+ </ant:copy>
</j:forEach>
<ant:copy file="${maven.plugin.dir}/${meta.plugin.jar}"
toDir="${maven.build.dir}/merlin/plugins"/>
@@ -168,24 +227,46 @@
postProcessing="true" />
<j:forEach var="child" items="${reactorProjects}">
- <ant:copy todir="${maven.build.dir}/merlin/system/${child.groupId}/${child.type}s"
+ <j:set var="dir"
+ value="${maven.build.dir}/merlin/system"/>
+ <j:set var="path"
+ value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:copy todir="${dir}/${child.groupId}/jars"
preserveLastModified="true">
- <ant:fileset dir="${child.file.parentFile}/target">
- <ant:include
- name="${child.artifactId}-${child.currentVersion}.${child.type}"/>
- <ant:include
- name="${child.artifactId}-${child.currentVersion}.${child.type}.meta"/>
+ <ant:fileset dir="${child.file.parentFile}/target">
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.jar"/>
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.jar.meta"/>
+ </ant:fileset>
+ </ant:copy>
+ <checksum file="${path}"/>
+ <j:if test="${maven_gpg_exe != null}">
+ <ant:exec executable="${maven_gpg_exe}">
+ <ant:arg value="-a"/>
+ <ant:arg value="--yes"/>
+ <ant:arg value="-b"/>
+ <ant:arg value="${path}"/>
+ </ant:exec>
+ </j:if>
+ <ant:copy todir="${maven.build.dir}/merlin/system/${child.groupId}/${child.type}s"
+ preserveLastModified="true">
+ <ant:fileset dir="${child.file.parentFile}/target">
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.${child.type}"/>
+ <ant:include
+ name="${child.artifactId}-${child.currentVersion}.${child.type}.meta"/>
+ </ant:fileset>
+ </ant:copy>
+ <j:set var="deps" value="${child.dependencies}"/>
+ <j:forEach var="dep" items="${deps}">
+ <ant:copy todir="${maven.build.dir}/merlin/system"
+ preserveLastModified="true">
+ <ant:fileset dir="${maven.repo.local}">
+ <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}"/>
</ant:fileset>
</ant:copy>
- <j:set var="deps" value="${child.dependencies}"/>
- <j:forEach var="dep" items="${deps}">
- <ant:copy todir="${maven.build.dir}/merlin/system"
- preserveLastModified="true">
- <ant:fileset dir="${maven.repo.local}">
- <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}"/>
- </ant:fileset>
- </ant:copy>
- </j:forEach>
+ </j:forEach>
</j:forEach>
</goal>
@@ -240,6 +321,12 @@
<exclude name="bin/**/*.exe"/>
<exclude name="bin/**/*.dll"/>
</fileset>
+ <fileset dir="${basedir}/kernel/cli/src">
+ <include name="bin/**/*"/>
+ <exclude name="bin/**/*.jar"/>
+ <exclude name="bin/**/*.exe"/>
+ <exclude name="bin/**/*.dll"/>
+ </fileset>
<fileset dir="${basedir}">
<include name="README.TXT"/>
</fileset>
@@ -247,6 +334,7 @@
<filter token="VERSION" value="${pom.currentVersion}"/>
<filter token="MERLIN_CLI_JAR" value="${merlin.cli.jar}"/>
<filter token="MERLIN_CLI_VERSION" value="${merlin.cli.version}"/>
+ <filter token="AVALON_CLI_VERSION" value="${repository.cli.version}"/>
</filterset>
</ant:copy>
<ant:copy toDir="${merlin.build.inst.dir}">
@@ -458,6 +546,7 @@
<link href="${avalon.repository.link}" />
<link href="${avalon.util.link}" />
<link href="${avalon.logkit.link}" />
+ <link href="${avalon.logging.link}" />
<!--<link href="${avalon.lifecycle.link}" />-->
<link href="${excalibur.configuration.link}" />
1.9 +2 -1 avalon/merlin/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/avalon/merlin/project.properties,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- project.properties 10 Feb 2004 16:31:16 -0000 1.8
+++ project.properties 14 Feb 2004 21:33:55 -0000 1.9
@@ -49,6 +49,7 @@
avalon.repository.link = http://avalon.apache.org/repository/api/
avalon.util.link = http://avalon.apache.org/util/api/
avalon.logkit.link = http://avalon.apache.org/logkit/api/
+avalon.logging.link = http://avalon.apache.org/logging/api/
avalon.lifecycle.link = http://avalon.apache.org/excalibur/lifecycle/api/
excalibur.configuration.link = http://avalon.apache.org/excalibur/configuration/apidocs/
excalibur.i18n.link = http://avalon.apache.org/excalibur/i18n/apidocs/
@@ -57,4 +58,4 @@
excalibur.threadcontext.link = http://avalon.apache.org/excalibur/threadcontext/api/
excalibur.event.link = http://avalon.apache.org/excalibur/event/api/
-maven.javadoc.links = ${sun.j2se.link},${avalon.logkit.link},${avalon.framework.link},${avalon.meta.link},${avalon.lifecycle.link},${excalibur.configuration.link},${excalibur.i18n.link},${excalibur.pool.link},${excalibur.thread.link},${excalibur.threadcontext.link},${excalibur.event.link},${sun.jmx.link}
+maven.javadoc.links = ${sun.j2se.link},${avalon.logkit.link},${avalon.logging.link},${avalon.framework.link},${avalon.meta.link},${avalon.lifecycle.link},${excalibur.configuration.link},${excalibur.i18n.link},${excalibur.pool.link},${excalibur.thread.link},${excalibur.threadcontext.link},${excalibur.event.link},${sun.jmx.link}
1.2 +3 -4 avalon/merlin/activation/api/src/java/org/apache/avalon/activation/TransientApplianceException.java
Index: TransientApplianceException.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/api/src/java/org/apache/avalon/activation/TransientApplianceException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TransientApplianceException.java 12 Feb 2004 00:23:21 -0000 1.1
+++ TransientApplianceException.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -40,9 +40,8 @@
/**
* Construct a new <code>TransientApplianceException</code> instance.
*
- * @param delay the expected dalay
- * @param cause the root cause of the exception
* @param message the exception message
+ * @param delay the expected dalay
*/
public TransientApplianceException( String message, long delay )
{
@@ -53,7 +52,7 @@
* Construct a new <code>TransientApplianceException</code> instance.
*
* @param message the exception message
- * @param throwable the root cause of the exception
+ * @param cause the root cause of the exception
* @param delay the projected delay
*/
public TransientApplianceException( String message, Throwable cause, long delay )
1.2 +121 -6 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/AbstractLifestyleManager.java
Index: AbstractLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/AbstractLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractLifestyleManager.java 10 Feb 2004 16:14:10 -0000 1.1
+++ AbstractLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -22,13 +22,24 @@
import java.lang.ref.WeakReference;
import java.lang.ref.ReferenceQueue;
+import org.apache.avalon.activation.LifecycleException;
import org.apache.avalon.activation.LifestyleManager;
import org.apache.avalon.activation.ComponentFactory;
import org.apache.avalon.composition.model.ComponentModel;
+import org.apache.avalon.composition.model.DeploymentModel;
+import org.apache.avalon.composition.model.StageModel;
+
+import org.apache.avalon.excalibur.i18n.ResourceManager;
+import org.apache.avalon.excalibur.i18n.Resources;
+
+import org.apache.avalon.lifecycle.Accessor;
import org.apache.avalon.meta.info.InfoDescriptor;
+import org.apache.avalon.meta.info.StageDescriptor;
+
import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.context.Context;
/**
* Abstract implentation class for a lifestyle handler.
@@ -39,6 +50,13 @@
public abstract class AbstractLifestyleManager implements LifestyleManager
{
//-------------------------------------------------------------------
+ // static
+ //-------------------------------------------------------------------
+
+ private static final Resources REZ =
+ ResourceManager.getPackageResources( AbstractLifestyleManager.class );
+
+ //-------------------------------------------------------------------
// immutable state
//-------------------------------------------------------------------
@@ -56,13 +74,13 @@
/**
* Creation of a new instance.
- * @param logger the logging channel
+ * @param model the component model
+ * @param factory the component factory
*/
public AbstractLifestyleManager( ComponentModel model, ComponentFactory factory )
{
m_factory = factory;
m_model = model;
-
m_logger = model.getLogger();
}
@@ -93,14 +111,31 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public abstract Object resolve() throws Exception;
+ public Object resolve() throws Exception
+ {
+ Object instance = handleResolve();
+ return applyExtensionStages( instance, true );
+ }
/**
* Release an object
*
* @param instance the object to be released
*/
- public abstract void release( Object instance );
+ public void release( Object instance )
+ {
+ try
+ {
+ applyExtensionStages( instance, false );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Ignoring error returned from release extension.";
+ getLogger().error( error, e );
+ }
+ handleRelease( instance );
+ }
//-------------------------------------------------------------------
// LifecycleManager
@@ -121,6 +156,11 @@
// implementation
//-------------------------------------------------------------------
+ protected abstract Object handleResolve() throws Exception;
+
+ protected abstract void handleRelease( Object instance );
+
+
protected Logger getLogger()
{
return m_logger;
@@ -177,8 +217,83 @@
}
}
+ private Object applyExtensionStages( Object instance, boolean flag )
+ throws Exception
+ {
+ StageDescriptor[] stages = m_model.getType().getStages();
+ for( int i=0; i<stages.length; i++ )
+ {
+ StageDescriptor descriptor = stages[i];
+ StageModel stage = m_model.getStageModel( descriptor );
+
+ ComponentModel provider = getStageProvider( stage );
+ Class c = provider.getDeploymentClass();
+
+ if( Accessor.class.isAssignableFrom( c ) )
+ {
+ Accessor handler = (Accessor) provider.resolve();
+ try
+ {
+ Context context = m_model.getContextModel().getContext();
+ if( flag )
+ {
+ if( getLogger().isDebugEnabled() )
+ {
+ int id = System.identityHashCode( instance );
+ getLogger().debug( "applying access stage to: " + id );
+ }
+ handler.access( instance, context );
+ }
+ else
+ {
+ if( getLogger().isDebugEnabled() )
+ {
+ int id = System.identityHashCode( instance );
+ getLogger().debug( "applying release stage to: " + id );
+ }
+ handler.release( instance, context );
+ }
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ REZ.getString(
+ "lifecycle.stage.accessor.error",
+ stage.getStage().getKey() );
+ if( flag )
+ {
+ throw new LifecycleException( error, e );
+ }
+ else
+ {
+ getLogger().warn( error, e );
+ }
+ }
+ finally
+ {
+ provider.release( handler );
+ }
+ }
+ }
+ return instance;
+ }
+
+ private ComponentModel getStageProvider( StageModel stage ) throws LifecycleException
+ {
+ try
+ {
+ return (ComponentModel) stage.getProvider();
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unable to resolve access stage provider.";
+ throw new LifecycleException( error, e );
+ }
+ }
+
//-------------------------------------------------------------------
- // implementation
+ // Object
//-------------------------------------------------------------------
public void finalize()
1.2 +47 -48 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureComponentFactory.java
Index: SecureComponentFactory.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureComponentFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SecureComponentFactory.java 10 Feb 2004 16:14:14 -0000 1.1
+++ SecureComponentFactory.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -129,10 +129,55 @@
}
/**
+ * Termination of the instance including all end-of-life processing.
+ * @param instance the component instance
+ */
+ public void etherialize( Object instance )
+ {
+ try
+ {
+ applyCreateStage( instance, false );
+ }
+ catch( Throwable e )
+ {
+ // will not happen
+ }
+ finally
+ {
+ try
+ {
+ ContainerUtil.shutdown( instance );
+ }
+ catch( Throwable e )
+ {
+ if( getLogger().isWarnEnabled() )
+ {
+ final String warning =
+ "Ignoring component source shutdown error.";
+ getLogger().warn( warning, e );
+ }
+ }
+ }
+ }
+
+ //-------------------------------------------------------------------
+ // protected implementation
+ //-------------------------------------------------------------------
+
+ protected Logger getLogger()
+ {
+ return m_logger;
+ }
+
+ //-------------------------------------------------------------------
+ // private implementation
+ //-------------------------------------------------------------------
+
+ /**
* Creation of a new instance including all deployment stage handling.
* @return the new instance
*/
- public Object doIncarnation() throws LifecycleException
+ private Object doIncarnation() throws LifecycleException
{
Class clazz = m_model.getDeploymentClass();
Logger logger = m_model.getLogger();
@@ -181,52 +226,6 @@
throw new LifecycleException( error, e );
}
}
-
- /**
- * Termination of the instance including all end-of-life processing.
- * @param model the component model
- * @return the new instance
- */
- public void etherialize( Object instance )
- {
- try
- {
- applyCreateStage( instance, false );
- }
- catch( Throwable e )
- {
- // will not happen
- }
- finally
- {
- try
- {
- ContainerUtil.shutdown( instance );
- }
- catch( Throwable e )
- {
- if( getLogger().isWarnEnabled() )
- {
- final String warning =
- "Ignoring component source shutdown error.";
- getLogger().warn( warning, e );
- }
- }
- }
- }
-
- //-------------------------------------------------------------------
- // protected implementation
- //-------------------------------------------------------------------
-
- protected Logger getLogger()
- {
- return m_logger;
- }
-
- //-------------------------------------------------------------------
- // private implementation
- //-------------------------------------------------------------------
private Object instantiate(
Class clazz, Logger logger, Configuration config, Parameters params,
1.3 +3 -2 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureInvocationHandler.java
Index: SecureInvocationHandler.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureInvocationHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SecureInvocationHandler.java 12 Feb 2004 05:59:41 -0000 1.2
+++ SecureInvocationHandler.java 14 Feb 2004 21:33:55 -0000 1.3
@@ -65,7 +65,8 @@
/**
* Create a proxy invocation handler.
*
- * @param instance the underlying provider
+ * @param appliance the runtime appliance
+ * @param logger the assigned logging channel
*/
protected SecureInvocationHandler( SecureAppliance appliance, Logger logger )
{
1.2 +8 -3 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureLifestyleFactory.java
Index: SecureLifestyleFactory.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureLifestyleFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SecureLifestyleFactory.java 10 Feb 2004 16:14:15 -0000 1.1
+++ SecureLifestyleFactory.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -63,8 +63,7 @@
/**
* Create a new lifestyle manager.
* @param model the component model
- * @param factory the component factory
- * @return the runtime appliance
+ * @return the lifestyle manager
*/
public LifestyleManager createLifestyleManager( ComponentModel model )
{
@@ -73,6 +72,12 @@
return createLifestyleManager( model, factory );
}
+ /**
+ * Create a new lifestyle manager.
+ * @param model the component model
+ * @param factory the component factory
+ * @return the lifestyle manager
+ */
protected LifestyleManager createLifestyleManager(
ComponentModel model, ComponentFactory factory )
{
1.2 +3 -5 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SingletonLifestyleManager.java
Index: SingletonLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SingletonLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SingletonLifestyleManager.java 10 Feb 2004 16:14:22 -0000 1.1
+++ SingletonLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -85,7 +85,7 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public synchronized Object resolve() throws Exception
+ protected synchronized Object handleResolve() throws Exception
{
Object instance = null;
@@ -111,9 +111,8 @@
* Release an object
*
* @param instance the object to be released
- * @param finalized if TRUE the lifestyle handler cannot reuse the instance
*/
- public synchronized void release( Object instance )
+ protected synchronized void handleRelease( Object instance )
{
// continue with the current singleton reference
}
@@ -126,7 +125,6 @@
* Release an object
*
* @param instance the object to be released
- * @param finalized if TRUE the lifestyle handler cannot reuse the instance
*/
public synchronized void finalize( Object instance )
{
1.2 +4 -4 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/ThreadLifestyleManager.java
Index: ThreadLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/ThreadLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ThreadLifestyleManager.java 10 Feb 2004 16:14:22 -0000 1.1
+++ ThreadLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -17,8 +17,8 @@
package org.apache.avalon.activation.csi;
-import org.apache.avalon.activation.ComponentFactory;
import org.apache.avalon.activation.LifestyleRuntimeException;
+import org.apache.avalon.activation.ComponentFactory;
import org.apache.avalon.composition.model.ComponentModel;
@@ -123,7 +123,7 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public Object resolve() throws Exception
+ protected Object handleResolve() throws Exception
{
if( m_local == null )
{
@@ -138,7 +138,7 @@
*
* @param instance the object to be reclaimed
*/
- public void release( Object instance )
+ protected void handleRelease( Object instance )
{
// don't release because this is a shared reference
}
1.2 +3 -4 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/TransientLifestyleManager.java
Index: TransientLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/TransientLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TransientLifestyleManager.java 10 Feb 2004 16:14:22 -0000 1.1
+++ TransientLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -91,7 +91,7 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public Object resolve() throws Exception
+ protected Object handleResolve() throws Exception
{
Object instance = getComponentFactory().incarnate();
Reference reference = getReference( instance );
@@ -103,9 +103,8 @@
* Release an object
*
* @param instance the object to be released
- * @param finalized if TRUE the lifestyle handler cannot reuse the instance
*/
- public void release( Object instance )
+ protected void handleRelease( Object instance )
{
finalize( instance );
}
1.2 +2 -7 avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package.html 10 Feb 2004 16:14:10 -0000 1.1
+++ package.html 14 Feb 2004 21:33:55 -0000 1.2
@@ -1,9 +1,4 @@
<body>
-<p>The <code>appliance</code> package contains interfaces, utilities and
-default implementations defining and enabling use of the central
-{@link org.apache.avalon.activation.appliance.Appliance} interface. An
-Appliance is the basic tool merlin wraps around a component to provide
-support for lifecycle and lifestyle management. Different implementations
-of Appliance can be plugged into the merlin system to allow merlin to
-manage a variety of components.</p>
+<p>The <code>csi</code> package contains
+code-secure implementation of the activation system.</p>
</body>
1.3 +120 -5 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/AbstractLifestyleManager.java
Index: AbstractLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/AbstractLifestyleManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractLifestyleManager.java 12 Feb 2004 05:59:41 -0000 1.2
+++ AbstractLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.3
@@ -22,14 +22,24 @@
import java.lang.ref.WeakReference;
import java.lang.ref.ReferenceQueue;
+import org.apache.avalon.activation.LifecycleException;
import org.apache.avalon.activation.LifestyleManager;
import org.apache.avalon.activation.ComponentFactory;
import org.apache.avalon.composition.model.ComponentModel;
+import org.apache.avalon.composition.model.DeploymentModel;
+import org.apache.avalon.composition.model.StageModel;
+
+import org.apache.avalon.excalibur.i18n.ResourceManager;
+import org.apache.avalon.excalibur.i18n.Resources;
+
+import org.apache.avalon.lifecycle.Accessor;
import org.apache.avalon.meta.info.InfoDescriptor;
+import org.apache.avalon.meta.info.StageDescriptor;
import org.apache.avalon.framework.logger.Logger;
+import org.apache.avalon.framework.context.Context;
/**
* Abstract implentation class for a lifestyle handler.
@@ -40,6 +50,13 @@
public abstract class AbstractLifestyleManager implements LifestyleManager
{
//-------------------------------------------------------------------
+ // static
+ //-------------------------------------------------------------------
+
+ private static final Resources REZ =
+ ResourceManager.getPackageResources( AbstractLifestyleManager.class );
+
+ //-------------------------------------------------------------------
// immutable state
//-------------------------------------------------------------------
@@ -57,7 +74,8 @@
/**
* Creation of a new instance.
- * @param logger the logging channel
+ * @param model the component model
+ * @param factory the component factory
*/
public AbstractLifestyleManager( ComponentModel model, ComponentFactory factory )
{
@@ -93,14 +111,31 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public abstract Object resolve() throws Exception;
+ public Object resolve() throws Exception
+ {
+ Object instance = handleResolve();
+ return applyExtensionStages( instance, true );
+ }
/**
* Release an object
*
* @param instance the object to be released
*/
- public abstract void release( Object instance );
+ public void release( Object instance )
+ {
+ try
+ {
+ applyExtensionStages( instance, false );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Ignoring error returned from release extension.";
+ getLogger().error( error, e );
+ }
+ handleRelease( instance );
+ }
//-------------------------------------------------------------------
// LifecycleManager
@@ -121,6 +156,11 @@
// implementation
//-------------------------------------------------------------------
+ protected abstract Object handleResolve() throws Exception;
+
+ protected abstract void handleRelease( Object instance );
+
+
protected Logger getLogger()
{
return m_logger;
@@ -177,8 +217,83 @@
}
}
+ private Object applyExtensionStages( Object instance, boolean flag )
+ throws Exception
+ {
+ StageDescriptor[] stages = m_model.getType().getStages();
+ for( int i=0; i<stages.length; i++ )
+ {
+ StageDescriptor descriptor = stages[i];
+ StageModel stage = m_model.getStageModel( descriptor );
+
+ ComponentModel provider = getStageProvider( stage );
+ Class c = provider.getDeploymentClass();
+
+ if( Accessor.class.isAssignableFrom( c ) )
+ {
+ Accessor handler = (Accessor) provider.resolve();
+ try
+ {
+ Context context = m_model.getContextModel().getContext();
+ if( flag )
+ {
+ if( getLogger().isDebugEnabled() )
+ {
+ int id = System.identityHashCode( instance );
+ getLogger().debug( "applying access stage to: " + id );
+ }
+ handler.access( instance, context );
+ }
+ else
+ {
+ if( getLogger().isDebugEnabled() )
+ {
+ int id = System.identityHashCode( instance );
+ getLogger().debug( "applying release stage to: " + id );
+ }
+ handler.release( instance, context );
+ }
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ REZ.getString(
+ "lifecycle.stage.accessor.error",
+ stage.getStage().getKey() );
+ if( flag )
+ {
+ throw new LifecycleException( error, e );
+ }
+ else
+ {
+ getLogger().warn( error, e );
+ }
+ }
+ finally
+ {
+ provider.release( handler );
+ }
+ }
+ }
+ return instance;
+ }
+
+ private ComponentModel getStageProvider( StageModel stage ) throws LifecycleException
+ {
+ try
+ {
+ return (ComponentModel) stage.getProvider();
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unable to resolve access stage provider.";
+ throw new LifecycleException( error, e );
+ }
+ }
+
//-------------------------------------------------------------------
- // implementation
+ // Object
//-------------------------------------------------------------------
public void finalize()
1.3 +3 -2 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/ApplianceInvocationHandler.java
Index: ApplianceInvocationHandler.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/ApplianceInvocationHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ApplianceInvocationHandler.java 12 Feb 2004 05:59:41 -0000 1.2
+++ ApplianceInvocationHandler.java 14 Feb 2004 21:33:55 -0000 1.3
@@ -65,7 +65,8 @@
/**
* Create a proxy invocation handler.
*
- * @param instance the underlying provider
+ * @param appliance the runtime appliance
+ * @param logger the assigned logging channel
*/
protected ApplianceInvocationHandler( DefaultAppliance appliance, Logger logger )
{
1.2 +59 -53 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/DefaultComponentFactory.java
Index: DefaultComponentFactory.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/DefaultComponentFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultComponentFactory.java 10 Feb 2004 16:19:15 -0000 1.1
+++ DefaultComponentFactory.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -88,6 +88,11 @@
// constructor
//-------------------------------------------------------------------
+ /**
+ * Creation of a new component factory.
+ * @param system the system context
+ * @param model the component model
+ */
public DefaultComponentFactory( SystemContext system, ComponentModel model )
{
m_system = system;
@@ -100,16 +105,9 @@
// ComponentFactory
//-------------------------------------------------------------------
- private Context getTargetContext()
- {
- ContextModel model = m_model.getContextModel();
- if( null == model ) return null;
- return model.getContext();
- }
-
/**
* Creation of a new instance including all deployment stage handling.
- * @return the new instance
+ * @return the new incarnated instance
*/
public Object incarnate() throws LifecycleException
{
@@ -128,11 +126,58 @@
}
}
+
+ /**
+ * Termination of the instance including all end-of-life processing.
+ * @param instance the component instance to etherialize
+ * @return the new instance
+ */
+ public void etherialize( Object instance )
+ {
+ try
+ {
+ applyCreateStage( instance, false );
+ }
+ catch( Throwable e )
+ {
+ // will not happen
+ }
+ finally
+ {
+ try
+ {
+ ContainerUtil.shutdown( instance );
+ }
+ catch( Throwable e )
+ {
+ if( getLogger().isWarnEnabled() )
+ {
+ final String warning =
+ "Ignoring component source shutdown error.";
+ getLogger().warn( warning, e );
+ }
+ }
+ }
+ }
+
+ //-------------------------------------------------------------------
+ // protected implementation
+ //-------------------------------------------------------------------
+
+ protected Logger getLogger()
+ {
+ return m_logger;
+ }
+
+ //-------------------------------------------------------------------
+ // private implementation
+ //-------------------------------------------------------------------
+
/**
* Creation of a new instance including all deployment stage handling.
* @return the new instance
*/
- public Object doIncarnation() throws LifecycleException
+ private Object doIncarnation() throws LifecycleException
{
Class clazz = m_model.getDeploymentClass();
Logger logger = m_model.getLogger();
@@ -182,51 +227,12 @@
}
}
- /**
- * Termination of the instance including all end-of-life processing.
- * @param model the component model
- * @return the new instance
- */
- public void etherialize( Object instance )
- {
- try
- {
- applyCreateStage( instance, false );
- }
- catch( Throwable e )
- {
- // will not happen
- }
- finally
- {
- try
- {
- ContainerUtil.shutdown( instance );
- }
- catch( Throwable e )
- {
- if( getLogger().isWarnEnabled() )
- {
- final String warning =
- "Ignoring component source shutdown error.";
- getLogger().warn( warning, e );
- }
- }
- }
- }
-
- //-------------------------------------------------------------------
- // protected implementation
- //-------------------------------------------------------------------
-
- protected Logger getLogger()
+ private Context getTargetContext()
{
- return m_logger;
+ ContextModel model = m_model.getContextModel();
+ if( null == model ) return null;
+ return model.getContext();
}
-
- //-------------------------------------------------------------------
- // private implementation
- //-------------------------------------------------------------------
private Object instantiate(
Class clazz, Logger logger, Configuration config, Parameters params,
1.2 +8 -3 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/DefaultLifestyleFactory.java
Index: DefaultLifestyleFactory.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/DefaultLifestyleFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultLifestyleFactory.java 10 Feb 2004 16:19:15 -0000 1.1
+++ DefaultLifestyleFactory.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -63,8 +63,7 @@
/**
* Create a new lifestyle manager.
* @param model the component model
- * @param factory the component factory
- * @return the runtime appliance
+ * @return the lifestyle manager
*/
public LifestyleManager createLifestyleManager( ComponentModel model )
{
@@ -73,6 +72,12 @@
return createLifestyleManager( model, factory );
}
+ /**
+ * Create a new lifestyle manager.
+ * @param model the component model
+ * @param factory the component factory
+ * @return the lifestyle manager
+ */
protected LifestyleManager createLifestyleManager(
ComponentModel model, ComponentFactory factory )
{
1.2 +3 -5 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/SingletonLifestyleManager.java
Index: SingletonLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/SingletonLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SingletonLifestyleManager.java 10 Feb 2004 16:19:15 -0000 1.1
+++ SingletonLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -85,7 +85,7 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public synchronized Object resolve() throws Exception
+ protected synchronized Object handleResolve() throws Exception
{
Object instance = null;
@@ -111,9 +111,8 @@
* Release an object
*
* @param instance the object to be released
- * @param finalized if TRUE the lifestyle handler cannot reuse the instance
*/
- public synchronized void release( Object instance )
+ protected synchronized void handleRelease( Object instance )
{
// continue with the current singleton reference
}
@@ -126,7 +125,6 @@
* Release an object
*
* @param instance the object to be released
- * @param finalized if TRUE the lifestyle handler cannot reuse the instance
*/
public synchronized void finalize( Object instance )
{
1.2 +3 -3 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/ThreadLifestyleManager.java
Index: ThreadLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/ThreadLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ThreadLifestyleManager.java 10 Feb 2004 16:19:15 -0000 1.1
+++ ThreadLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -123,7 +123,7 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public Object resolve() throws Exception
+ protected Object handleResolve() throws Exception
{
if( m_local == null )
{
@@ -138,7 +138,7 @@
*
* @param instance the object to be reclaimed
*/
- public void release( Object instance )
+ protected void handleRelease( Object instance )
{
// don't release because this is a shared reference
}
1.2 +3 -4 avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/TransientLifestyleManager.java
Index: TransientLifestyleManager.java
===================================================================
RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/TransientLifestyleManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TransientLifestyleManager.java 10 Feb 2004 16:19:15 -0000 1.1
+++ TransientLifestyleManager.java 14 Feb 2004 21:33:55 -0000 1.2
@@ -91,7 +91,7 @@
* @return the resolved object
* @throws Exception if an error occurs
*/
- public Object resolve() throws Exception
+ protected Object handleResolve() throws Exception
{
Object instance = getComponentFactory().incarnate();
Reference reference = getReference( instance );
@@ -103,9 +103,8 @@
* Release an object
*
* @param instance the object to be released
- * @param finalized if TRUE the lifestyle handler cannot reuse the instance
*/
- public void release( Object instance )
+ protected void handleRelease( Object instance )
{
finalize( instance );
}
1.3 +4 -3 avalon/merlin/composition/api/src/java/org/apache/avalon/composition/data/SelectionDirective.java
Index: SelectionDirective.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/data/SelectionDirective.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SelectionDirective.java 24 Jan 2004 23:25:24 -0000 1.2
+++ SelectionDirective.java 14 Feb 2004 21:33:56 -0000 1.3
@@ -19,8 +19,9 @@
import java.io.Serializable;
/**
- * A DependencyDirective contains information describing how a
- * depedency should be resolved.
+ * A SelectionDirectivecontains information describing how a
+ * depedency should be resolved relative to a set of supplied
+ * features and qualified values.
*
* @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
* @version CVS $Revision$ $Date$
1.2 +1 -2 avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/TransientRuntimeException.java
Index: TransientRuntimeException.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/model/TransientRuntimeException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TransientRuntimeException.java 12 Feb 2004 06:01:29 -0000 1.1
+++ TransientRuntimeException.java 14 Feb 2004 21:33:56 -0000 1.2
@@ -33,7 +33,6 @@
/**
* Construct a new <code>TransientRuntimeException</code> instance.
*
- * @param key the lookup key
* @param message The detail message for this exception.
* @param delay expected service availability delay in milliseconds
*/
1.33 +3 -4 avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
Index: DefaultContainmentModel.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- DefaultContainmentModel.java 12 Feb 2004 05:59:41 -0000 1.32
+++ DefaultContainmentModel.java 14 Feb 2004 21:33:56 -0000 1.33
@@ -605,9 +605,8 @@
* Addition of a new subsidiary model within
* the containment context.
*
- * @param profile a containment or deployment profile
- * @return the model based on the supplied profile
- * @exception ModelException if an error occurs during model establishment
+ * @param model a containment or component model
+ * @return the supplied model
*/
public DeploymentModel addModel( DeploymentModel model )
{
1.18 +8 -10 avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java
Index: DefaultSystemContext.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- DefaultSystemContext.java 10 Feb 2004 16:31:16 -0000 1.17
+++ DefaultSystemContext.java 14 Feb 2004 21:33:56 -0000 1.18
@@ -141,8 +141,7 @@
/**
* Creation of a new system context.
*
- * @param context a repository initial context
- * @param artifact an artifact identifying the default runtime
+ * @param clazz the runtime class
* @param logging the logging manager
* @param base the base directory from which relative references
* within a classpath or library directive shall be resolved
@@ -175,6 +174,7 @@
* Creation of a new system context.
*
* @param context the repository intial context
+ * @param artifact the runtime artifact
* @param runtime the runtime class
* @param logging the logging manager
* @param base the base directory from which relative references
@@ -231,7 +231,7 @@
m_logger = m_logging.getLoggerForCategory( category );
m_system = SystemContext.class.getClassLoader();
- m_common = Logger.class.getClassLoader();
+ m_common = DeploymentModel.class.getClassLoader();
m_factory = new StandardModelFactory( this );
//
@@ -318,23 +318,21 @@
}
/**
- * Return the system classloader. This classloader is equivalent to the
- * API classloader.
+ * Return the API classloader.
*
* @return the system classloader
*/
- public ClassLoader getCommonClassLoader()
+ public ClassLoader getAPIClassLoader()
{
return m_common;
}
/**
- * Return the system classloader. This classloader is equivalent to the
- * SPI privileged classloader.
+ * Return the SPI classloader.
*
* @return the system classloader
*/
- public ClassLoader getSystemClassLoader()
+ public ClassLoader getSPIClassLoader()
{
return m_system;
}
1.2 +2 -2 avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/StandardModelFactory.java
Index: StandardModelFactory.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/StandardModelFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StandardModelFactory.java 10 Feb 2004 16:23:34 -0000 1.1
+++ StandardModelFactory.java 14 Feb 2004 21:33:56 -0000 1.2
@@ -250,7 +250,7 @@
Repository repository = m_system.getRepository();
File base = m_system.getBaseDirectory();
- ClassLoader root = m_system.getCommonClassLoader();
+ ClassLoader root = m_system.getAPIClassLoader();
ClassLoaderDirective classLoaderDirective =
profile.getClassLoaderDirective();
1.6 +2 -17 avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/ContextTestCase.java
1.6 +3 -18 avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/DependencyTestCase.java
1.6 +2 -17 avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/IncludesTestCase.java
1.6 +2 -20 avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/TargetsTestCase.java
1.2 +7 -7 avalon/merlin/composition/spi/src/java/org/apache/avalon/composition/provider/SystemContext.java
Index: SystemContext.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/spi/src/java/org/apache/avalon/composition/provider/SystemContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SystemContext.java 10 Feb 2004 16:23:35 -0000 1.1
+++ SystemContext.java 14 Feb 2004 21:33:56 -0000 1.2
@@ -84,18 +84,18 @@
boolean isTraceEnabled();
/**
- * Return the system classloader.
+ * Return the SPI classloader.
*
- * @return the system classloader
+ * @return the SPI classloader
*/
- ClassLoader getSystemClassLoader();
+ ClassLoader getSPIClassLoader();
/**
- * Return the system classloader.
+ * Return the API classloader.
*
- * @return the system classloader
+ * @return the API classloader
*/
- ClassLoader getCommonClassLoader();
+ ClassLoader getAPIClassLoader();
/**
* Return the logging manager.
1.7 +17 -4 avalon/merlin/kernel/api/src/java/org/apache/avalon/merlin/KernelCriteria.java
Index: KernelCriteria.java
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/api/src/java/org/apache/avalon/merlin/KernelCriteria.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- KernelCriteria.java 10 Feb 2004 16:31:16 -0000 1.6
+++ KernelCriteria.java 14 Feb 2004 21:33:56 -0000 1.7
@@ -85,18 +85,24 @@
"merlin.logging.implementation";
/**
- * Merlin logging configuration key.
+ * The default merlin runtime for non-secure execution.
*/
String MERLIN_RUNTIME_IMPLEMENTATION =
- "merlin.runtime.implementation";
+ "merlin.runtime.standard.implementation";
/**
- * Merlin logging configuration key.
+ * The default secure runtime.
*/
String MERLIN_CS_RUNTIME_IMPLEMENTATION =
"merlin.runtime.csi.implementation";
/**
+ * The preferred runtime.
+ */
+ String MERLIN_RUNTIME =
+ "merlin.runtime";
+
+ /**
* Merlin target configuration override path.
*/
String MERLIN_OVERRIDE =
@@ -237,10 +243,17 @@
Artifact getRuntimeImplementation();
/**
+ * Return the standard non-secure runtime implementation artifact.
+ * @return the runtime implementation artifact
+ */
+ Artifact getStandardRuntimeImplementation();
+
+ /**
* Return the code secure runtime implementation artifact.
* @return the runtime implementation artifact
*/
Artifact getSecureRuntimeImplementation();
+
/**
* Return the url to the configuration override targets.
1.17 +4 -4 avalon/merlin/kernel/cli/src/java/org/apache/avalon/merlin/cli/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/cli/src/java/org/apache/avalon/merlin/cli/Main.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Main.java 2 Feb 2004 00:44:09 -0000 1.16
+++ Main.java 14 Feb 2004 21:33:56 -0000 1.17
@@ -533,7 +533,7 @@
/**
* Return the merlin home directory.
- * @return the merlin install directory
+ * @return the merlin installation directory
*/
private static File getMerlinHome()
{
@@ -542,7 +542,7 @@
/**
* Return the merlin home directory path.
- * @return the merlin install directory path
+ * @return the merlin installation directory path
*/
private static String getMerlinHomePath()
{
@@ -572,7 +572,7 @@
* the ${basedir} system property, and as a last resort, returns the
* JVM ${user.dir} value.
*
- * @return the merlin install directory
+ * @return the base directory
*/
private static File getBaseDirectory()
{
1.7 +1 -1 avalon/merlin/kernel/impl/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/impl/maven.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- maven.xml 10 Feb 2004 16:31:16 -0000 1.6
+++ maven.xml 14 Feb 2004 21:33:56 -0000 1.7
@@ -27,7 +27,7 @@
#
# runtime implementation
-merlin.runtime.implementation = ${merlin.runtime.implementation}
+merlin.runtime.standard.implementation = ${merlin.runtime.standard.implementation}
#
# runtime code secure implementation
1.5 +1 -1 avalon/merlin/kernel/impl/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/impl/project.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- project.properties 10 Feb 2004 16:31:16 -0000 1.4
+++ project.properties 14 Feb 2004 21:33:56 -0000 1.5
@@ -9,5 +9,5 @@
#
merlin.logging.implementation = artifact:avalon-logging/avalon-logkit-impl?version=1.0-SNAPSHOT
-merlin.runtime.implementation = artifact:avalon-activation/avalon-activation-impl?version=2.0-SNAPSHOT
+merlin.runtime.standard.implementation = artifact:avalon-activation/avalon-activation-impl?version=2.0-SNAPSHOT
merlin.runtime.csi.implementation = artifact:avalon-activation/avalon-activation-csi?version=2.0-SNAPSHOT
1.21 +28 -1 avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultCriteria.java
Index: DefaultCriteria.java
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultCriteria.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- DefaultCriteria.java 10 Feb 2004 19:52:05 -0000 1.20
+++ DefaultCriteria.java 14 Feb 2004 21:33:56 -0000 1.21
@@ -168,6 +168,9 @@
MERLIN_LOGGING_IMPLEMENTATION,
String.class, null ),
new Parameter(
+ MERLIN_RUNTIME,
+ String.class, null ),
+ new Parameter(
MERLIN_RUNTIME_IMPLEMENTATION,
String.class, null ),
new Parameter(
@@ -533,6 +536,30 @@
* @return the runtime implementation factory artifact
*/
public Artifact getRuntimeImplementation()
+ {
+ String value = (String) get( MERLIN_RUNTIME );
+ if( null != value )
+ {
+ return Artifact.createArtifact( value );
+ }
+ else
+ {
+ if( isCodeSecurityEnabled() )
+ {
+ return getSecureRuntimeImplementation();
+ }
+ else
+ {
+ return getStandardRuntimeImplementation();
+ }
+ }
+ }
+
+ /**
+ * Return the artifact reference to the runtime implementation factory .
+ * @return the runtime implementation factory artifact
+ */
+ public Artifact getStandardRuntimeImplementation()
{
String value = (String) get( MERLIN_RUNTIME_IMPLEMENTATION );
return Artifact.createArtifact( value );
1.30 +3 -15 avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
Index: DefaultFactory.java
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- DefaultFactory.java 10 Feb 2004 19:52:05 -0000 1.29
+++ DefaultFactory.java 14 Feb 2004 21:33:56 -0000 1.30
@@ -402,7 +402,7 @@
// create the system context
//
- Artifact runtime = getRuntimeArtifact( criteria );
+ Artifact runtime = criteria.getRuntimeImplementation();
File anchor = criteria.getAnchorDirectory();
DefaultSystemContext system =
@@ -426,25 +426,13 @@
return system;
}
- private Artifact getRuntimeArtifact( KernelCriteria criteria )
- {
- if( criteria.isCodeSecurityEnabled() )
- {
- return criteria.getSecureRuntimeImplementation();
- }
- else
- {
- return criteria.getRuntimeImplementation();
- }
- }
-
private ContainmentModel createApplicationModel(
SystemContext system, Configuration config ) throws Exception
{
getLogger().info( "building application model" );
LoggingManager logging = system.getLoggingManager();
final Logger logger = logging.getLoggerForCategory("");
- ClassLoader api = system.getCommonClassLoader();
+ ClassLoader api = system.getAPIClassLoader();
ContainmentProfile profile = getContainmentProfile( config );
ContainmentContext context =
createContainmentContext( system, logger, api, profile );
@@ -863,7 +851,7 @@
buffer.append(
"\n ${merlin.runtime} == "
- + getRuntimeArtifact( criteria ).toString() );
+ + criteria.getRuntimeImplementation() );
buffer.append(
"\n ${merlin.override} == "
1.2 +1 -1 avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/package.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- package.html 8 Dec 2003 15:37:13 -0000 1.1
+++ package.html 14 Feb 2004 21:33:56 -0000 1.2
@@ -14,7 +14,7 @@
{@link org.apache.avalon.merlin.impl.DefaultKernel}</strong></td>
<td>A <code>{@link org.apache.avalon.merlin.Kernel}</code> implementation
that provides support the establishment, deployment and decommissioning of a set
- of {@link org.apache.avalon.activation.appliance.Block } instances.</td></tr>
+ of a component hierachy.</td></tr>
</tr>
</table>
</p>
1.5 +66 -0 avalon/merlin/platform/xdocs/merlin/kernel/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/xdocs/merlin/kernel/properties.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- properties.xml 25 Jan 2004 13:28:47 -0000 1.4
+++ properties.xml 14 Feb 2004 21:33:56 -0000 1.5
@@ -135,6 +135,13 @@
channels are assigned the DEBUG logging priority.</td>
</tr>
<tr>
+ <td>merlin.audit</td>
+ <td>false</td>
+ <td>The audit generation policy. If 'true' a description
+ of the assembled model witll be loogged during startup.
+ Since 3.3</td>
+ </tr>
+ <tr>
<td>merlin.server</td>
<td>true</td>
<td>
@@ -157,6 +164,65 @@
<td>
The path to a configuration override targets file. Relative
path statements will be resolved relative to ${merlin.dir}.</td>
+ </tr>
+ <tr>
+ <td>merlin.logging.config</td>
+ <td></td>
+ <td>
+ Location of an external logging configuration file (since version 3.3).
+ </td>
+ </tr>
+ <tr>
+ <td>merlin.logging.implementation</td>
+ <td></td>
+ <td>
+ Artifact referennce to the logging system to be used. The artifact
+ must reference a factory that supports the LoggingCriteria parameter
+ interface and must return a LoggingManager implementation. Since 3.3.
+ </td>
+ </tr>
+ <tr>
+ <td>merlin.runtime</td>
+ <td></td>
+ <td>
+ Artifact reference.
+ Overrides the automatic selection of the underlying runtime activation
+ framework. If undeclared a default runtime wil be assigned based on the
+ standing security policy. Since 3.3.
+ </td>
+ </tr>
+ <tr>
+ <td>merlin.runtime.standard.implementation</td>
+ <td></td>
+ <td>
+ Artifact reference.
+ Override the standard non-secure implementation. Since 3.3.
+ </td>
+ </tr>
+ <tr>
+ <td>merlin.runtime.csi.implementation</td>
+ <td></td>
+ <td>
+ Artifact reference.
+ Override the code-secure implementation. Since 3.3.
+ </td>
+ </tr>
+ <tr>
+ <td>merlin.code.security.enabled</td>
+ <td>false</td>
+ <td>
+ If true the code-secure runtime will be assigned as ${merlin.runtime}.
+ Since 3.3.
+ </td>
+ </tr>
+ <tr>
+ <td>merlin.deployment.timeout</td>
+ <td></td>
+ <td>
+ The default per component deployment timeout duration in
+ milliseconds.
+ Since 3.3.
+ </td>
</tr>
</table>
</subsection>
1.4 +2 -6 avalon/merlin/platform/xdocs/meta/kernel/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/xdocs/meta/kernel/index.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- index.xml 25 Jan 2004 13:28:48 -0000 1.3
+++ index.xml 14 Feb 2004 21:33:56 -0000 1.4
@@ -41,10 +41,6 @@
<td><a href="repository/index.html">repository</a></td><td>0..1</td>
<td>Defintion of the repository sub-system including proxy settings, cache directory and remote host list.</td>
</tr>
- <tr>
- <td><a href="parameters/index.html">parameters</a></td><td>0..1</td>
- <td>For kernel-level parameterization.</td>
- </tr>
</table>
</subsection>
@@ -67,8 +63,8 @@
<repository>
<hosts>
- <host>http://www.ibiblio.org/merlin/</host>
- <host>http://www.ibiblio.org/maven/</host>
+ <host>http://dpml.net</host>
+ <host>http://ibiblio.org/maven/</host>
</hosts>
</repository>
1.8 +0 -1 avalon/merlin/platform/xdocs/meta/kernel/navigation.xml
Index: navigation.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/xdocs/meta/kernel/navigation.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- navigation.xml 25 Jan 2004 13:28:48 -0000 1.7
+++ navigation.xml 14 Feb 2004 21:33:56 -0000 1.8
@@ -39,7 +39,6 @@
<item name="kernel.xml" href="/meta/kernel/index.html">
<item name="logging" href="/meta/kernel/logging/index.html"/>
<item name="repository" href="/meta/kernel/repository/index.html"/>
- <item name="parameters" href="/meta/kernel/parameters/index.html"/>
</item>
<item name="block.xml" href="/meta/block/index.html"/>
<item name="config.xml" href="/meta/config/index.html"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org