Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2109 - in development/main/metro: activation composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/impl/src/main/net/dpml/composition/data/builder composition/impl/src/main/net/dpml/composition/model/impl

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: r2109 - in development/main/metro: activation composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/impl/src/main/net/dpml/composition/data/builder composition/impl/src/main/net/dpml/composition/model/impl
  • Date: Mon, 21 Mar 2005 14:13:27 -0500

Author: mcconnell AT dpml.net
Date: Mon Mar 21 14:13:27 2005
New Revision: 2109

Added:
development/main/metro/activation/build.xml
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/StageDirective.java

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

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

development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLComponentProfileCreator.java

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/DefaultStageModel.java
Log:
Remove content dealing provider selection based on feature mapping. This
capability was never completed and we have been using explicit named
providers (either though directives or via the asembly process). Feature
based selection needs to re-emerge but this can be more effectively dealt
with under a new strategy implementation.

Added: development/main/metro/activation/build.xml
==============================================================================
--- (empty file)
+++ development/main/metro/activation/build.xml Mon Mar 21 14:13:27 2005
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="dpml-activation" default="default" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/reactor"/>
+
+</project>

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
Mon Mar 21 14:13:27 2005
@@ -41,11 +41,6 @@
private final String m_source;

/**
- * The set of features used during selection.
- */
- private final SelectionDirective[] m_features;
-
- /**
* Creation of a new dependency directive.
*
* @param key the dependency key
@@ -55,20 +50,6 @@
{
m_key = key;
m_source = source;
- m_features = new SelectionDirective[0];
- }
-
- /**
- * Creation of a new dependency directive.
- *
- * @param key the dependency key
- * @param features the set of selection directives
- */
- public DependencyDirective( String key, SelectionDirective[] features )
- {
- m_key = key;
- m_features = features;
- m_source = null;
}

/**
@@ -88,13 +69,4 @@
{
return m_source;
}
-
- /**
- * Return the set of selection directive constraints.
- * @return the selection directive set
- */
- public SelectionDirective[] getSelectionDirectives()
- {
- return m_features;
- }
}

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/data/StageDirective.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/data/StageDirective.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/data/StageDirective.java
Mon Mar 21 14:13:27 2005
@@ -41,11 +41,6 @@
private final String m_source;

/**
- * The set of features used during selection.
- */
- private final SelectionDirective[] m_features;
-
- /**
* Creation of a new stage directive that associates a
* stage key with a source component address.
*
@@ -56,21 +51,6 @@
{
m_key = key;
m_source = source;
- m_features = new SelectionDirective[0];
- }
-
- /**
- * Creation of a new stage directive that associates a
- * stage key with a set of selection constraints.
- *
- * @param key the stage key
- * @param features the set of selection directives
- */
- public StageDirective( String key, SelectionDirective[] features )
- {
- m_key = key;
- m_features = features;
- m_source = null;
}

/**
@@ -90,13 +70,4 @@
{
return m_source;
}
-
- /**
- * Return the set of selection directive constraints.
- * @return the selection directive set
- */
- public SelectionDirective[] getSelectionDirectives()
- {
- return m_features;
- }
}

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/model/DependencyModel.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/model/DependencyModel.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/model/DependencyModel.java
Mon Mar 21 14:13:27 2005
@@ -49,12 +49,4 @@
*/
String getPath();

- /**
- * Filter a set of candidate service descriptors and return the
- * set of acceptable service as a ordered sequence.
- *
- * @param candidates the set of candidate services for the dependency
- * @return the accepted candidates in ranked order
- */
- ServiceDescriptor[] filter( ServiceDescriptor[] candidates );
}

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/model/StageModel.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/model/StageModel.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/model/StageModel.java
Mon Mar 21 14:13:27 2005
@@ -19,7 +19,6 @@
package net.dpml.composition.model;

import net.dpml.meta.info.StageDescriptor;
-import net.dpml.meta.info.ExtensionDescriptor;

