Skip to Content.
Sympa Menu

notify-dpml - r1406 - in trunk/main: depot/library/etc/test/samples depot/library/src/main/net/dpml/library depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/library/src/test/net/dpml/library/impl depot/library/src/test/net/dpml/library/info depot/tools/builder/src/main/net/dpml/tools/process depot/tools/builder/src/main/net/dpml/tools/tasks lang/module/etc metro metro/runtime metro/state/impl metro/test station station/server

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: r1406 - in trunk/main: depot/library/etc/test/samples depot/library/src/main/net/dpml/library depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/library/src/test/net/dpml/library/impl depot/library/src/test/net/dpml/library/info depot/tools/builder/src/main/net/dpml/tools/process depot/tools/builder/src/main/net/dpml/tools/tasks lang/module/etc metro metro/runtime metro/state/impl metro/test station station/server
  • Date: Tue, 25 Apr 2006 20:27:35 +0200

Author: mcconnell
Date: 2006-04-25 20:27:26 +0200 (Tue, 25 Apr 2006)
New Revision: 1406

Added:
trunk/main/depot/library/etc/test/samples/rmic.xml
trunk/main/depot/library/src/main/net/dpml/library/Data.java

trunk/main/depot/library/src/main/net/dpml/library/info/DataCollectionDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java

trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/RMICTask.java
Removed:
trunk/main/metro/runtime/build.xml
trunk/main/metro/state/impl/build.xml
Modified:
trunk/main/depot/library/src/main/net/dpml/library/Resource.java
trunk/main/depot/library/src/main/net/dpml/library/Type.java

trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java

trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java

trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/JarProcess.java
trunk/main/lang/module/etc/module.xsd
trunk/main/metro/module.xml
trunk/main/metro/test/build.xml
trunk/main/station/module.xml
trunk/main/station/server/build.xml
Log:
incorporate RMIC criteria into <project><data><rmic>...</rmic>

Added: trunk/main/depot/library/etc/test/samples/rmic.xml
===================================================================
--- trunk/main/depot/library/etc/test/samples/rmic.xml 2006-04-25 16:16:17
UTC (rev 1405)
+++ trunk/main/depot/library/etc/test/samples/rmic.xml 2006-04-25 18:27:26
UTC (rev 1406)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<library xmlns="@MODULE-XSD-URI@">
+
+ <modules>
+ <module name="acme">
+ <data>
+ <rmic>
+ <include name="red"/>
+ <include name="white"/>
+ <include name="blue"/>
+ <exclude name="pink"/>
+ <exclude name="magenta"/>
+ </rmic>
+ </data>
+ </module>
+ </modules>
+
+</library>

Added: trunk/main/depot/library/src/main/net/dpml/library/Data.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Data.java
2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/depot/library/src/main/net/dpml/library/Data.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 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.library;
+
+import org.w3c.dom.Element;
+
+/**
+ * Declaration of a production criteria datatype.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Data
+{
+ /**
+ * Return the data type id.
+ * @return the datatype id
+ */
+ String getID();
+
+ /**
+ * Return the datatype criteria.
+ * @return the criteria in the form of a DOM element.
+ */
+ Element getElement();
+
+}

Modified: trunk/main/depot/library/src/main/net/dpml/library/Resource.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Resource.java
2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/depot/library/src/main/net/dpml/library/Resource.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -22,6 +22,7 @@

import net.dpml.library.info.Scope;
import net.dpml.library.info.ResourceDirective.Classifier;
+import net.dpml.library.info.DataDirective;

import net.dpml.transit.Artifact;
import net.dpml.lang.Category;
@@ -188,4 +189,11 @@
* @return the filename
*/
String getLayoutPath( String id );
+
+ /**
+ * Return a data directive matching the supplied key.
+ * @param key the datatype key
+ * @return the selected datatype or null of unknown
+ */
+ DataDirective getDataDirective( String key );
}

