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 2003/04/15 04:57:29 UTC
cvs commit: avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl DefaultContainer.java DefaultContainer.xinfo
mcconnell 2003/04/14 19:57:29
Modified: merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder
XMLContainerCreator.java
merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl
DefaultContainer.java DefaultContainer.xinfo
Log:
Removed context dependecy on containment descriptor.
Revision Changes Path
1.6 +5 -5 avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/XMLContainerCreator.java
Index: XMLContainerCreator.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/builder/XMLContainerCreator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLContainerCreator.java 13 Apr 2003 05:45:10 -0000 1.5
+++ XMLContainerCreator.java 15 Apr 2003 02:57:29 -0000 1.6
@@ -162,7 +162,8 @@
Type type, Configuration config )
throws Exception
{
- return createContainmentProfile( type, config, "container" );
+ final String name = config.getAttribute( "name", "container" );
+ return createContainmentProfile( type, config, name );
}
/**
@@ -172,6 +173,7 @@
*
* @param type the component type
* @param config the profile description
+ * @param name the container name
* @return the profile
* @exception Exception if an error occurs during profile creation
*/
@@ -183,17 +185,15 @@
}
private ContainmentProfile buildContainmentProfile(
- Type type, Configuration profile, Mode mode, String defaultName )
+ Type type, Configuration profile, Mode mode, String name )
throws Exception
{
//
// create the logging categories for this profile
//
- final String name = profile.getAttribute( "name", defaultName );
LoggingDirective categories =
createLoggingDirective( name, profile.getChild( "categories" ) );
-
final Parameters params =
Parameters.fromConfiguration( profile.getChild( "parameters" ) );
final ContextDirective context =
1.3 +16 -14 avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl/DefaultContainer.java
Index: DefaultContainer.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl/DefaultContainer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultContainer.java 13 Apr 2003 02:37:06 -0000 1.2
+++ DefaultContainer.java 15 Apr 2003 02:57:29 -0000 1.3
@@ -102,7 +102,10 @@
private DependencyGraph m_graph;
- private ContainmentProfile m_descriptor;
+ /**
+ * The name of the container.
+ */
+ private String m_name;
/**
* Map of components keyed by appliance.
@@ -135,9 +138,9 @@
*/
public void contextualize( Context context ) throws ContextException
{
- m_descriptor = (ContainmentProfile) context.get( "urn:merlin:container.descriptor" );
+ m_name = (String) context.get( "urn:avalon:name" );
m_graph = (DependencyGraph) context.get( "urn:merlin:container.dependency-graph" );
- addStateListener( (StateListener) context.get( "urn:merlin:container.listener" ) );
+ addStateListener( (StateListener) context.get( "urn:merlin:container.listener" ) );
}
//==============================================================
@@ -167,7 +170,7 @@
//
m_state = StateEvent.INITIALIZED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.INITIALIZED ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.INITIALIZED ) );
}
/**
@@ -197,12 +200,12 @@
{
startupComponents();
m_state = StateEvent.STARTED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STARTED ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STARTED ) );
}
catch( Throwable e )
{
m_state = StateEvent.STOPPED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STOPPED, e ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STOPPED, e ) );
}
}
@@ -238,12 +241,12 @@
{
suspendComponents();
m_state = StateEvent.SUSPENDED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.SUSPENDED ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.SUSPENDED ) );
}
catch( Throwable e )
{
m_state = StateEvent.STOPPED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STOPPED, e ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STOPPED, e ) );
}
}
@@ -272,12 +275,12 @@
{
resumeComponents();
m_state = StateEvent.STARTED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STARTED ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STARTED ) );
}
catch( Throwable e )
{
m_state = StateEvent.STOPPED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STOPPED, e ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STOPPED, e ) );
}
}
@@ -317,12 +320,12 @@
{
shutdownComponents();
m_state = StateEvent.STARTED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STOPPED ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STOPPED ) );
}
catch( Throwable e )
{
m_state = StateEvent.STOPPED;
- fireStateChange( new StateEvent( this, m_descriptor.getName(), StateEvent.STOPPED, e ) );
+ fireStateChange( new StateEvent( this, m_name, StateEvent.STOPPED, e ) );
}
}
@@ -341,7 +344,6 @@
getLogger().debug( "disposal" );
}
- m_descriptor = null;
m_components.clear();
m_components = null;
m_disposed = true;
1.3 +1 -2 avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl/DefaultContainer.xinfo
Index: DefaultContainer.xinfo
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/container/impl/DefaultContainer.xinfo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultContainer.xinfo 13 Apr 2003 02:37:06 -0000 1.2
+++ DefaultContainer.xinfo 15 Apr 2003 02:57:29 -0000 1.3
@@ -20,8 +20,7 @@
</info>
<context>
- <entry key="urn:merlin:container.descriptor"
- type="org.apache.avalon.merlin.container.ContainmentProfile"/>
+ <entry key="urn:avalon:name"/>
<entry key="urn:merlin:container.listener"
type="org.apache.avalon.merlin.container.StateListener"/>
<entry key="urn:merlin:container.dependency-graph"
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org