/**
* Stage model handles the establishment of an explicit source
@@ -50,13 +49,4 @@
*/
String getPath();

- /**
- * Filter a set of candidate service descriptors and return the
- * set of acceptable service as a ordered sequence.
- *
- * @param candidates the set of candidate extension providers
- * for the stage dependency
- * @return the accepted candidates in ranked order
- */
- ExtensionDescriptor[] filter( ExtensionDescriptor[] candidates );
}

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLComponentProfileCreator.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLComponentProfileCreator.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLComponentProfileCreator.java
Mon Mar 21 14:13:27 2005
@@ -38,7 +38,6 @@
import net.dpml.composition.data.ImportDirective;
import net.dpml.composition.data.Mode;
import net.dpml.composition.data.Parameter;
-import net.dpml.composition.data.SelectionDirective;
import net.dpml.composition.data.StageDirective;

import net.dpml.meta.info.InfoDescriptor;
@@ -153,22 +152,7 @@
{
final String key = config.getAttribute( "key" );
final String source = config.getAttribute( "source", null );
- if( source != null )
- {
- return new DependencyDirective( key, source );
- }
- else
- {
- Configuration[] children = config.getChildren( "select" );
- ArrayList list = new ArrayList();
- for( int i=0; i<children.length; i++ )
- {
- list.add( getSelectionDirective( children[i] ) );
- }
- SelectionDirective[] features =
- (SelectionDirective[]) list.toArray( new SelectionDirective[0]
);
- return new DependencyDirective( key, features );
- }
+ return new DependencyDirective( key, source );
}

protected StageDirective[] getStageDirectives( Configuration config )
@@ -192,32 +176,7 @@
{
final String key = config.getAttribute( "key" );
final String source = config.getAttribute( "source", null );
- if( source != null )
- {
- return new StageDirective( key, source );
- }
- else
- {
- Configuration[] children = config.getChildren( "select" );
- ArrayList list = new ArrayList();
- for( int i=0; i<children.length; i++ )
- {
- list.add( getSelectionDirective( children[i] ) );
- }
- SelectionDirective[] features =
- (SelectionDirective[]) list.toArray( new SelectionDirective[0]
);
- return new StageDirective( key, features );
- }
- }
-
- protected SelectionDirective getSelectionDirective( Configuration config
)
- throws ConfigurationException
- {
- final String feature = config.getAttribute( "feature" );
- final String value = config.getAttribute( "value" );
- final String match = config.getAttribute( "match", "required" );
- final boolean optional = config.getAttributeAsBoolean( "optional",
false );
- return new SelectionDirective( feature, value, match, optional );
+ return new StageDirective( key, source );
}

protected Parameters getParameters( Configuration config )

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
Mon Mar 21 14:13:27 2005
@@ -24,7 +24,6 @@
import net.dpml.composition.model.ModelException;

import net.dpml.composition.data.DependencyDirective;
-import net.dpml.composition.data.SelectionDirective;

import net.dpml.i18n.ResourceManager;
import net.dpml.i18n.Resources;
@@ -97,13 +96,6 @@
m_partition = partition;
m_name = name;

- //
- // a dependency directive is either declaring an explicitly
- // identified provider, or, it is delcaring 0 or more selection
- // constraints - if its a an absolute source declaration then
- // add it to the table to paths keyed by depedency key names
- //
-
if( directive != null )
{
if( directive.getSource() != null )
@@ -152,109 +144,6 @@
return m_source;
}