Modified: trunk/main/depot/library/src/main/net/dpml/library/Type.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Type.java
2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/depot/library/src/main/net/dpml/library/Type.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -44,7 +44,6 @@
* Return the type production datatype.
* @return the datatytpe
*/
- //Object getData();
Element getElement();



Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -221,6 +221,16 @@

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

/**
+ * Return a data directive matching the supplied key.
+ * @param key the datatype key
+ * @return the selected datatype or null of unknown
+ */
+ public DataDirective getDataDirective( final String key )
+ {
+ return m_directive.getDataDirective( key );
+ }
+
+ /**
* Return the singleton library.
* @return the library
*/

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/LibraryDecoder.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -43,6 +43,10 @@
import net.dpml.library.info.FeatureFilterDirective;
import net.dpml.library.info.DataDirective;
import net.dpml.library.info.Scope;
+import net.dpml.library.info.PatternDirective;
+import net.dpml.library.info.IncludePatternDirective;
+import net.dpml.library.info.ExcludePatternDirective;
+import net.dpml.library.info.RMICDirective;

import net.dpml.lang.Category;
import net.dpml.lang.Part;
@@ -731,10 +735,14 @@
else if( MODULE_XSD_URI.equals( namespace ) )
{
String tag = element.getTagName();
- if( "filters".equals( tag ) )
+ if( FiltersDirective.KEY.equals( tag ) )
{
- return buildFilters( element );
+ return buildFiltersDirective( element );
}
+ else if( RMICDirective.KEY.equals( tag ) )
+ {
+ return buildRMICDirective( element );
+ }
else
{
final String error =
@@ -752,8 +760,35 @@
}
}

