Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2046 - in development/laboratory/plus: . api/meta api/meta/src/main/net/dpml/metro/meta standard/meta standard/meta/src/main/net/dpml/metro/meta/impl test/example/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: r2046 - in development/laboratory/plus: . api/meta api/meta/src/main/net/dpml/metro/meta standard/meta standard/meta/src/main/net/dpml/metro/meta/impl test/example/impl
  • Date: Sat, 12 Mar 2005 15:41:34 -0500

Author: mcconnell AT dpml.net
Date: Sat Mar 12 15:41:32 2005
New Revision: 2046

Added:

development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Catalog.java

development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/CatalogEntry.java
development/laboratory/plus/module.xml
Modified:
development/laboratory/plus/ (props changed)
development/laboratory/plus/api/meta/ (props changed)

development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/ComponentDescriptor.java

development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Descriptor.java
development/laboratory/plus/index.xml
development/laboratory/plus/standard/meta/ (props changed)

development/laboratory/plus/standard/meta/src/main/net/dpml/metro/meta/impl/antlib.xml
development/laboratory/plus/test/example/impl/build.xml
Log:
Addition of a Catalog for aggregation of catalog entries with a project.

Added:
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Catalog.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Catalog.java
Sat Mar 12 15:41:32 2005
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 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.metro.meta;
+
+import java.util.Properties;
+
+/**
+ * A catalog is an index of component descriptors packaged within a jar file.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ * @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
+ */
+public class Catalog extends Descriptor
+{
+ private final CatalogEntry[] m_entries;
+
+ public Catalog( CatalogEntry[] entries )
+ {
+ this( entries, null );
+ }
+
+ public Catalog( CatalogEntry[] entries, Properties properties )
+ {
+ super( properties );
+ if( null == entries )
+ {
+ throw new NullPointerException( "entries" );
+ }
+ m_entries = entries;
+ }
+
+ public CatalogEntry[] getEntries()
+ {
+ return m_entries;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ for( int i=0; i<m_entries.length; i++ )
+ {
+ hash ^= m_entries[i].hashCode();
+ }
+ return hash;
+ }
+
+ public boolean equals( Object other )
+ {
+ if( null == other )
+ {
+ return false;
+ }
+ else if( super.equals( other ) == false )
+ {
+ return false;
+ }
+ else if( other instanceof Catalog )
+ {
+ Catalog catalog = (Catalog) other;
+ if( false == equals( getEntries(), catalog.getEntries() ) )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+}
+

Added:
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/CatalogEntry.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/CatalogEntry.java
Sat Mar 12 15:41:32 2005
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 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.metro.meta;
+
+import java.util.Properties;
+
+/**
+ * A catalog entry is an immutable datatype describing an entry within a
catalog. Each
+ * entry references a path to a descriptor and the associated descriptor
type. The
+ * path corresponds to the package path and classname (e.g.
acme.wiget.StandardWidget).
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ * @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
+ */
+public class CatalogEntry extends Descriptor
+{
+ private final String m_path;
+ private final String m_type;
+
+ public CatalogEntry( String path, String type )
+ {
+ this( path, type, null );
+ }
+
+ public CatalogEntry( String path, String type, Properties properties )
+ {
+ super( properties );
+ m_path = path;
+ m_type = type;
+ }
+
+ public String getPath()
+ {
+ return m_path;
+ }
+
+ public String getType()
+ {
+ return m_type;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_path.hashCode();
+ hash ^= m_type.hashCode();
+ return hash;
+ }
+
+ public boolean equals( Object other )
+ {
+ if( null == other )
+ {
+ return false;
+ }
+ else if( super.equals( other ) == false )
+ {
+ return false;
+ }
+ else if( other instanceof CatalogEntry )
+ {
+ CatalogEntry entry = (CatalogEntry) other;
+ if( getPath().equals( entry.getPath() ) == false )
+ {
+ return false;
+ }
+ else if( getType().equals( entry.getType() ) == false )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+}
+

Modified:
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/ComponentDescriptor.java
==============================================================================
---
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/ComponentDescriptor.java
(original)
+++
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/ComponentDescriptor.java
Sat Mar 12 15:41:32 2005
@@ -92,15 +92,15 @@
hash ^= m_info.hashCode();
for( int i=0; i<m_dependencies.length; i++ )
{
- hash ^= m_dependencies.hashCode();
+ hash ^= m_dependencies[i].hashCode();
}
for( int i=0; i<m_services.length; i++ )
{
- hash ^= m_services.hashCode();
+ hash ^= m_services[i].hashCode();
}
for( int i=0; i<m_parts.length; i++ )
{
- hash ^= m_parts.hashCode();
+ hash ^= m_parts[i].hashCode();
}
return hash;
}
@@ -145,24 +145,6 @@
}
}

- public boolean equals( Object[] primary, Object[] secondary )
- {
- if( primary.length != secondary.length )
- {
- return false;
- }
- for( int i=0; i<primary.length; i++ )
- {
- Object prime = primary[i];
- Object second = secondary[i];
- if( prime.equals( second ) == false )
- {
- return false;
- }
- }
- return true;
- }
-
public String toString()
{
return "component#" + getInfoDescriptor().getClassname();

Modified:
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Descriptor.java
==============================================================================
---
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Descriptor.java
(original)
+++
development/laboratory/plus/api/meta/src/main/net/dpml/metro/meta/Descriptor.java
Sat Mar 12 15:41:32 2005
@@ -130,6 +130,24 @@
}
}

