Skip to Content.
Sympa Menu

notify-dpml - r1635 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks metro/model/src/main/net/dpml/metro/data metro/model/src/main/net/dpml/metro/info metro/runtime/src/main/net/dpml/metro/runtime

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1635 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks metro/model/src/main/net/dpml/metro/data metro/model/src/main/net/dpml/metro/info metro/runtime/src/main/net/dpml/metro/runtime
  • Date: Sun, 23 Jul 2006 08:21:57 +0200

Author: mcconnell
Date: 2006-07-23 08:21:33 +0200 (Sun, 23 Jul 2006)
New Revision: 1635

Removed:
trunk/main/metro/model/src/main/net/dpml/metro/info/Composite.java
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
trunk/main/metro/model/src/main/net/dpml/metro/data/ComponentDirective.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
Log:
housekeeping

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-07-22 15:59:33 UTC (rev 1634)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-07-23 06:21:33 UTC (rev 1635)
@@ -46,7 +46,7 @@
import org.w3c.dom.Element;

/**
- * Execute all plugins relative to the current build phase.
+ * Creation of an part definition in XML.
*
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@

Modified:
trunk/main/metro/model/src/main/net/dpml/metro/data/ComponentDirective.java
===================================================================
---
trunk/main/metro/model/src/main/net/dpml/metro/data/ComponentDirective.java
2006-07-22 15:59:33 UTC (rev 1634)
+++
trunk/main/metro/model/src/main/net/dpml/metro/data/ComponentDirective.java
2006-07-23 06:21:33 UTC (rev 1635)
@@ -20,18 +20,17 @@

import java.io.IOException;
import java.net.URI;
+import java.util.Arrays;

import net.dpml.component.ActivationPolicy;
import net.dpml.component.Directive;

-import net.dpml.metro.info.Composite;
import net.dpml.metro.info.PartReference;
import net.dpml.metro.info.LifestylePolicy;
import net.dpml.metro.info.CollectionPolicy;

-//import net.dpml.metro.builder.ComponentDecoder;
-
import net.dpml.lang.Part;
+import net.dpml.lang.AbstractDirective;

/**
* Definition of the criteria for an explicit component profile. A profile,
when
@@ -89,7 +88,7 @@
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public class ComponentDirective extends Composite implements Comparable,
Directive
+public class ComponentDirective extends AbstractDirective implements
Comparable, Directive
{

//--------------------------------------------------------------------------
// static
@@ -102,44 +101,7 @@

private static final CategoriesDirective EMPTY_CATEGORIES =
new CategoriesDirective();
-
- //private static final ComponentDecoder DECODER = new ComponentDecoder();

- /*
- private static PartReference[] mergePartReferences(
- PartReference[] parts, ComponentDirective directive )
- {
- if( null == directive )
- {
- return parts;
- }
- else if( null == parts )
- {
- return directive.getPartReferences();
- }
- else
- {
- Hashtable table = new Hashtable();
- PartReference[] references = directive.getPartReferences();
- for( int i=0; i<references.length; i++ )
- {
- PartReference ref = references[i];
- String key = ref.getKey();
- table.put( key, ref );
- }
- for( int i=0; i<parts.length; i++ )
- {
- PartReference ref = parts[i];
- String key = ref.getKey();
- table.put( key, ref );
- }
- PartReference[] refs = (PartReference[]) table.values().toArray(
new PartReference[0] );
- Arrays.sort( refs );
- return refs;
- }
- }
- */
-

//--------------------------------------------------------------------------
// state

//--------------------------------------------------------------------------
@@ -190,6 +152,11 @@
*/
private final DefaultComposition m_base;

+ /**
+ * Internal parts.
+ */
+ private final PartReference[] m_parts;
+

//--------------------------------------------------------------------------
// constructors