- private FiltersDirective buildFilters( Element element ) throws Exception
+ private RMICDirective buildRMICDirective( Element element ) throws
Exception
{
+ PatternDirective[] patterns = buildPatternDirectives( element );
+ return new RMICDirective( patterns );
+ }
+
+ private PatternDirective[] buildPatternDirectives( Element element )
throws Exception
+ {
+ Element[] children = ElementHelper.getChildren( element );
+ PatternDirective[] patterns = new PatternDirective[ children.length
];
+ for( int i=0; i<children.length; i++ )
+ {
+ Element child = children[i];
+ String tag = child.getTagName();
+ String name = ElementHelper.getAttribute( child, "name" );
+ if( "include".equals( tag ) )
+ {
+ patterns[i] = new IncludePatternDirective( name );
+ }
+ else
+ {
+ patterns[i] = new ExcludePatternDirective( name );
+ }
+ }
+ return patterns;
+ }
+
+ private FiltersDirective buildFiltersDirective( Element element ) throws
Exception
+ {
if( null == element )
{
return new FiltersDirective( new FilterDirective[0] );

Added:
trunk/main/depot/library/src/main/net/dpml/library/info/DataCollectionDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/DataCollectionDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/DataCollectionDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005 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.library.info;
+
+import java.util.ArrayList;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * A datatype definining a collection of source includes and excludes.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public abstract class DataCollectionDirective extends DataDirective
+{
+ private final PatternDirective[] m_patterns;
+
+ /**
+ * Creation of a new data directive.
+ * @param key the unique datatype key
+ */
+ public DataCollectionDirective( String key, PatternDirective[] patterns )
+ {
+ super( key );
+ if( null == patterns )
+ {
+ throw new NullPointerException( "patterns" );
+ }
+ m_patterns = patterns;
+ }
+
+ /**
+ * Return the array of pattern directives (includes and excludes).
+ * @return the pattern array
+ */
+ public PatternDirective[] getPatternDirectives()
+ {
+ return m_patterns;
+ }
+
+ /**
+ * Return the set of include directives.
+ * @return the includes
+ */
+ public IncludePatternDirective[] getIncludes()
+ {
+ ArrayList list = new ArrayList();
+ for( int i=0; i<m_patterns.length; i++ )
+ {
+ if( m_patterns[i] instanceof IncludePatternDirective )
+ {
+ list.add( m_patterns[i] );
+ }
+ }
+ return (IncludePatternDirective[]) list.toArray( new
IncludePatternDirective[0] );
+ }
+
+ /**
+ * Return the set of exclude directives.
+ * @return the excludes
+ */
+ public ExcludePatternDirective[] getExcludes()
+ {
+ ArrayList list = new ArrayList();
+ for( int i=0; i<m_patterns.length; i++ )
+ {
+ if( m_patterns[i] instanceof ExcludePatternDirective )
+ {
+ list.add( m_patterns[i] );
+ }
+ }
+ return (ExcludePatternDirective[]) list.toArray( new
ExcludePatternDirective[0] );
+ }
+}

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/DataDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -28,23 +28,23 @@
*/
public abstract class DataDirective extends AbstractDirective
{
- private final String m_key;
+ private final String m_id;

/**
* Creation of a new data directive.
- * @param key the unique datatype key
+ * @param id the unique datatype key
*/
- public DataDirective( String key )
+ public DataDirective( String id )
{
- m_key = key;
+ m_id = id;
}

/**
- * Return the datatype key.
- * @return the key
+ * Return the datatype id.
+ * @return the id
*/
- public String getKey()
+ public String getID()
{
- return m_key;
+ return m_id;
}
}

Added:
trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/ExcludePatternDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2006 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.library.info;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * The ExcludePatternDirective identifies an exclusion pattern.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class ExcludePatternDirective extends PatternDirective
+{
+ /**
+ * Creation of a new exclusion directive.
+ * @param name the file to include
+ */
+ public ExcludePatternDirective( String name )
+ {
+ super( name );
+ }
+}

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/FiltersDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -28,6 +28,11 @@
*/
public class FiltersDirective extends DataDirective
{
+ /**
+ * Reserved key.
+ */
+ public static final String KEY = "filters";
+
private final FilterDirective[] m_filters;

/**

Added:
trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/IncludePatternDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005 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.library.info;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * The IncludePatternDirective identifies an inclusion pattern.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class IncludePatternDirective extends PatternDirective
+{
+ /**
+ * Creation of a new inclusion directive.
+ * @param name the file to include
+ */
+ public IncludePatternDirective( String name )
+ {
+ super( name );
+ }
+}

Added:
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/JavacDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005 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.library.info;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * Definition of the RMIC compilation criteria.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public abstract class JavacDirective extends DataCollectionDirective
+{
+ /**
+ * Reserved datatype key.
+ */
+ public static final String KEY = "compile-main";
+
+ /**
+ * Creation of a new data directive.
+ * @param key the unique datatype key
+ */
+ public JavacDirective( String key, PatternDirective[] patterns )
+ {
+ super( key, patterns );
+ }
+}

Added:
trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/PatternDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2005 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.library.info;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * Abstract base class for includes and excludes used within collections.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public abstract class PatternDirective extends AbstractDirective
+{
+ private final String m_name;
+
+ /**
+ * Creation of a new include directive.
+ * @param mode the include mode
+ * @param category the runtime category
+ * @param value the value (key or reference address depending on mode)
+ * @param properties supplimentary properties
+ */
+ public PatternDirective( String name )
+ {
+ if( null == name )
+ {
+ throw new NullPointerException( "name" );
+ }
+ m_name = name;
+ }
+
+ /**
+ * Return the include value.
+ * @return the value
+ */
+ public String getName()
+ {
+ return m_name;
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof PatternDirective ) )
+ {
+ PatternDirective include = (PatternDirective) other;
+ return equals( m_name, include.m_name );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hascode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= super.hashValue( m_name );
+ return hash;
+ }
+
+ /**
+ * Return a string representation of the include.
+ * @return the string value
+ */
+ public String toString()
+ {
+ return "include:" + m_name;
+ }
+}

Added:
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/RMICDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005 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.library.info;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * Definition of the RMIC compilation criteria.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class RMICDirective extends DataCollectionDirective
+{
+ /**
+ * Reserved datatype key.
+ */
+ public static final String KEY = "rmic";
+
+ /**
+ * Creation of a new data directive.
+ * @param key the unique datatype key
+ */
+ public RMICDirective( PatternDirective[] patterns )
+ {
+ super( KEY, patterns );
+ }
+}

Modified:
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/main/net/dpml/library/info/ResourceDirective.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -286,7 +286,7 @@
for( int i=0; i<m_data.length; i++ )
{
DataDirective data = m_data[i];
- if( key.equals( data.getKey() ) )
+ if( key.equals( data.getID() ) )
{
return data;
}

Added:
trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java
===================================================================
--- trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java
2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/depot/library/src/test/net/dpml/library/impl/RMICTestCase.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2004-2006 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.library.impl;
+
+import java.io.File;
+
+import net.dpml.library.Filter;
+import net.dpml.library.Module;
+import net.dpml.library.Resource;
+
+import net.dpml.library.info.RMICDirective;
+
+import net.dpml.util.Logger;
+import net.dpml.util.DefaultLogger;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Test rmic criteria.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class RMICTestCase extends TestCase
+{
+ static
+ {
+ System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
+ }
+
+ private LibraryDecoder m_decoder;
+
+ /**
+ * Setup the library directive builder.
+ * @exception Exception if an error occurs during test execution
+ */
+ public void setUp() throws Exception
+ {
+ m_decoder = new LibraryDecoder();
+ }
+
+ /**
+ * Test an library definition containing duplicate modules.
+ * @exception Exception if an error occurs during test execution
+ */
+ public void testModuleFilters() throws Exception
+ {
+ String base = System.getProperty( "project.test.dir" );
+ File test = new File( base );
+ File file = new File( test, "samples/rmic.xml" );
+ Logger logger = new DefaultLogger( "test" );
+ DefaultLibrary library = new DefaultLibrary( logger, file );
+ Module acme = library.getModule( "acme" );
+ RMICDirective rmic = (RMICDirective) acme.getDataDirective(
RMICDirective.KEY );
+ assertEquals( "includes", 3, rmic.getIncludes().length );
+ assertEquals( "excludes", 2, rmic.getExcludes().length );
+ }
+}

Added:
trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/library/src/test/net/dpml/library/info/RMICDirectiveTestCase.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005 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.library.info;
+
+/**
+ * Test and validate the RMICDirective class.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public final class RMICDirectiveTestCase extends AbstractTestCase
+{
+ static final PatternDirective[] PATTERNS =
+ new PatternDirective[]
+ {
+ new IncludePatternDirective( "foo" ),
+ new ExcludePatternDirective( "bar" )
+ };
+
+ static final RMICDirective RMIC = new RMICDirective( PATTERNS );
+
+ /**
+ * Test null argument.
+ */
+ public void testNullArgs()
+ {
+ try
+ {
+ RMICDirective rmic = new RMICDirective( null );
+ fail( "Did not thow a NPE" );
+ }
+ catch( NullPointerException e )
+ {
+ // success
+ }
+ }
+
+ /**
+ * Test accessor.
+ */
+ public void testPatternAccessor()
+ {
+ assertEquals( "patterns", PATTERNS, RMIC.getPatternDirectives() );
+ }
+
+ /**
+ * Test directive serialization.
+ * @exception Exception if an error occurs
+ */
+ public void testSerialization() throws Exception
+ {
+ doSerializationTest( RMIC );
+ }
+
+}

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/JarProcess.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/JarProcess.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/JarProcess.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -20,13 +20,16 @@

import java.io.File;

+import net.dpml.library.Resource;
import net.dpml.library.info.Scope;
+import net.dpml.library.info.RMICDirective;

import net.dpml.tools.model.Context;

import net.dpml.tools.tasks.JavacTask;
import net.dpml.tools.tasks.JarTask;
import net.dpml.tools.tasks.JUnitTestTask;
+import net.dpml.tools.tasks.RMICTask;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -54,6 +57,17 @@
task.setProject( project );
task.init();
task.execute();
+
+ Resource resource = context.getResource();
+ RMICDirective rmic = (RMICDirective) resource.getDataDirective(
RMICDirective.KEY );
+ if( null != rmic )
+ {
+ System.out.println( "## WE HAVE AN RMIC assertion" );
+ RMICTask rmicTask = new RMICTask( context, rmic );
+ rmicTask.setProject( project );
+ rmicTask.init();
+ rmicTask.execute();
+ }
}