+ public boolean equals( Object[] primary, Object[] secondary )
+ {
+ if( primary.length != secondary.length )
+ {
+ return false;
+ }
+ for( int i=0; i<primary.length; i++ )
+ {
+ Object prime = primary[i];
+ Object second = secondary[i];
+ if( prime.equals( second ) == false )
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
/**
* Return the hashcode for the object.
* @return the hashcode value

Modified: development/laboratory/plus/index.xml
==============================================================================
--- development/laboratory/plus/index.xml (original)
+++ development/laboratory/plus/index.xml Sat Mar 12 15:41:32 2005
@@ -18,10 +18,25 @@
-->


-<index>
+<index key="dpml-plus">

<import uri="artifact:module:dpml/magic/dpml-magic#SNAPSHOT"/>

+ <project file="module.xml">
+ <info>
+ <group>dpml/metro</group>
+ <name>dpml-plus</name>
+ <version>1.0.0</version>
+ <status>SNAPSHOT</status>
+ <type>module</type>
+ </info>
+ <dependencies>
+ <include key="dpml-transit"/>
+ <include key="dpml-magic"/>
+ <include key="dpml-util"/>
+ </dependencies>
+ </project>
+
<project basedir="api/part">
<info>
<group>dpml/metro</group>

Added: development/laboratory/plus/module.xml
==============================================================================
--- (empty file)
+++ development/laboratory/plus/module.xml Sat Mar 12 15:41:32 2005
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<project name="dpml-plus" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="plugin:dpml/magic/dpml-magic-core">
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build">
+ <x:module index="index.xml">
+ <header>
+ <svn href="http://paris.dpml.net/svn/development/main/metro"/>
+ <home href="http://www.dpml.net/central/products/metro/"/>
+ </header>
+ </x:module>
+ <x:javadoc>
+ <link href="http://java.sun.com/j2se/1.4/docs/api"/>
+ </x:javadoc>
+ </target>
+
+ <target name="test" depends="standard.test">
+ <mkdir dir="target/reports/junit"/>
+ <junitreport todir="target/reports/junit">
+ <fileset dir=".">
+ <include name="**/target/test-reports/TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="target/reports/junit"/>
+ </junitreport>
+ </target>
+
+</project>

Modified:
development/laboratory/plus/standard/meta/src/main/net/dpml/metro/meta/impl/antlib.xml
==============================================================================
---
development/laboratory/plus/standard/meta/src/main/net/dpml/metro/meta/impl/antlib.xml
(original)
+++
development/laboratory/plus/standard/meta/src/main/net/dpml/metro/meta/impl/antlib.xml
Sat Mar 12 15:41:32 2005
@@ -1,5 +1,5 @@
<?xml version="1.0"?>

<antlib>
- <taskdef name="meta"
classname="net.dpml.metro.meta.impl.MetaDescriptorBuilderTask"/>
+ <taskdef name="catalog"
classname="net.dpml.metro.meta.impl.MetaDescriptorBuilderTask"/>
</antlib>

Modified: development/laboratory/plus/test/example/impl/build.xml
==============================================================================
--- development/laboratory/plus/test/example/impl/build.xml (original)
+++ development/laboratory/plus/test/example/impl/build.xml Sat Mar 12
15:41:32 2005
@@ -7,16 +7,16 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="package" depends="standard.package">
- <x:property name="builder.uri" feature="plugin"
key="dpml-metro-builder-impl"/>
- <meta xmlns="plugin:dpml/metro/dpml-metro-meta-impl">
+ <x:property name="metro.uri" feature="plugin"
key="dpml-metro-builder-impl"/>
+ <catalog xmlns="plugin:dpml/metro/dpml-metro-meta-impl">
<component class="net.dpml.test.hello.impl.DefaultOutputHandler"/>
<component class="net.dpml.test.hello.impl.HelloComponent">
<parts>
- <component xmlns="${builder.uri}"
+ <component xmlns="${metro.uri}"
class="net.dpml.test.hello.impl.DefaultOutputHandler"
name="outputHandler"/>
</parts>
</component>
- </meta>
+ </catalog>
</target>

</project>



  • svn commit: r2046 - in development/laboratory/plus: . api/meta api/meta/src/main/net/dpml/metro/meta standard/meta standard/meta/src/main/net/dpml/metro/meta/impl test/example/impl, mcconnell, 03/12/2005

Archive powered by MHonArc 2.6.24.

Top of Page