//--------------------------------------------------------------------------
@@ -236,8 +203,6 @@
final PartReference[] parts,
final URI uri ) throws IOException
{
- super( parts );
-
if( null == activation )
{
if( null != uri )
@@ -334,8 +299,16 @@
m_collection = collection;
}

+ if( null == parts )
+ {
+ m_parts = new PartReference[0];
+ }
+ else
+ {
+ m_parts = parts;
+ }
+
m_uri = uri;
-
if( null != uri )
{
Part part = Part.load( uri );
@@ -379,6 +352,35 @@

//--------------------------------------------------------------------------

/**
+ * Returns the parts declared by this component type.
+ *
+ * @return the part descriptors
+ */
+ public PartReference[] getPartReferences()
+ {
+ return m_parts;
+ }
+
+ /**
+ * Retrieve an identified directive.
+ *
+ * @param key the directive key
+ * @return the directive or null if the directive key is unknown
+ */
+ public Directive getDirective( final String key )
+ {
+ for ( int i = 0; i < m_parts.length; i++ )
+ {
+ PartReference reference = m_parts[i];
+ if( reference.getKey().equals( key ) )
+ {
+ return reference.getDirective();
+ }
+ }
+ return null;
+ }
+
+ /**
* Return the profile name.
*
* @return the name of the component.
@@ -561,6 +563,10 @@
{
return false;
}
+ else if( !Arrays.equals( m_parts, profile.getPartReferences() ) )
+ {
+ return false;
+ }
else
{
return equals( m_uri, profile.getBaseURI() );
@@ -582,6 +588,7 @@
hash ^= hashValue( m_collection );
hash ^= hashValue( m_lifestyle );
hash ^= hashValue( m_uri );
+ hash ^= hashArray( m_parts );
return hash;
}


Deleted: trunk/main/metro/model/src/main/net/dpml/metro/info/Composite.java
===================================================================
--- trunk/main/metro/model/src/main/net/dpml/metro/info/Composite.java
2006-07-22 15:59:33 UTC (rev 1634)
+++ trunk/main/metro/model/src/main/net/dpml/metro/info/Composite.java
2006-07-23 06:21:33 UTC (rev 1635)
@@ -1,114 +0,0 @@
-/*
- * Copyright 2004 Stephen J. McConnell.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.dpml.metro.info;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-import net.dpml.component.Directive;
-
-import net.dpml.lang.AbstractDirective;
-
-/**
- * Abstract base class for composite entities.
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public abstract class Composite extends AbstractDirective implements
Serializable
-{
- static final long serialVersionUID = 1L;
-
- private final PartReference[] m_parts;
-
- /**
- * Creation of a new Composite instance.
- *
- * @param parts an array of part descriptors
- */
- public Composite( final PartReference[] parts )
- {
- if( null == parts )
- {
- m_parts = new PartReference[0];
- }
- else
- {
- m_parts = parts;
- }
- }
-
- /**
- * Returns the parts declared by this component type.
- *
- * @return the part descriptors
- */
- public PartReference[] getPartReferences()
- {
- return m_parts;
- }
-
- /**
- * Retrieve an identified directive.
- *
- * @param key the directive key
- * @return the directive or null if the directive key is unknown
- */
- public Directive getDirective( final String key )
- {
- for ( int i = 0; i < m_parts.length; i++ )
- {
- PartReference reference = m_parts[i];
- if( reference.getKey().equals( key ) )
- {
- return reference.getDirective();
- }
- }
- return null;
- }
-
- /**
- * Test is the supplied object is equal to this object.
- * @param other the other object
- * @return true if the object are equivalent
- */
- public boolean equals( Object other )
- {
- if( !super.equals( other ) )
- {
- return false;
- }
- if( !( other instanceof Composite ) )
- {
- return false;
- }
- Composite t = (Composite) other;
- return Arrays.equals( m_parts, t.m_parts );
- }
-
- /**
- * Return the hashcode for the object.
- * @return the hashcode value
- */
- public int hashCode()
- {
- int hash = getClass().hashCode();
- hash ^= hashArray( m_parts );
- return hash;
- }
-}

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-07-22 15:59:33 UTC (rev 1634)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-07-23 06:21:33 UTC (rev 1635)
@@ -148,25 +148,7 @@

/**
* Create a new remotely manageable component model.
- * @param anchor the parent classloader
- * @param classpath the classpath definition
- * @param partition the enclosing partition
- * @param directive the component definition
* @param key the component key
- * @return the managable component model
- */
- /*
- ComponentModel createComponentModel(
- ClassLoader anchor, Classpath classpath, String partition,
- ComponentDirective directive, String key )
- throws ControlException
- {
- return createComponentModel( anchor, classpath, partition,
directive, null );
- }
- */
- /**
- * Create a new remotely manageable component model.
- * @param key the component key
* @param anchor the parent classloader
* @param classpath the classpath definition
* @param partition the enclosing partition

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-07-22 15:59:33 UTC (rev 1634)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-07-23 06:21:33 UTC (rev 1635)
@@ -150,7 +150,7 @@
//--------------------------------------------------------------------

/**
- * Construct the deployment infomation for a part definition.
+ * Construct the deployment information from a part definition.
* @param info the part info definition
* @param classpath the part classpath definition
* @param strategy the DOM element definining the deplyment streategy




  • r1635 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks metro/model/src/main/net/dpml/metro/data metro/model/src/main/net/dpml/metro/info metro/runtime/src/main/net/dpml/metro/runtime, mcconnell at BerliOS, 07/23/2006

Archive powered by MHonArc 2.6.24.

Top of Page