/**

Added:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/RMICTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/RMICTask.java
2006-04-25 16:16:17 UTC (rev 1405)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/RMICTask.java
2006-04-25 18:27:26 UTC (rev 1406)
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2006 Stephen 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.tools.tasks;
+
+import java.io.File;
+
+import net.dpml.library.Resource;
+import net.dpml.library.info.RMICDirective;
+import net.dpml.library.info.IncludePatternDirective;
+import net.dpml.library.info.ExcludePatternDirective;
+import net.dpml.library.info.Scope;
+
+import net.dpml.tools.model.Context;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Rmic;
+import org.apache.tools.ant.types.Path;
+
+/**
+ * Compile sources located in ${project.target}/main to java class file under
+ * the ${project.target}/classes directory. Properties influencing the
compilation
+ * include:
+ * <ul>
+ * <li>project.javac.debug : boolean true (default) or false</li>
+ * <li>project.javac.fork: boolean true or false (default) </li>
+ * <li>project.javac.deprecation: boolean true (default) or false</li>
+ * </ul>
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class RMICTask extends GenericTask
+{
+ private final Context m_context;
+ private final RMICDirective m_data;
+ private String m_classPathRef;
+ private File m_base;
+
+ /**
+ * Creation of a new RMICTask.
+ * @param context the project context
+ */
+ public RMICTask( Context context, RMICDirective directive )
+ {
+ super();
+ m_context = context;
+ m_data = directive;
+ try
+ {
+ setProject( context.getProject() );
+ setTaskName( "rmic" );
+ setBase( context.getTargetClassesMainDirectory() );
+ context.getPath( Scope.RUNTIME );
+ setClasspathRef( "project.compile.path" );
+ }
+ catch( Exception e )
+ {
+ throw new BuildException( e );
+ }
+ }
+
+ /**
+ * Set the id of the compilation classpath.
+ * @param id the classpath reference
+ */
+ public void setClasspathRef( String id )
+ {
+ m_classPathRef = id;
+ }
+
+ /**
+ * Set the destination directory.
+ * @param destination the destination directory
+ */
+ public void setBase( File base )
+ {
+ m_base = base;
+ }
+
+ /**
+ * Task execution.
+ */
+ public void execute()
+ {
+ if( null == m_base )
+ {
+ final String error =
+ "Missing 'base' argument.";
+ throw new BuildException( error, getLocation() );
+ }
+
+ if( !m_base.exists() )
+ {
+ return;
+ }
+
+ final Rmic rmic = (Rmic) getProject().createTask( "rmic" );
+ rmic.setTaskName( "rmic" );
+ final Project project = m_context.getProject();
+ rmic.setProject( project );
+ rmic.setBase( m_base );
+ final Path classpath = getClasspath();
+ rmic.setClasspath( classpath );
+
+ // populate includes/excludes
+
+ IncludePatternDirective[] includes = m_data.getIncludes();
+ for( int i=0; i<includes.length; i++ )
+ {
+ IncludePatternDirective include = includes[i];
+ rmic.createInclude().setName( include.getName() );
+ }
+
+ ExcludePatternDirective[] excludes = m_data.getExcludes();
+ for( int i=0; i<excludes.length; i++ )
+ {
+ ExcludePatternDirective exclude = excludes[i];
+ rmic.createExclude().setName( exclude.getName() );
+ }
+
+ // initialize and execute
+
+ rmic.init();
+ rmic.execute();
+ }
+
+ private Path getClasspath()
+ {
+ if( null != m_classPathRef )
+ {
+ return (Path) getProject().getReference( m_classPathRef );
+ }
+ else
+ {
+ final String error =
+ "Missing 'classpathRef' attribute.";
+ throw new BuildException( error, getLocation() );
+ }
+ }
+}