- /**
- * Filter a set of candidate service descriptors and return the
- * set of acceptable service as a ordered sequence.
- *
- * @param candidates the set of candidate services for the dependency
- * matching the supplied key
- * @return the accepted candidates in ranked order
- * @exception IllegalArgumentException if the key is unknown
- */
- public ServiceDescriptor[] filter( ServiceDescriptor[] candidates )
- {
- if( m_directive != null )
- {
- if( m_directive.getSource() == null )
- {
- return filter( m_directive, candidates );
- }
- }
- return candidates;
- }
-
- /**
- * Filter a set of candidate service descriptors and return the
- * set of acceptable service as a ordered sequence.
- *
- * @param directive the dependency directive
- * @param services the set of candidate services for the dependency
- * @return the accepted candidates in ranked order
- */
- private ServiceDescriptor[] filter(
- DependencyDirective directive, ServiceDescriptor[] services )
- {
- SelectionDirective[] filters = getFilters( directive );
- ArrayList list = new ArrayList();
-
- for( int i=0; i<services.length; i++ )
- {
- ServiceDescriptor service = services[i];
- if( isaCandidate( service, filters ) )
- {
- list.add( service );
- }
- }
-
- ServiceDescriptor[] candidates =
- (ServiceDescriptor[]) list.toArray( new ServiceDescriptor[0] );
-
- //
- // TODO: include ranking of candidates
- //
-
- return candidates;
- }
-
- private boolean isaCandidate(
- ServiceDescriptor service, SelectionDirective[] filters )
- {
- for( int i=0; i<filters.length; i++ )
- {
- SelectionDirective filter = filters[i];
- if( !isaCandidate( service, filter ) )
- {
- return false;
- }
- }
- return true;
- }
-
- private boolean isaCandidate(
- ServiceDescriptor service, SelectionDirective filter )
- {
- final String feature = filter.getFeature();
- final String value = filter.getValue();
- final String criteria = filter.getCriteria();
-
- if( criteria.equals( SelectionDirective.EQUALS ) )
- {
- return value.equals( service.getAttribute( feature ) );
- }
- else if( criteria.equals( SelectionDirective.EXISTS ) )
- {
- return service.getAttribute( feature ) != null;
- }
- else if( criteria.equals( SelectionDirective.INCLUDES ) )
- {
- final String v = service.getAttribute( feature );
- if( v != null )
- {
- return v.indexOf( value ) > -1;
- }
- else
- {
- return false;
- }
- }
- else
- {
- final String error =
- REZ.getString( "dependency.invalid-criteria.error", criteria,
feature );
- throw new IllegalArgumentException( error );
- }
- }
-
private String resolvePath( String partition, String path )
{
if( path.startsWith( "/" ) )
@@ -298,24 +187,4 @@
throw new IllegalArgumentException( error );
}
}
-
- /**
- * Return the required selection constraints.
- * @param directive the dependency directive
- * @return the set of required selection directives
- */
- private SelectionDirective[] getFilters( DependencyDirective directive )
- {
- ArrayList list = new ArrayList();
- SelectionDirective[] selections = directive.getSelectionDirectives();
- for( int i=0; i<selections.length; i++ )
- {
- SelectionDirective selection = selections[i];
- if( selection.isRequired() )
- {
- list.add( selection );
- }
- }
- return (SelectionDirective[]) list.toArray( new
SelectionDirective[0] );
- }
}

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultStageModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultStageModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultStageModel.java
Mon Mar 21 14:13:27 2005
@@ -21,8 +21,6 @@
import java.util.ArrayList;

import net.dpml.composition.data.StageDirective;
-import net.dpml.composition.data.SelectionDirective;
-
import net.dpml.composition.model.StageModel;
import net.dpml.composition.model.ModelException;

