Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2153 - in development/main/metro: activation/providers/avalon/src/main/net/dpml/activation/avalon activation/providers/metro/src/main/net/dpml/activation/metro composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/builder/src/main/net/dpml/composition/builder/datatypes composition/impl/src/main/net/dpml/composition/model/impl composition/testing/acme composition/testing/unit/src/test/net/dpml/composition/test

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2153 - in development/main/metro: activation/providers/avalon/src/main/net/dpml/activation/avalon activation/providers/metro/src/main/net/dpml/activation/metro composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/builder/src/main/net/dpml/composition/builder/datatypes composition/impl/src/main/net/dpml/composition/model/impl composition/testing/acme composition/testing/unit/src/test/net/dpml/composition/test
  • Date: Sat, 26 Mar 2005 18:14:35 -0500

Author: mcconnell AT dpml.net
Date: Sat Mar 26 18:14:35 2005
New Revision: 2153

Modified:

development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/AbstractLifestyleManager.java

development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/TransientLifestyleManager.java

development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/AbstractLifestyleManager.java

development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/TransientLifestyleManager.java

development/main/metro/composition/api/src/main/net/dpml/composition/data/ComponentProfile.java

development/main/metro/composition/api/src/main/net/dpml/composition/data/DependencyDirective.java

development/main/metro/composition/api/src/main/net/dpml/composition/model/ComponentModel.java

development/main/metro/composition/api/src/main/net/dpml/composition/model/ContainmentModel.java

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelComponentHelper.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelNavigationHelper.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
development/main/metro/composition/testing/acme/build.xml

development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
Log:
Updates to handle changes in meta together with updates to handle the
addition of named component parts including solution to manual dependency
declaration.