Modified: trunk/main/lang/module/etc/module.xsd
===================================================================
--- trunk/main/lang/module/etc/module.xsd 2006-04-25 16:16:17 UTC (rev
1405)
+++ trunk/main/lang/module/etc/module.xsd 2006-04-25 18:27:26 UTC (rev
1406)
@@ -19,6 +19,7 @@
<element name="filters" type="this:FiltersType"
substitutionGroup="common:data"/>
<element name="filter" type="this:Filter"
substitutionGroup="this:abstract-filter"/>
<element name="feature" type="this:Feature"
substitutionGroup="this:abstract-filter"/>
+ <element name="rmic" type="this:RMICType"
substitutionGroup="common:data"/>

<complexType name="LibraryType">
<all>
@@ -183,7 +184,41 @@
<enumeration value="private"/>
</restriction>
</simpleType>
+
+ <complexType name="RMICType">
+ <complexContent>
+ <extension base="this:PatternCollectionType"/>
+ </complexContent>
+ </complexType>

+ <complexType name="PatternCollectionType">
+ <complexContent>
+ <extension base="common:AbstractData">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="include" type="this:IncludePatternType"/>
+ <element name="exclude" type="this:ExcludePatternType"/>
+ </choice>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="IncludePatternType">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="name" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <complexType name="ExcludePatternType">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="name" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+
<complexType name="FiltersType">
<complexContent>
<extension base="common:AbstractData">