@@ -45,16 +43,16 @@
public class DefaultStageModel extends DefaultDependent
implements StageModel
{
- //==============================================================
+ //--------------------------------------------------------------
// static
- //==============================================================
+ //--------------------------------------------------------------

private static final Resources REZ =
ResourceManager.getPackageResources(
DefaultDependencyModel.class );

- //==============================================================
+ //--------------------------------------------------------------
// immutable state
- //==============================================================
+ //--------------------------------------------------------------

private final StageDescriptor m_descriptor;

@@ -62,9 +60,9 @@

private final String m_source;

- //==============================================================
+ //--------------------------------------------------------------
// constructor
- //==============================================================
+ //--------------------------------------------------------------

/**
* Creation of a new stage model.
@@ -117,9 +115,9 @@
}
}

- //==============================================================
+ //--------------------------------------------------------------
// StageModel
- //==============================================================
+ //--------------------------------------------------------------

/**
* Return the stage descriptor.
@@ -145,106 +143,9 @@
return m_source;
}

- /**
- * Filter a set of candidate extension descriptors and return the
- * set of acceptable extensions as a ordered sequence.
- *
- * @param candidates the set of candidate stage providers
- * @return the accepted candidates in ranked order
- */
- public ExtensionDescriptor[] filter( ExtensionDescriptor[] candidates )
- {
- if( m_directive != null )
- {
- if( m_directive.getSource() == null )
- {
- return filter( m_directive, candidates );
- }
- }
- return candidates;
- }
-
- /**
- * Filter a set of candidate service descriptors and return the
- * set of acceptable stage providers as a ordered sequence.
- *
- * @param directive the stage directive
- * @param providers the set of candidate extension descriptors
- * @return the accepted candidates in ranked order
- */
- private ExtensionDescriptor[] filter(
- StageDirective directive, ExtensionDescriptor[] providers )
- {
- SelectionDirective[] filters = getFilters( directive );
- ArrayList list = new ArrayList();
-
- for( int i=0; i<providers.length; i++ )
- {
- ExtensionDescriptor provider = providers[i];
- if( isaCandidate( provider, filters ) )
- {
- list.add( provider );
- }
- }
-
- ExtensionDescriptor[] candidates =
- (ExtensionDescriptor[]) list.toArray( new ExtensionDescriptor[0] );
-
- //
- // TODO: include ranking of candidates
- //
-
- return candidates;
- }
-
- private boolean isaCandidate(
- ExtensionDescriptor provider, SelectionDirective[] filters )
- {
- for( int i=0; i<filters.length; i++ )
- {
- SelectionDirective filter = filters[i];
- if( !isaCandidate( provider, filter ) )
- {
- return false;
- }
- }
- return true;
- }
-
- private boolean isaCandidate(
- ExtensionDescriptor provider, SelectionDirective filter )
- {
- final String feature = filter.getFeature();
- final String value = filter.getValue();
- final String criteria = filter.getCriteria();
-
- if( criteria.equals( SelectionDirective.EQUALS ) )
- {
- return value.equals( provider.getAttribute( feature ) );
- }
- else if( criteria.equals( SelectionDirective.EXISTS ) )
- {
- return provider.getAttribute( feature ) != null;
- }
- else if( criteria.equals( SelectionDirective.INCLUDES ) )
- {
- final String v = provider.getAttribute( feature );
- if( v != null )
- {
- return v.indexOf( value ) > -1;
- }
- else
- {
- return false;
- }
- }
- else
- {
- final String error =
- REZ.getString( "stage.invalid-criteria.error", criteria,
feature );
- throw new IllegalArgumentException( error );
- }
- }
+ //--------------------------------------------------------------
+ // implimentation
+ //--------------------------------------------------------------

private String resolvePath( String partition, String path )
{
@@ -289,24 +190,4 @@
throw new IllegalArgumentException( error );
}
}
-
- /**
- * Return the required selection constraints.
- * @param directive the dependency directive
- * @return the set of required selection directives
- */
- private SelectionDirective[] getFilters( StageDirective directive )
- {
- ArrayList list = new ArrayList();
- SelectionDirective[] selections = directive.getSelectionDirectives();
- for( int i=0; i<selections.length; i++ )
- {
- SelectionDirective selection = selections[i];
- if( selection.isRequired() )
- {
- list.add( selection );
- }
- }
- return (SelectionDirective[]) list.toArray( new
SelectionDirective[0] );
- }
}



  • svn commit: r2109 - in development/main/metro: activation composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/impl/src/main/net/dpml/composition/data/builder composition/impl/src/main/net/dpml/composition/model/impl, mcconnell, 03/21/2005

Archive powered by MHonArc 2.6.24.

Top of Page