Modified:
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/AbstractLifestyleManager.java
==============================================================================
---
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/AbstractLifestyleManager.java
(original)
+++
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/AbstractLifestyleManager.java
Sat Mar 26 18:14:35 2005
@@ -185,11 +185,11 @@
protected Reference getReference( Object instance )
{
final int policy = getComponentModel().getCollectionPolicy();
- if( policy == InfoDescriptor.WEAK )
+ if( policy == InfoDescriptor.WEAK_COLLECTION )
{
return new WeakReference( instance, m_liberals );
}
- else if( policy == InfoDescriptor.SOFT )
+ else if( policy == InfoDescriptor.SOFT_COLLECTION )
{
return new SoftReference( instance );
}

Modified:
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/TransientLifestyleManager.java
==============================================================================
---
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/TransientLifestyleManager.java
(original)
+++
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/TransientLifestyleManager.java
Sat Mar 26 18:14:35 2005
@@ -126,7 +126,7 @@
protected Reference getReference( Object instance )
{
final int policy = getComponentModel().getCollectionPolicy();
- if( policy == InfoDescriptor.SOFT )
+ if( policy == InfoDescriptor.SOFT_COLLECTION )
{
return new SoftReference( instance );
}

Modified:
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/AbstractLifestyleManager.java
==============================================================================
---
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/AbstractLifestyleManager.java
(original)
+++
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/AbstractLifestyleManager.java
Sat Mar 26 18:14:35 2005
@@ -168,11 +168,11 @@
protected Reference getReference( Object instance )
{
final int policy = getComponentModel().getCollectionPolicy();
- if( policy == InfoDescriptor.WEAK )
+ if( policy == InfoDescriptor.WEAK_COLLECTION )
{
return new WeakReference( instance, m_liberals );
}
- else if( policy == InfoDescriptor.SOFT )
+ else if( policy == InfoDescriptor.SOFT_COLLECTION )
{
return new SoftReference( instance );
}

Modified:
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/TransientLifestyleManager.java
==============================================================================
---
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/TransientLifestyleManager.java
(original)
+++
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/TransientLifestyleManager.java
Sat Mar 26 18:14:35 2005
@@ -126,7 +126,7 @@
protected Reference getReference( Object instance )
{
final int policy = getComponentModel().getCollectionPolicy();
- if( policy == InfoDescriptor.SOFT )
+ if( policy == InfoDescriptor.SOFT_COLLECTION )
{
return new SoftReference( instance );
}

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/data/ComponentProfile.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/data/ComponentProfile.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/data/ComponentProfile.java
Sat Mar 26 18:14:35 2005
@@ -238,7 +238,7 @@
* Return the component collection policy. If null, the component
* type collection policy will apply.
*
- * @return a HARD, WEAK, SOFT or UNDEFINED
+ * @return a HARD_COLLECTION, WEAK_COLLECTION, SOFT_COLLECTION or
UNDEFINED_COLLECTION
*/
public int getCollectionPolicy()
{

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/data/DependencyDirective.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/data/DependencyDirective.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/data/DependencyDirective.java
Sat Mar 26 18:14:35 2005
@@ -125,4 +125,16 @@
return hash;
}

+ public String toString()
+ {
+ if( null == getSource() )
+ {
+ return "[dependency key='" + getKey() + "' source='?']";
+ }
+ else
+ {
+ return "[dependency key='" + getKey() + "' source='" +
getSource() + "']";
+ }
+ }
+
}

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/model/ComponentModel.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/model/ComponentModel.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/model/ComponentModel.java
Sat Mar 26 18:14:35 2005
@@ -62,9 +62,9 @@
* declared by the type will be used.
*
* @return the collection policy
- * @see net.dpml.meta.info.InfoDescriptor#WEAK
- * @see net.dpml.meta.info.InfoDescriptor#SOFT
- * @see net.dpml.meta.info.InfoDescriptor#HARD
+ * @see net.dpml.meta.info.InfoDescriptor#WEAK_COLLECTION
+ * @see net.dpml.meta.info.InfoDescriptor#SOFT_COLLECTION
+ * @see net.dpml.meta.info.InfoDescriptor#HARD_COLLECTION
*/
int getCollectionPolicy();

@@ -72,10 +72,10 @@
* Set the collection policy to a supplied value.
*
* @param policy the collection policy
- * @see net.dpml.meta.info.InfoDescriptor#WEAK
- * @see net.dpml.meta.info.InfoDescriptor#SOFT
- * @see net.dpml.meta.info.InfoDescriptor#HARD
- * @see net.dpml.meta.info.InfoDescriptor#UNDEFINED
+ * @see net.dpml.meta.info.InfoDescriptor#WEAK_COLLECTION
+ * @see net.dpml.meta.info.InfoDescriptor#SOFT_COLLECTION
+ * @see net.dpml.meta.info.InfoDescriptor#HARD_COLLECTION
+ * @see net.dpml.meta.info.InfoDescriptor#UNDEFINED_COLLECTION
*/
void setCollectionPolicy( int policy );


Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/model/ContainmentModel.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/model/ContainmentModel.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/model/ContainmentModel.java
Sat Mar 26 18:14:35 2005
@@ -133,7 +133,17 @@
* Addition of a new subsidiary deployment model using a supplied part
uri.
*
* @param uri a part uri
- * @return the model based on the derived profile
+ * @return the model of the part
+ * @exception ModelException if an error occurs during model establishment
+ */
+ DeploymentModel addModel( URI uri ) throws ModelException;
+
+ /**
+ * Addition of a new subsidiary deployment model using a supplied part
uri.
+ *
+ * @param name the name to assign to the deployment model
+ * @param uri a part uri
+ * @return the model of the part
* @exception ModelException if an error occurs during model establishment
*/
DeploymentModel addModel( String name, URI uri ) throws ModelException;

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/ContextDataType.java
Sat Mar 26 18:14:35 2005
@@ -82,7 +82,6 @@
throws IntrospectionException, IOException, ClassNotFoundException
{
PartBuilder[] builders = getBuilders();
-System.out.println( "## BUILDERS " + builders.length );
EntryDirective[] entryDirectives = new EntryDirective[
builders.length ];
for( int i=0; i<builders.length; i++ )
{
@@ -102,7 +101,6 @@
}
}
String classname = getClassname();
-System.out.println( "## CONTEXT : " + entryDirectives.length );
return new ContextDirective( classname, entryDirectives );
}
}

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
Sat Mar 26 18:14:35 2005
@@ -58,7 +58,9 @@
for( int i=0; i<dependencies.length; i++ )
{
DependencyDataType dep = deps[i];
- dependencies[i] = dep.getDependencyDirective();
+ DependencyDirective directive = dep.getDependencyDirective();
+ dependencies[i] = directive;
+ System.out.println( "# DEP: " + directive );
}
return dependencies;
}

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java
Sat Mar 26 18:14:35 2005
@@ -569,6 +569,18 @@
* Addition of a new subsidiary deployment model using a supplied part
uri.
*
* @param uri a part uri
+ * @return the model of the part
+ * @exception ModelException if an error occurs during model establishment
+ */
+ public DeploymentModel addModel( URI uri ) throws ModelException
+ {
+ return addModel( null, uri );
+ }
+
+ /**
+ * Addition of a new subsidiary deployment model using a supplied part
uri.
+ *
+ * @param uri a part uri
* @return the model based on the derived profile
* @exception ModelException if an error occurs during model establishment
*/
@@ -581,7 +593,8 @@
if( part instanceof DeploymentProfile )
{
DeploymentProfile profile = (DeploymentProfile) part;
- return createDeploymentModel( name, profile );
+ DeploymentModel model = createDeploymentModel( name, profile
);
+ return addModel( model );
}
else
{
@@ -645,8 +658,7 @@
*/
DeploymentModel createDeploymentModel( DeploymentProfile profile )
throws ModelException
{
- final String name = profile.getName();
- return createDeploymentModel( name, profile );
+ return createDeploymentModel( null, profile );
}

/**
@@ -658,7 +670,7 @@
* @exception ModelException if an error occurs during model establishment
* @exception NullArgumentException if the profile argument is null.
*/
- DeploymentModel createDeploymentModel( String name, DeploymentProfile
profile )
+ DeploymentModel createDeploymentModel( String profileName,
DeploymentProfile profile )
throws ModelException, NullArgumentException
{
if( null == profile )
@@ -666,16 +678,22 @@
throw new NullArgumentException( "profile" );
}

+ String name = profileName;
+ if( null == name )
+ {
+ name = profile.getName();
+ }
+
DeploymentModel model;
if( profile instanceof ContainmentProfile )
{
ContainmentProfile containment = (ContainmentProfile) profile;
- model = createContainmentModel( containment );
+ model = createContainmentModel( name, containment );
}
else if( profile instanceof ComponentProfile )
{
ComponentProfile deployment = (ComponentProfile) profile;
- model = createComponentModel( deployment );
+ model = createComponentModel( name, deployment );
}
else if( profile instanceof NamedComponentProfile )
{
@@ -827,7 +845,7 @@
/**
* Apply a set of override targets.
* @param targets a set of target directives
- * @throws ModelException
+ * @throws ModelException
*/
public void applyTargets( TargetDirective[]targets ) throws
ModelException
{
@@ -948,10 +966,24 @@
private ComponentModel createComponentModel( final ComponentProfile
profile )
throws ModelException
{
+ return createComponentModel( null, profile );
+ }
+
+ /**
+ * Creation of a new instance of a component model within
+ * this containment context.
+ *
+ * @param the component name
+ * @param profile a component profile
+ * @return the composition model
+ */
+ private ComponentModel createComponentModel( final String name, final
ComponentProfile profile )
+ throws ModelException
+ {
DefaultContainmentModelComponentHelper helper =
new DefaultContainmentModelComponentHelper( m_context, this );
ComponentContext context =
- helper.createComponentContext( profile );
+ helper.createComponentContext( name, profile );
ModelFactory factory =
m_context.getModelFactory();
return factory.createComponentModel( context );

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
Sat Mar 26 18:14:35 2005
@@ -273,6 +273,7 @@
DependencyModel dependency, List subjects )
throws AssemblyException
{
+
String path = dependency.getPath();
if( null != path )
{

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelComponentHelper.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelComponentHelper.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelComponentHelper.java
Sat Mar 26 18:14:35 2005
@@ -107,13 +107,26 @@
public ComponentContext createComponentContext( final ComponentProfile
profile )
throws ModelException, NullArgumentException
{
+ final String name = profile.getName();
+ return createComponentContext( name, profile );
+ }
+
+ /**
+ * Creation of a new component model relative to a supplied profile.
+ *
+ * @param profile the component profile
+ * @return the component model context
+ * @exception NullArgumentException if the profile argument is null.
+ */
+ public ComponentContext createComponentContext( final String name, final
ComponentProfile profile )
+ throws ModelException, NullArgumentException
+ {
if( null == profile )
{
throw new NullArgumentException( "profile" );
}

SystemContext system = m_context.getSystemContext();
- final String name = profile.getName();
final String partition = m_model.getPartition();
LoggingManager logging = system.getLoggingManager();
CategoriesDirective categories = profile.getCategoriesDirective();

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelNavigationHelper.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelNavigationHelper.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelNavigationHelper.java
Sat Mar 26 18:14:35 2005
@@ -106,7 +106,6 @@
//

final String root = getRootName( path );
-
if( root.equals( ".." ) )
{
//

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
Sat Mar 26 18:14:35 2005
@@ -131,7 +131,7 @@
}

/**
- * Return an explicit path to a supplier component.
+ * Return an absolute path to a supplier component.
* If a dependency directive has been declared
* and the directive contains a source declaration, the value
* returned is the result of parsing the source value relative

Modified: development/main/metro/composition/testing/acme/build.xml
==============================================================================
--- development/main/metro/composition/testing/acme/build.xml (original)
+++ development/main/metro/composition/testing/acme/build.xml Sat Mar 26
18:14:35 2005
@@ -23,15 +23,14 @@
</context>
</component>
<component name="gizmo"
class="net.dpml.composition.testing.DefaultGizmo">
- <!--
<dependencies>
<dependency key="widget" source="widget"/>
</dependencies>
- -->
+ <!--
+ -->
<parts>
- <value key="foo" value="bar"/>
<value key="date" class="java.util.Date"/>
- <value key="info" class="java.net.URI"
value="link:acme/parts/acme-parts-list"/>
+ <value key="info" class="java.net.URI"
value="link:acme-parts-list"/>
<component key="widget" name="secret"
class="net.dpml.composition.testing.DefaultWidget"/>
</parts>
</component>
@@ -47,7 +46,5 @@
xmlns="plugin:dpml/composition/dpml-composition-builder"/>
<echo>Building block</echo>
</target>
- <!--
- -->

</project>

Modified:
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
==============================================================================
---
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
(original)
+++
development/main/metro/composition/testing/unit/src/test/net/dpml/composition/test/FreightTestCase.java
Sat Mar 26 18:14:35 2005
@@ -50,7 +50,7 @@
try
{
URI uri = new URI( "@ACME-PART-URI@" );
- DeploymentModel test = getRoot().addModel( "test", uri );
+ DeploymentModel test = getRoot().addModel( uri );
test.commission();
Object object = test.resolve( false );
test.release( object );



  • svn commit: r2153 - in development/main/metro: activation/providers/avalon/src/main/net/dpml/activation/avalon activation/providers/metro/src/main/net/dpml/activation/metro composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/builder/src/main/net/dpml/composition/builder/datatypes composition/impl/src/main/net/dpml/composition/model/impl composition/testing/acme composition/testing/unit/src/test/net/dpml/composition/test, mcconnell, 03/26/2005

Archive powered by MHonArc 2.6.24.

Top of Page