Modified: trunk/main/metro/module.xml
===================================================================
--- trunk/main/metro/module.xml 2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/metro/module.xml 2006-04-25 18:27:26 UTC (rev 1406)
@@ -27,6 +27,9 @@
<filters>
<feature token="STATE-XSD-URI" id="uri" type="xsd"
ref="dpml/lang/dpml-state"/>
</filters>
+ <rmic>
+ <include name="**/DefaultStateListener.class"/>
+ </rmic>
</data>
</project>

@@ -139,9 +142,18 @@
<feature token="TYPE-XSD-URI" id="uri" type="xsd"
ref="dpml/lang/dpml-type"/>
<feature token="COMPONENT-XSD-URI" id="uri" type="xsd"
ref="dpml/lang/dpml-component"/>
</filters>
+ <rmic>
+ <include name="**/DefaultComponentModel.class"/>
+ <include name="**/DefaultContextModel.class"/>
+ <include name="**/DefaultComponentHandler.class"/>
+ <include name="**/DefaultProvider.class"/>
+ <include name="**/DefaultComponentHandler.class"/>
+ <include name="**/CompositionHandler.class"/>
+ <include name="**/ValueHandler.class"/>
+ </rmic>
</data>
</project>
-
+
<project name="dpml-metro-tools" basedir="tools">
<info>
<description title="DPML Metro Tools">
@@ -188,6 +200,11 @@
<include key="dpml-metro-tools"/>
</test>
</dependencies>
+ <data>
+ <rmic>
+ <include name="**/ManagedComponent#DefaultMonitor.class"/>
+ </rmic>
+ </data>
</project>

</module>

Deleted: trunk/main/metro/runtime/build.xml
===================================================================
--- trunk/main/metro/runtime/build.xml 2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/metro/runtime/build.xml 2006-04-25 18:27:26 UTC (rev 1406)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright 2005 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.
--->
-
-<project name="dpml-metro-runtime"
- xmlns:transit="antlib:net.dpml.transit"
- xmlns:x="dpml:depot"
- default="install">
-
- <transit:import uri="local:template:dpml/tools/standard"/>
-
- <target name="build" depends="standard.build">
- <rmic base="${project.target.classes.main.dir}"
classpathref="project.compile.path">
- <include name="**/DefaultComponentModel.class"/>
- <include name="**/DefaultContextModel.class"/>
- <include name="**/DefaultComponentHandler.class"/>
- <include name="**/DefaultProvider.class"/>
- <include name="**/DefaultComponentHandler.class"/>
- <include name="**/CompositionHandler.class"/>
- <include name="**/ValueHandler.class"/>
- </rmic>
- </target>
-
-</project>
-
-

Deleted: trunk/main/metro/state/impl/build.xml
===================================================================
--- trunk/main/metro/state/impl/build.xml 2006-04-25 16:16:17 UTC (rev
1405)
+++ trunk/main/metro/state/impl/build.xml 2006-04-25 18:27:26 UTC (rev
1406)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright 2005 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.
--->
-
-<project name="dpml-state-impl"
- xmlns:transit="antlib:net.dpml.transit"
- default="install">
-
- <transit:import uri="local:template:dpml/tools/standard"/>
-
- <target name="build" depends="standard.build">
- <rmic base="${project.target.classes.main.dir}"
classpathref="project.compile.path">
- <include name="**/DefaultStateListener.class"/>
- </rmic>
- </target>
-
-</project>
-
-

Modified: trunk/main/metro/test/build.xml
===================================================================
--- trunk/main/metro/test/build.xml 2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/metro/test/build.xml 2006-04-25 18:27:26 UTC (rev 1406)
@@ -24,20 +24,8 @@

<transit:import uri="local:template:dpml/tools/standard"/>

- <target name="prepare" depends="standard.prepare">
- <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
- <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
- </x:plugin>
- <convert srcdir="target/build/main" destdir="target/reports/src"/>
- <convert srcdir="target/build/test" destdir="target/reports/src"/>
- </target>
-
<target name="build" depends="standard.build">

- <rmic base="${project.target.classes.main.dir}"
classpathref="project.compile.path">
- <include name="**/ManagedComponent#DefaultMonitor.class"/>
- </rmic>
-
<x:plugin uri="link:part:dpml/metro/dpml-metro-tools"/>

<!-- create the test component types -->

Modified: trunk/main/station/module.xml
===================================================================
--- trunk/main/station/module.xml 2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/station/module.xml 2006-04-25 18:27:26 UTC (rev 1406)
@@ -95,6 +95,11 @@
<filters>
<feature token="APPLICATION-XSD-URI"
ref="dpml/lang/dpml-application" type="xsd" id="uri"/>
</filters>
+ <rmic>
+ <include name="**/RemoteApplicationRegistry.class"/>
+ <include name="**/RemoteApplication.class"/>
+ <include name="**/RemoteStation.class"/>
+ </rmic>
</data>
</project>


Modified: trunk/main/station/server/build.xml
===================================================================
--- trunk/main/station/server/build.xml 2006-04-25 16:16:17 UTC (rev 1405)
+++ trunk/main/station/server/build.xml 2006-04-25 18:27:26 UTC (rev 1406)
@@ -6,14 +6,6 @@

<transit:import uri="local:template:dpml/tools/standard"/>

- <target name="build" depends="standard.build">
- <rmic base="${project.target.classes.main.dir}"
classpathref="project.compile.path">
- <include name="**/RemoteApplicationRegistry.class"/>
- <include name="**/RemoteApplication.class"/>
- <include name="**/RemoteStation.class"/>
- </rmic>
- </target>
-
<available property="dpml.exe.available"
file="${dpml.system}/bin/server/dpml.exe"/>

<target name="install" depends="bin,standard.install">




  • r1406 - in trunk/main: depot/library/etc/test/samples depot/library/src/main/net/dpml/library depot/library/src/main/net/dpml/library/impl depot/library/src/main/net/dpml/library/info depot/library/src/test/net/dpml/library/impl depot/library/src/test/net/dpml/library/info depot/tools/builder/src/main/net/dpml/tools/process depot/tools/builder/src/main/net/dpml/tools/tasks lang/module/etc metro metro/runtime metro/state/impl metro/test station station/server, mcconnell at BerliOS, 04/25/2006

Archive powered by MHonArc 2.6.24.

Top of Page