Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2062 - in development/laboratory/plus: . api/builder/src/main/net/dpml/metro/builder api/control/src/main/net/dpml/metro/control api/kernel/src/main/net/dpml/metro/home api/model api/model/src/main/net/dpml/metro/meta api/model/src/main/net/dpml/metro/model api/model/src/test/net/dpml/metro/model api/part/src/main/net/dpml/metro/part core/src/main/net/dpml/metro/home core/src/main/net/dpml/metro/home/impl core/src/main/net/dpml/metro/kernel/impl standard/builder standard/builder/src/main/net/dpml/metro/builder/impl standard/builder/src/main/net/dpml/metro/builder/part standard/builder/src/main/net/dpml/metro/builder/type standard/control standard/control/src/main/net/dpml/metro/control/impl test/example/impl test/execution

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: r2062 - in development/laboratory/plus: . api/builder/src/main/net/dpml/metro/builder api/control/src/main/net/dpml/metro/control api/kernel/src/main/net/dpml/metro/home api/model api/model/src/main/net/dpml/metro/meta api/model/src/main/net/dpml/metro/model api/model/src/test/net/dpml/metro/model api/part/src/main/net/dpml/metro/part core/src/main/net/dpml/metro/home core/src/main/net/dpml/metro/home/impl core/src/main/net/dpml/metro/kernel/impl standard/builder standard/builder/src/main/net/dpml/metro/builder/impl standard/builder/src/main/net/dpml/metro/builder/part standard/builder/src/main/net/dpml/metro/builder/type standard/control standard/control/src/main/net/dpml/metro/control/impl test/example/impl test/execution
  • Date: Mon, 14 Mar 2005 10:09:24 -0500

Author: mcconnell AT dpml.net
Date: Mon Mar 14 10:09:23 2005
New Revision: 2062

Added:

development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/BuilderRuntimeException.java

development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/ControlBuilder.java

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/MasterController.java

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Monitor.java
- copied, changed from r2050,
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/ControlMonitor.java

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/NoSuchControlException.java
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/

development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HandlerNotFoundException.java

development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/Home.java

development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HomeException.java

development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HomeRuntimeException.java

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

development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentPartHandler.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/BadStrategyException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/ControlDescriptor.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Handler.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Holder.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHandler.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHandlerRuntimeException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHolder.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartNotFoundException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/RegistryNotFoundException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/RegistryRuntimeException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeEntry.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeHandler.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeHandlerRuntimeException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeNotFoundException.java

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeReference.java
development/laboratory/plus/core/src/main/net/dpml/metro/home/
development/laboratory/plus/core/src/main/net/dpml/metro/home/impl/

development/laboratory/plus/core/src/main/net/dpml/metro/home/impl/TransitHome.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentTypeBuilderTask.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ControlDescriptorBuilderTask.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ControlsDataType.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
- copied, changed from r2052,
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/CatalogTask.java

development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DebugController.java
- copied, changed from r2050,
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DefaultController.java
Removed:

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/ControlMonitor.java

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/StartableController.java

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/StartableMonitor.java

development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ClassLoaderModel.java

development/laboratory/plus/api/model/src/main/net/dpml/metro/model/PartModel.java

development/laboratory/plus/api/model/src/test/net/dpml/metro/model/ComponentModelTestCase.java

development/laboratory/plus/api/model/src/test/net/dpml/metro/model/PartModelTestCase.java

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

development/laboratory/plus/api/part/src/main/net/dpml/metro/part/CatalogEntry.java

development/laboratory/plus/core/src/main/net/dpml/metro/kernel/impl/DefaultKernel.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/CatalogTask.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentDescriptorDataType.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilder.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/part/

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/type/

development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DefaultController.java
Modified:

development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/Builder.java

development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/PartBuilder.java

development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/TypeBuilder.java

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Controller.java
development/laboratory/plus/api/model/build.xml

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

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

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

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

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

development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentModel.java
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Part.java
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Type.java
development/laboratory/plus/index.xml
development/laboratory/plus/standard/builder/build.xml

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/MarshalledObjectHelper.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/PartsDataType.java

development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/antlib.xml
development/laboratory/plus/standard/control/build.xml
development/laboratory/plus/test/example/impl/build.xml
development/laboratory/plus/test/execution/build.xml
Log:
Getting control concepts in place, breaking a few things, added a type
registry (serialized), and restructured the type/part handler relationship so
a part handler extends the type handler.

Modified:
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/Builder.java
==============================================================================
---
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/Builder.java
(original)
+++
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/Builder.java
Mon Mar 14 10:09:23 2005
@@ -37,11 +37,4 @@
*/
URI getBuilderURI();

- /**
- * Return a urn identitifying the strategy.
- *
- * @return a strategy uri
- */
- URI getStrategyURI();
-
}

Added:
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/BuilderRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/BuilderRuntimeException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,33 @@
+/*
+ * 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.builder;
+
+/**
+ * An exception throws if an internal error occurs during builder execution.
+ *
+ * @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 BuilderRuntimeException extends RuntimeException
+{
+ public BuilderRuntimeException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}

Added:
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/ControlBuilder.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/ControlBuilder.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,45 @@
+/*
+ * 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.builder;
+
+import java.net.URI;
+
+import net.dpml.metro.part.ControlDescriptor;
+
+/**
+ * The contract for builders that creates a control descriptor.
+ *
+ * @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 interface ControlBuilder extends Builder
+{
+ /**
+ * Return a urn identitifying the control handler for this builder.
+ *
+ * @return a uri identifing the type handler.
+ */
+ URI getControlHandlerURI();
+
+ /**
+ * Build a control descriptor.
+ * @return the serializable control descriptor.
+ */
+ ControlDescriptor buildControl();
+}

Modified:
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/PartBuilder.java
==============================================================================
---
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/PartBuilder.java
(original)
+++
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/PartBuilder.java
Mon Mar 14 10:09:23 2005
@@ -19,8 +19,12 @@
package net.dpml.metro.builder;

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

import net.dpml.metro.part.Part;
+import net.dpml.metro.part.RegistryNotFoundException;
+import net.dpml.metro.part.BadStrategyException;
+import net.dpml.metro.part.TypeNotFoundException;

/**
* The contract for builders that create component part.
@@ -31,17 +35,25 @@
public interface PartBuilder extends Builder
{
/**
- * Build the part.
- * @return the serializable part
- * @exception Exception if a construction error occurs
+ * Return a urn identitifying the part handler for this builder.
+ *
+ * @return a strategy uri
+ */
+ URI getPartHandlerURI();
+
+ /**
+ * Return the key identifying the part that this builder is building.
*/
- Part buildPart() throws Exception;
+ String getKey();

/**
* Build the part.
+ * @param classloader the classloader to use if type creation is required
* @return the serializable part
* @exception Exception if a construction error occurs
*/
- Part buildPart( URI[] uris ) throws Exception;
+ Part buildPart( ClassLoader classloader )
+ throws IntrospectionException, IOException, ClassNotFoundException,
+ RegistryNotFoundException, BadStrategyException,
TypeNotFoundException;

}

Modified:
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/TypeBuilder.java
==============================================================================
---
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/TypeBuilder.java
(original)
+++
development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/TypeBuilder.java
Mon Mar 14 10:09:23 2005
@@ -18,9 +18,13 @@

package net.dpml.metro.builder;

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

import net.dpml.metro.part.Type;
+import net.dpml.metro.part.RegistryNotFoundException;
+import net.dpml.metro.part.BadStrategyException;
+import net.dpml.metro.part.TypeNotFoundException;

/**
* The contract for builders that create component part.
@@ -31,23 +35,19 @@
public interface TypeBuilder extends Builder
{
/**
- * Return a urn identitifying the strategy.
+ * Return a urn identitifying the type handler for this builder.
*
- * @return a strategy uri
+ * @return a uri identifing the type handler.
*/
- URI getStrategyURI();
+ URI getTypeHandlerURI();

/**
* Build a part type.
* @return the serializable part type.
* @exception IntrospectionException if a introspection occurs during
type construction
*/
- Type buildType( ClassLoader classloader ) throws IntrospectionException;
-
- /**
- * Return the path to the resource containing the defintion of the type.
- * @return the resource path
- */
- String getResourcePath();
+ Type buildType( ClassLoader classloader )
+ throws IntrospectionException, IOException, ClassNotFoundException,
+ RegistryNotFoundException, BadStrategyException,
TypeNotFoundException;

}

Modified:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Controller.java
==============================================================================
---
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Controller.java
(original)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Controller.java
Mon Mar 14 10:09:23 2005
@@ -18,6 +18,8 @@

package net.dpml.metro.control;

+import java.net.URI;
+
import net.dpml.metro.part.Part;

/**
@@ -34,7 +36,22 @@
*/
String getName();

- void load( Part part ) throws Exception;
+ /**
+ * Return the uri identifying this controller type.
+ * @return the controller uri
+ */
+ URI getControllerURI();
+
+ /**
+ * Start the controller.
+ * @param monitor a control monitor supplied by a controlling system
+ * @exception if a startup failure occurs
+ */
+ void start() throws Exception;
+
+ /**
+ * Stop the controller.
+ */
+ void stop();

- void list( Part part );
}

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/MasterController.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/MasterController.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,51 @@
+/*
+ * 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.control;
+
+import net.dpml.metro.part.ControlDescriptor;
+
+/**
+ * Master controller interface. This interface should allow the dynamic
+ * addition, modification and removal of optional controllers and control
+ * over the starting, monitoring and interuption of all controller instances
+ * in model and application space relative to an associated part.
+ *
+ * @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 interface MasterController extends Controller
+{
+ /**
+ * Return an array of the standard controllers asociated
+ * with the part.
+ *
+ * @return the standard controller descriptor array
+ */
+ ControlDescriptor[] getControllers();
+
+ /**
+ * Returns the descriptor of a named controller.
+ *
+ * @return the controller descriptor
+ */
+ ControlDescriptor getControlDescriptor( String name ) throws
NoSuchControlException;
+
+ // MUCH MORE PENDING
+
+}

Copied:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Monitor.java
(from r2050,
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/ControlMonitor.java)
==============================================================================
---
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/ControlMonitor.java
(original)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Monitor.java
Mon Mar 14 10:09:23 2005
@@ -24,19 +24,25 @@
* @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 interface ControlMonitor
+public interface Monitor
{
/**
+ * Log the supplied debug level message.
+ * @param mesage the message to log
+ */
+ void debug( String message );
+
+ /**
* Log the supplied info level message.
* @param mesage the message to log
*/
void info( String message );

/**
- * Log the supplied debug level message.
+ * Log the supplied info level message.
* @param mesage the message to log
*/
- void debug( String message );
+ void warn( String message );

/**
* Log the supplied error level message.
@@ -44,4 +50,18 @@
* @param throwable the exception
*/
void error( String message, Throwable throwable );
+
+ /**
+ * Log the monitor of a normal termination.
+ * @param status TRUE if the monitor completed all scheduled activities
+ * without interruption
+ */
+ void notifyCompletion( boolean status );
+
+ /**
+ * Log the monitor of a runtime failure.
+ * @param throwable the failure cause
+ */
+ void notifyFailure( Throwable throwable );
+
}

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/NoSuchControlException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/NoSuchControlException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,33 @@
+/*
+ * 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.control;
+
+/**
+ * An exception thrown in responde to a request for an unknown control.
+ *
+ * @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 NoSuchControlException extends Exception
+{
+ public NoSuchControlException( String name )
+ {
+ super( name );
+ }
+}

Added:
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HandlerNotFoundException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HandlerNotFoundException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,50 @@
+/*
+ * 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.home;
+
+import java.net.URI;
+
+/**
+ * Exception thrown when an attempt is made to reference an unknown handler.
+ *
+ * @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 HandlerNotFoundException extends HomeException
+{
+ private URI m_uri;
+
+ public HandlerNotFoundException( URI uri )
+ {
+ this( uri, null );
+ }
+
+ public HandlerNotFoundException( URI uri, Exception cause )
+ {
+ super( uri.toString(), cause );
+ m_uri = uri;
+ }
+
+ public URI getURI()
+ {
+ return m_uri;
+ }
+
+}
+

Added:
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/Home.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/Home.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,40 @@
+/*
+ * 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.home;
+
+import java.net.URI;
+import java.io.IOException;
+
+import net.dpml.metro.part.PartHandler;
+import net.dpml.metro.part.TypeHandler;
+
+/**
+ * The Home interface defines operations supporting the resolution of
+ * type and part handlers.
+ *
+ * @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 interface Home
+{
+ TypeHandler resolveTypeHandler( URI uri ) throws
HandlerNotFoundException, IOException;
+
+ PartHandler resolvePartHandler( URI uri ) throws
HandlerNotFoundException, IOException;
+
+}

Added:
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HomeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HomeException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,39 @@
+/*
+ * 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.home;
+
+/**
+ * Exception related to a home.
+ *
+ * @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 HomeException extends Exception
+{
+ public HomeException( String message )
+ {
+ this( message, null );
+ }
+
+ public HomeException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
+

Added:
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HomeRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/kernel/src/main/net/dpml/metro/home/HomeRuntimeException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,35 @@
+/*
+ * 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.home;
+
+/**
+ * Unexpected runtime exception indicating an internal home error.
+ *
+ * @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 HomeRuntimeException extends RuntimeException
+{
+ public HomeRuntimeException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
+

Modified: development/laboratory/plus/api/model/build.xml
==============================================================================
--- development/laboratory/plus/api/model/build.xml (original)
+++ development/laboratory/plus/api/model/build.xml Mon Mar 14 10:09:23
2005
@@ -7,6 +7,8 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="init" depends="standard.init">
+ <x:filter feature="plugin" token="TYPE-HANDLER-URI"/>
+ <x:filter feature="plugin" token="PART-HANDLER-URI"/>
<x:filter key="dpml-metro-control-impl" feature="plugin"
token="STRATEGY-URI"/>
</target>


Modified:
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ComponentDescriptor.java
==============================================================================
---
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ComponentDescriptor.java
(original)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ComponentDescriptor.java
Mon Mar 14 10:09:23 2005
@@ -25,18 +25,26 @@
import net.dpml.metro.part.Descriptor;

/**
- * Base class for all descriptors.
+ * Description of a component type.
*
* @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 ComponentDescriptor extends Descriptor implements Type
{
+
//------------------------------------------------------------------------------
+ // state
+
//------------------------------------------------------------------------------
+
private final InfoDescriptor m_info;
private final DependencyDescriptor[] m_dependencies;
private final ServiceDescriptor[] m_services;
private final PartDescriptor[] m_parts;

+
//------------------------------------------------------------------------------
+ // constructors
+
//------------------------------------------------------------------------------
+
public ComponentDescriptor( final InfoDescriptor info,
ServiceDescriptor[] services,
DependencyDescriptor[] dependencies, PartDescriptor[] parts )
{
@@ -69,6 +77,19 @@
m_parts = parts;
}

+
//------------------------------------------------------------------------------
+ // Type
+
//------------------------------------------------------------------------------
+
+ public String getClassname()
+ {
+ return getInfoDescriptor().getClassname();
+ }
+
+
//------------------------------------------------------------------------------
+ // ComponentDescriptor
+
//------------------------------------------------------------------------------
+
public InfoDescriptor getInfoDescriptor()
{
return m_info;
@@ -89,6 +110,10 @@
return m_parts;
}

+
//------------------------------------------------------------------------------
+ // Object
+
//------------------------------------------------------------------------------
+
public int hashCode()
{
int hash = super.hashCode();

Added:
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ComponentTypeHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ComponentTypeHandler.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,98 @@
+/*
+ * 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.io.InputStream;
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.rmi.MarshalledObject;
+import java.net.URI;
+
+import net.dpml.metro.part.Type;
+import net.dpml.metro.part.TypeHandler;
+import net.dpml.metro.part.TypeHandlerRuntimeException;
+import net.dpml.metro.part.TypeReference;
+import net.dpml.metro.part.Registry;
+import net.dpml.metro.part.BadStrategyException;
+import net.dpml.metro.part.RegistryNotFoundException;
+import net.dpml.metro.part.TypeNotFoundException;
+
+/**
+ * Definition of a type handler.
+ *
+ * @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 ComponentTypeHandler implements TypeHandler
+{
+ public URI getURI()
+ {
+ return TYPE_HANDLER_URI;
+ }
+
+ public Type loadType( TypeReference reference )
+ throws RegistryNotFoundException, BadStrategyException,
TypeNotFoundException, IOException
+ {
+ URI uri = reference.getRegistryURI();
+ String classname = reference.getClassname();
+ Registry registry = Registry.loadRegistry( uri );
+ return registry.getType( this, classname );
+ }
+
+ public Type loadType( URI strategy, byte[] bytes ) throws
BadStrategyException, IOException
+ {
+ // TODO check strategy
+
+ try
+ {
+ ByteArrayInputStream input = new ByteArrayInputStream( bytes );
+ ObjectInputStream stream = new ObjectInputStream( input );
+ MarshalledObject marshalled = (MarshalledObject)
stream.readObject();
+ return (ComponentDescriptor) marshalled.get();
+ }
+ catch( IOException e )
+ {
+ throw e;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to load a type (strategy: "
+ + strategy
+ + ") from a byte array.";
+ throw new TypeHandlerRuntimeException( error, e );
+ }
+ }
+
+ private static final URI TYPE_HANDLER_URI = createStaticURI(
"@TYPE-HANDLER-URI@" );
+
+ private static URI createStaticURI( String path )
+ {
+ try
+ {
+ return new URI( path );
+ }
+ catch( Throwable e )
+ {
+ return null;
+ }
+ }
+
+}

Modified:
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/DependencyDescriptor.java
==============================================================================
---
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/DependencyDescriptor.java
(original)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/DependencyDescriptor.java
Mon Mar 14 10:09:23 2005
@@ -23,16 +23,24 @@
import net.dpml.metro.part.Descriptor;

/**
- * Description of a dependency.
+ * Description of a component service dependency.
*
* @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 DependencyDescriptor extends Descriptor
{
+
//------------------------------------------------------------------------------
+ // state
+
//------------------------------------------------------------------------------
+
private final String m_key;
private final String m_type;

+
//------------------------------------------------------------------------------
+ // constructors
+
//------------------------------------------------------------------------------
+
public DependencyDescriptor( final String key, final String type )
{
this( key, type, null );
@@ -53,6 +61,10 @@
m_type = type;
}

+
//------------------------------------------------------------------------------
+ // DependencyDescriptor
+
//------------------------------------------------------------------------------
+
public String getKey()
{
return m_key;
@@ -63,6 +75,10 @@
return m_type;
}

+
//------------------------------------------------------------------------------
+ // Object
+
//------------------------------------------------------------------------------
+
public int hashCode()
{
int hash = super.hashCode();

Modified:
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/InfoDescriptor.java
==============================================================================
---
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/InfoDescriptor.java
(original)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/InfoDescriptor.java
Mon Mar 14 10:09:23 2005
@@ -23,15 +23,23 @@
import net.dpml.metro.part.Descriptor;

/**
- * Base class for all descriptors.
+ * Component type info descriptor.
*
* @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 InfoDescriptor extends Descriptor
{
+
//------------------------------------------------------------------------------
+ // state
+
//------------------------------------------------------------------------------
+
private final String m_classname;

+
//------------------------------------------------------------------------------
+ // constructor
+
//------------------------------------------------------------------------------
+
public InfoDescriptor( final String classname )
{
this( classname, null );
@@ -47,11 +55,19 @@
m_classname = classname;
}

+
//------------------------------------------------------------------------------
+ // InfoDescriptor
+
//------------------------------------------------------------------------------
+
public String getClassname()
{
return m_classname;
}

+
//------------------------------------------------------------------------------
+ // Object
+
//------------------------------------------------------------------------------
+
public boolean equals( Object other )
{
if( null == other )

Modified:
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/PartDescriptor.java
==============================================================================
---
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/PartDescriptor.java
(original)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/PartDescriptor.java
Mon Mar 14 10:09:23 2005
@@ -31,16 +31,23 @@
*/
public class PartDescriptor extends Descriptor
{
+
//------------------------------------------------------------------------------
+ // state
+
//------------------------------------------------------------------------------
+
private final String m_key;
private final String m_type;
- private final URI m_part;

- public PartDescriptor( final String key, final String type, URI part )
+
//------------------------------------------------------------------------------
+ // constructors
+
//------------------------------------------------------------------------------
+
+ public PartDescriptor( final String key, final String type )
{
- this( key, type, part, null );
+ this( key, type, null );
}

- public PartDescriptor( final String key, final String type, URI part,
Properties properties )
+ public PartDescriptor( final String key, final String type, Properties
properties )
{
super( properties );
if( null == key )
@@ -51,15 +58,14 @@
{
throw new NullPointerException( "type" );
}
- if( null == part )
- {
- throw new NullPointerException( "part" );
- }
m_key = key;
m_type = type;
- m_part = part;
}

+
//------------------------------------------------------------------------------
+ // PartDescriptor
+
//------------------------------------------------------------------------------
+
public String getKey()
{
return m_key;
@@ -70,17 +76,15 @@
return m_type;
}

- public URI getPart()
- {
- return m_part;
- }
+
//------------------------------------------------------------------------------
+ // Object
+
//------------------------------------------------------------------------------

public int hashCode()
{
int hash = super.hashCode();
hash ^= m_key.hashCode();
hash ^= m_type.hashCode();
- hash ^= m_part.hashCode();
return hash;
}

@@ -105,10 +109,6 @@
{
return false;
}
- else if( false == getPart().equals( part.getPart() ) )
- {
- return false;
- }
else
{
return true;

Modified:
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ServiceDescriptor.java
==============================================================================
---
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ServiceDescriptor.java
(original)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/meta/ServiceDescriptor.java
Mon Mar 14 10:09:23 2005
@@ -23,15 +23,23 @@
import net.dpml.metro.part.Descriptor;

/**
- * Base class for all descriptors.
+ * Description of a service provision capability exposed by a component type.
*
* @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 ServiceDescriptor extends Descriptor
{
+
//------------------------------------------------------------------------------
+ // state
+
//------------------------------------------------------------------------------
+
private final String m_type;

+
//------------------------------------------------------------------------------
+ // constructors
+
//------------------------------------------------------------------------------
+
public ServiceDescriptor( final String type )
{
this( type, null );
@@ -47,11 +55,19 @@
m_type = type;
}

+
//------------------------------------------------------------------------------
+ // ServiceDescriptor
+
//------------------------------------------------------------------------------
+
public String getClassname()
{
return m_type;
}

+
//------------------------------------------------------------------------------
+ // Object
+
//------------------------------------------------------------------------------
+
public int hashCode()
{
int hash = super.hashCode();

Modified:
development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentModel.java
==============================================================================
---
development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentModel.java
(original)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentModel.java
Mon Mar 14 10:09:23 2005
@@ -19,8 +19,11 @@
package net.dpml.metro.model;

import java.io.Serializable;
+import java.net.URI;

import net.dpml.metro.part.Part;
+import net.dpml.metro.part.TypeReference;
+import net.dpml.metro.part.ControlDescriptor;

/**
* The part directive is a directive that can be handled as a part within a
@@ -29,63 +32,51 @@
* @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 ComponentModel extends PartModel
+public class ComponentModel implements Part, Serializable
{
- private String m_classname;
- private Part[] m_parts;
- private ClassLoaderModel m_classloader;
+ private TypeReference m_type;
+ private ControlDescriptor[] m_controls;

- public ComponentModel( String classname, String name, ClassLoaderModel
classloader, Part[] parts )
+ public ComponentModel( TypeReference type )
{
- super( name );
- if( null == classname )
- {
- throw new NullPointerException( "classname" );
- }
- if( null == parts )
+ this( type, EMPTY_CONTROLS );
+ }
+
+ public ComponentModel( TypeReference type, ControlDescriptor[] controls )
+ {
+ if( null == type )
{
- throw new NullPointerException( "parts" );
+ throw new NullPointerException( "type" );
}
- if( null == classloader )
+ if( null == controls )
{
- throw new NullPointerException( "classloader" );
+ throw new NullPointerException( "controls" );
}
- m_classloader = classloader;
- m_classname = classname;
- m_parts = parts;
- }
-
- /**
- * Return the name of the part.
- * @return the part name
- */
- public String getClassname()
- {
- return m_classname;
+ m_type = type;
+ m_controls = controls;
}

/**
- * Return the set of parts within this component.
- * @return the parts
+ * Return a reference to the type managed by this part.
+ * @return the type reference
*/
- public Part[] getParts()
+ public TypeReference getTypeReference()
{
- return m_parts;
+ return m_type;
}

/**
- * Return the the clasloader model for the part.
- * @return the classloader model
+ * Return a reference to the type managed by this part.
+ * @return the type reference
*/
- public ClassLoaderModel getClassLoaderModel()
+ public ControlDescriptor[] getControlDescriptors()
{
- return m_classloader;
+ return m_controls;
}

public int hashCode()
{
- int hash = super.hashCode();
- hash ^= m_classname.hashCode();
+ int hash = m_type.hashCode();
return hash;
}

@@ -98,31 +89,12 @@
else if( other instanceof ComponentModel )
{
ComponentModel part = (ComponentModel) other;
- if( !super.equals( part ) )
- {
- return false;
- }
- else if( !getClassname().equals( part.getClassname() ) )
- {
- return false;
- }
- else if( getParts().length != part.getParts().length )
+ if( getTypeReference().equals( part.getTypeReference() ) ==
false )
{
return false;
}
else
{
- Part[] myParts = getParts();
- Part[] yourParts = part.getParts();
- for( int i=0; i<myParts.length; i++ )
- {
- Part p = myParts[i];
- Part q = yourParts[i];
- if( !p.equals( q ) )
- {
- return false;
- }
- }
return true;
}
}
@@ -131,4 +103,7 @@
return false;
}
}
+
+ private static final ControlDescriptor[] EMPTY_CONTROLS = new
ControlDescriptor[0];
+
}

Added:
development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentPartHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/model/src/main/net/dpml/metro/model/ComponentPartHandler.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,123 @@
+/*
+ * 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.model;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.rmi.MarshalledObject;
+import java.net.URI;
+import java.net.URL;
+
+import net.dpml.metro.part.Part;
+import net.dpml.metro.part.PartHandler;
+import net.dpml.metro.part.PartHolder;
+import net.dpml.metro.part.PartHandlerRuntimeException;
+import net.dpml.metro.part.BadStrategyException;
+import net.dpml.metro.part.PartNotFoundException;
+
+/**
+ * Definition of a type handler.
+ *
+ * @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 ComponentPartHandler implements PartHandler
+{
+ public URI getURI()
+ {
+ return PART_HANDLER_URI;
+ }
+
+ public Part loadPart( URI uri )
+ throws BadStrategyException, PartNotFoundException, IOException
+ {
+ URL url = uri.toURL();
+ InputStream input = url.openStream();
+ if( null == input )
+ {
+ throw new PartNotFoundException( uri );
+ }
+ ObjectInputStream stream = new ObjectInputStream( input );
+ try
+ {
+ MarshalledObject marshalled = (MarshalledObject)
stream.readObject();
+ PartHolder holder = (PartHolder) marshalled.get();
+ URI handler = holder.getPartHandlerURI();
+ return loadPart( handler, holder.getByteArray() );
+ }
+ catch( BadStrategyException e )
+ {
+ throw e;
+ }
+ catch( IOException e )
+ {
+ throw e;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Error loading part handler ["
+ + uri
+ + "].";
+ throw new PartHandlerRuntimeException( error, e );
+ }
+ }
+
+ public Part loadPart( URI handler, byte[] bytes ) throws
BadStrategyException, IOException
+ {
+ if( false == getURI().equals( handler ) )
+ {
+ throw new BadStrategyException( handler );
+ }
+
+ try
+ {
+ ByteArrayInputStream input = new ByteArrayInputStream( bytes );
+ ObjectInputStream stream = new ObjectInputStream( input );
+ MarshalledObject marshalled = (MarshalledObject)
stream.readObject();
+ return (Part) marshalled.get();
+ }
+ catch( IOException e )
+ {
+ throw e;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to load a part from a byte
array.";
+ throw new PartHandlerRuntimeException( error, e );
+ }
+ }
+
+ private static final URI PART_HANDLER_URI = createStaticURI(
"@PART-HANDLER-URI@" );
+
+ private static URI createStaticURI( String path )
+ {
+ try
+ {
+ return new URI( path );
+ }
+ catch( Throwable e )
+ {
+ return null;
+ }
+ }
+}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/BadStrategyException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/BadStrategyException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+
+/**
+ * Exception thrown when an strategy handler attempts to handle an
+ * incompatible type.
+ *
+ * @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 BadStrategyException extends Exception
+{
+ private URI m_strategy;
+
+ public BadStrategyException( URI strategy )
+ {
+ super( strategy.toString() );
+ m_strategy = strategy;
+ }
+
+ public URI getStrategyURI()
+ {
+ return m_strategy;
+ }
+
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/ControlDescriptor.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/ControlDescriptor.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,178 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+import java.util.Properties;
+
+/**
+ * An immutable datatype that describes a type of controller.
+ *
+ * @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 ControlDescriptor extends Descriptor
+{
+ private URI m_uri;
+ private String m_description;
+ private String m_name;
+ private boolean m_optional;
+ private boolean m_model; // model or instance
+
+ public ControlDescriptor(
+ String name, URI uri, String description, boolean optional, boolean
model )
+ {
+ this( name, uri, description, optional, model, null );
+ }
+
+ public ControlDescriptor(
+ String name, URI uri, String description, boolean optional, boolean
model, Properties properties )
+ {
+ super( properties );
+ m_uri = uri;
+ m_name = name;
+ m_description = description;
+ m_optional = optional;
+ m_model = model;
+ }
+
+ /**
+ * Return the uri identifying the controller.
+ * @return the controller uri
+ */
+ public URI getURI()
+ {
+ return m_uri;
+ }
+
+ /**
+ * Return the controller name.
+ * @return the name
+ */
+ public String getName()
+ {
+ return m_name;
+ }
+
+ /**
+ * Return a human readable description of the controller.
+ * @return the controller description.
+ */
+ public String getDescription()
+ {
+ return m_description;
+ }
+
+ /**
+ * Return TRUE if this is an optional controller.
+ * @return the optional flag
+ */
+ public boolean isOptional()
+ {
+ return m_optional;
+ }
+
+ /**
+ * Return TRUE if this is an optional controller.
+ * @return the optional flag
+ */
+ public boolean isModelController()
+ {
+ return m_model;
+ }
+
+ /**
+ * Return TRUE if this is an optional controller.
+ * @return the optional flag
+ */
+ public boolean isInstanceController()
+ {
+ return ( false == isModelController() );
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_uri.hashCode();
+ hash ^= m_name.hashCode();
+ hash ^= m_description.hashCode();
+ hash ^= m_description.hashCode();
+ if( m_model )
+ {
+ hash = hash + 909252164;
+ }
+ else
+ {
+ hash = hash - 273747000;
+ }
+ if( m_optional )
+ {
+ hash = hash + 500252164;
+ }
+ else
+ {
+ hash = hash - 100747000;
+ }
+ return hash;
+ }
+
+ public boolean equals( Object other )
+ {
+ if( null == other )
+ {
+ return false;
+ }
+ else if( super.equals( other ) == false )
+ {
+ return false;
+ }
+ else if( other instanceof ControlDescriptor )
+ {
+ ControlDescriptor descriptor = (ControlDescriptor) other;
+ if( false == getURI().equals( descriptor.getURI() ) )
+ {
+ return false;
+ }
+ else if( false == getName().equals( descriptor.getName() ) )
+ {
+ return false;
+ }
+ else if( false == getDescription().equals(
descriptor.getDescription() ) )
+ {
+ return false;
+ }
+ else if( isOptional() != descriptor.isOptional() )
+ {
+ return false;
+ }
+ else if( isModelController() != descriptor.isModelController() )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Handler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Handler.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,32 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+
+/**
+ * Definition of a handler.
+ *
+ * @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 interface Handler
+{
+ URI getURI();
+}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Holder.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Holder.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,102 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Properties;
+import java.io.Serializable;
+
+/**
+ *
+ *
+ * @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 Holder implements Serializable
+{
+ private final URI m_strategy;
+ private final byte[] m_part;
+
+ public Holder( URI strategy, byte[] part )
+ {
+ m_strategy = strategy;
+ m_part = part;
+ }
+
+ protected URI getURI()
+ {
+ return m_strategy;
+ }
+
+ public byte[] getByteArray()
+ {
+ return m_part;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_strategy.hashCode();
+ for( int i=0; i<m_part.length; i++ )
+ {
+ hash ^= new Byte( m_part[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 Holder )
+ {
+ Holder holder = (Holder) other;
+ if( getURI().equals( holder.getURI() ) == false )
+ {
+ return false;
+ }
+ else if( Arrays.equals( getByteArray(), holder.getByteArray() )
== false )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public String toString()
+ {
+ return "[holder strategy:" + m_strategy + " size:" + m_part.length +
"]";
+ }
+
+}
+

Modified:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Part.java
==============================================================================
---
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Part.java
(original)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Part.java
Mon Mar 14 10:09:23 2005
@@ -30,8 +30,14 @@
public interface Part extends Serializable
{
/**
- * Return a urn identifying the part strategy.
- * @return the strategy urn
+ * Return a reference to the type managed by this part.
+ * @return the type reference
*/
- public URI getStrategyURN();
+ TypeReference getTypeReference();
+
+ /**
+ * Return an array of control descriptors associated with the part.
+ * @return the control descriptor array
+ */
+ ControlDescriptor[] getControlDescriptors();
}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHandler.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,38 @@
+/*
+ * 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.part;
+
+import java.io.IOException;
+import java.net.URI;
+
+import net.dpml.metro.part.Part;
+
+/**
+ * Definition of a part handler.
+ *
+ * @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 interface PartHandler extends Handler
+{
+ Part loadPart( URI uri )
+ throws BadStrategyException, PartNotFoundException, IOException;
+
+ Part loadPart( URI strategy, byte[] bytes ) throws BadStrategyException,
IOException;
+}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHandlerRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHandlerRuntimeException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,35 @@
+/*
+ * 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.part;
+
+/**
+ * Unexpected runtime exception indicating an internal part handler error.
+ *
+ * @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 PartHandlerRuntimeException extends RuntimeException
+{
+ public PartHandlerRuntimeException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHolder.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartHolder.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,44 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Properties;
+import java.io.Serializable;
+
+/**
+ *
+ *
+ * @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 PartHolder extends Holder
+{
+ public PartHolder( URI handler, byte[] part )
+ {
+ super( handler, part );
+ }
+
+ public URI getPartHandlerURI()
+ {
+ return super.getURI();
+ }
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartNotFoundException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/PartNotFoundException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,45 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+
+/**
+ * Exception thrown when an attempt is made to reference an unknown catalog
entry.
+ *
+ * @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 PartNotFoundException extends Exception
+{
+ private URI m_uri;
+
+ public PartNotFoundException( URI uri )
+ {
+ super( uri.toString() );
+ m_uri = uri;
+ }
+
+ public URI getURI()
+ {
+ return m_uri;
+ }
+
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Registry.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,234 @@
+/*
+ * 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.part;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.rmi.MarshalledObject;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Properties;
+import java.io.Serializable;
+
+/**
+ * A registry is a container of serialized component type holders keyed by
classname.
+ *
+ * @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 Registry extends Descriptor
+{
+ public static Registry loadRegistry( URI uri ) throws
RegistryNotFoundException, IOException
+ {
+ URL url = uri.toURL();
+ return loadRegistry( url );
+ }
+
+ public static Registry loadRegistry( URL url ) throws
RegistryNotFoundException, IOException
+ {
+ try
+ {
+ InputStream input = url.openStream();
+ if( null == input )
+ {
+ throw new RegistryNotFoundException( url );
+ }
+ ObjectInputStream stream = new ObjectInputStream( input );
+ MarshalledObject marshalled = (MarshalledObject)
stream.readObject();
+ return (Registry) marshalled.get();
+ }
+ catch( RegistryNotFoundException rnfe )
+ {
+ throw rnfe;
+ }
+ catch( IOException ioe )
+ {
+ throw ioe;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Internal error while attempting to load registry ["
+ + url
+ + "].";
+ throw new RegistryRuntimeException( error, e );
+ }
+ }
+
+ private final URI m_uri;
+
+ private final URI[] m_api;
+ private final URI[] m_spi;
+ private final URI[] m_impl;
+
+ private final TypeEntry[] m_entries;
+ private final String[] m_classnames;
+
+ public Registry( URI uri, URI[] api, URI[] spi, URI[] impl, TypeEntry[]
entries )
+ {
+ this( uri, api, spi, impl, entries, null );
+ }
+
+ public Registry( URI uri, URI[] api, URI[] spi, URI[] impl, TypeEntry[]
entries, Properties properties )
+ {
+ super( properties );
+ if( null == uri )
+ {
+ throw new NullPointerException( "uri" );
+ }
+ if( null == entries )
+ {
+ throw new NullPointerException( "entries" );
+ }
+ if( null == api )
+ {
+ throw new NullPointerException( "api" );
+ }
+ if( null == spi )
+ {
+ throw new NullPointerException( "spi" );
+ }
+ if( null == impl )
+ {
+ throw new NullPointerException( "impl" );
+ }
+ m_uri = uri;
+ m_api = api;
+ m_spi = spi;
+ m_impl = impl;
+ m_entries = entries;
+
+ String[] classnames = new String[ m_entries.length ];
+ for( int i=0; i<entries.length; i++ )
+ {
+ classnames[i] = entries[i].getClassname();
+ }
+ m_classnames = classnames;
+ }
+
+ public URI getURI()
+ {
+ return m_uri;
+ }
+
+ public String[] getEntries()
+ {
+ return m_classnames;
+ }
+
+ public Type getType( TypeHandler handler, String classname )
+ throws TypeNotFoundException, BadStrategyException, IOException
+ {
+ TypeEntry entry = getTypeEntry( classname );
+ return entry.getType( handler );
+ }
+
+ private TypeEntry getTypeEntry( String classname ) throws
TypeNotFoundException
+ {
+ for( int i=0; i<m_entries.length; i++ )
+ {
+ TypeEntry entry = m_entries[i];
+ if( classname.equals( entry.getClassname() ) )
+ {
+ return entry;
+ }
+ }
+ throw new TypeNotFoundException( classname );
+ }
+
+ public URI[] getApiStack()
+ {
+ return m_api;
+ }
+
+ public URI[] getSpiStack()
+ {
+ return m_spi;
+ }
+
+ public URI[] getImplementationStack()
+ {
+ return m_impl;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ for( int i=0; i<m_entries.length; i++ )
+ {
+ hash ^= m_entries[i].hashCode();
+ }
+ for( int i=0; i<m_api.length; i++ )
+ {
+ hash ^= m_api[i].hashCode();
+ }
+ for( int i=0; i<m_spi.length; i++ )
+ {
+ hash ^= m_spi[i].hashCode();
+ }
+ for( int i=0; i<m_impl.length; i++ )
+ {
+ hash ^= m_impl[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 Registry )
+ {
+ Registry registry = (Registry) other;
+ if( false == equals( getApiStack(), registry.getApiStack() ) )
+ {
+ return false;
+ }
+ else if( false == equals( getSpiStack(), registry.getSpiStack()
) )
+ {
+ return false;
+ }
+ else if( false == equals( getImplementationStack(),
registry.getImplementationStack() ) )
+ {
+ return false;
+ }
+ else if( false == equals( getEntries(), registry.getEntries() ) )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/RegistryNotFoundException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/RegistryNotFoundException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,45 @@
+/*
+ * 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.part;
+
+import java.net.URL;
+
+/**
+ * Exception thrown when an attempt is made to reference an unknown catalog
entry.
+ *
+ * @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 RegistryNotFoundException extends Exception
+{
+ private URL m_url;
+
+ public RegistryNotFoundException( URL url )
+ {
+ super( url.toString() );
+ m_url = url;
+ }
+
+ public URL getURL()
+ {
+ return m_url;
+ }
+
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/RegistryRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/RegistryRuntimeException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,35 @@
+/*
+ * 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.part;
+
+/**
+ * Unexpected runtime exception indicating an interanl registry error.
+ *
+ * @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 RegistryRuntimeException extends RuntimeException
+{
+ public RegistryRuntimeException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
+

Modified:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Type.java
==============================================================================
---
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Type.java
(original)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/Type.java
Mon Mar 14 10:09:23 2005
@@ -29,4 +29,5 @@
*/
public interface Type extends Serializable
{
+ String getClassname();
}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeEntry.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeEntry.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,123 @@
+/*
+ * 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.part;
+
+import java.io.Serializable;
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URI;
+
+import net.dpml.metro.part.Type;
+
+/**
+ * A type entry is an immutable datatype associating a classname with a
+ * type holder.
+ *
+ * @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 TypeEntry implements Serializable
+{
+ private String m_classname;
+ private TypeHolder m_holder;
+
+ public TypeEntry( URI strategy, String classname, byte[] bytes )
+ {
+ m_classname = classname;
+ m_holder = new TypeHolder( strategy, bytes );
+ }
+
+ private TypeEntry( String classname, TypeHolder holder )
+ {
+ m_classname = classname;
+ m_holder = holder;
+ }
+
+ public Type getType( TypeHandler handler )
+ throws TypeNotFoundException, BadStrategyException, IOException
+ {
+ return handler.loadType( m_holder.getTypeHandlerURI(),
m_holder.getByteArray() );
+ }
+
+ private TypeHolder getTypeHolder()
+ {
+ return m_holder;
+ }
+
+ public String getClassname()
+ {
+ return m_classname;
+ }
+
+ public int hashCode()
+ {
+ int hash = m_classname.hashCode();
+ hash ^= m_holder.hashCode();
+ return hash;
+ }
+
+ public boolean equals( Object other )
+ {
+ if( null == other )
+ {
+ return false;
+ }
+ else if( other instanceof TypeEntry )
+ {
+ TypeEntry entry = (TypeEntry) other;
+ if( false == getClassname().equals( entry.getClassname() ) )
+ {
+ return false;
+ }
+ else if( false == getTypeHolder().equals( entry.getTypeHolder()
) )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * A type holder is an immutable datatype describing an entry of a part
type within a registry. Each
+ * entry contains the strategy uri and the part type descriptor as a
byte array.
+ *
+ * @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 TypeHolder extends Holder
+ {
+ public TypeHolder( URI strategy, byte[] bytes )
+ {
+ super( strategy, bytes );
+ }
+
+ public URI getTypeHandlerURI()
+ {
+ return super.getURI();
+ }
+ }
+
+}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeHandler.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,39 @@
+/*
+ * 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.part;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URI;
+
+import net.dpml.metro.part.Type;
+
+/**
+ * Definition of a type handler.
+ *
+ * @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 interface TypeHandler extends Handler
+{
+ Type loadType( TypeReference reference )
+ throws RegistryNotFoundException, BadStrategyException,
TypeNotFoundException, IOException;
+
+ Type loadType( URI strategy, byte[] bytes ) throws BadStrategyException,
IOException;
+}

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeHandlerRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeHandlerRuntimeException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,35 @@
+/*
+ * 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.part;
+
+/**
+ * Unexpected runtime exception indicating an internal type handler error.
+ *
+ * @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 TypeHandlerRuntimeException extends RuntimeException
+{
+ public TypeHandlerRuntimeException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeNotFoundException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeNotFoundException.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,43 @@
+/*
+ * 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.part;
+
+/**
+ * Exception thrown when an attempt is made to reference an unknown catalog
entry.
+ *
+ * @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 TypeNotFoundException extends Exception
+{
+ private String m_classname;
+
+ public TypeNotFoundException( String classname )
+ {
+ super( classname );
+ m_classname = classname;
+ }
+
+ public String getClassname()
+ {
+ return m_classname;
+ }
+
+}
+

Added:
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeReference.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/part/src/main/net/dpml/metro/part/TypeReference.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,104 @@
+/*
+ * 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.part;
+
+import java.net.URI;
+import java.util.Properties;
+
+/**
+ * A type reference is a reference to registry entry. The reference
contains
+ * the uri of the registry and the classname key of an entry in the registry.
+ *
+ * @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 TypeReference extends Descriptor
+{
+ private final URI m_registry;
+ private final String m_classname;
+
+ public TypeReference( URI registry, String classname )
+ {
+ this( registry, classname, null );
+ }
+
+ public TypeReference( URI registry, String classname, Properties
properties )
+ {
+ super( properties );
+ m_registry = registry;
+ m_classname = classname;
+ }
+
+ public String getClassname()
+ {
+ return m_classname;
+ }
+
+ public URI getRegistryURI()
+ {
+ return m_registry;
+ }
+
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_classname.hashCode();
+ hash ^= m_registry.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 TypeReference )
+ {
+ TypeReference reference = (TypeReference) other;
+ if( getClassname().equals( reference.getClassname() ) == false )
+ {
+ return false;
+ }
+ else if( getRegistryURI().equals( reference.getRegistryURI() )
== false )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public String toString()
+ {
+ return "[reference " + m_registry + " class:" + m_classname + "]";
+ }
+
+}
+

Added:
development/laboratory/plus/core/src/main/net/dpml/metro/home/impl/TransitHome.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/core/src/main/net/dpml/metro/home/impl/TransitHome.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,104 @@
+/*
+ * 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.home.impl;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.WeakHashMap;
+
+import net.dpml.metro.home.Home;
+import net.dpml.metro.home.HandlerNotFoundException;
+import net.dpml.metro.home.HomeRuntimeException;
+import net.dpml.metro.part.PartHandler;
+import net.dpml.metro.part.TypeHandler;
+import net.dpml.metro.part.Handler;
+import net.dpml.metro.part.TypeHandler;
+import net.dpml.metro.part.PartHandler;
+
+import net.dpml.transit.repository.StandardLoader;
+import net.dpml.transit.TransitException;
+
+/**
+ * The TransitHome class implements handler resolution using Transit as the
+ * underlying resource managmeent framework.
+ *
+ * @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 TransitHome implements Home
+{
+ private final WeakHashMap m_handlers = new WeakHashMap();
+
+ private final StandardLoader m_loader;
+
+ public TransitHome()
+ {
+ try
+ {
+ m_loader = new StandardLoader();
+ }
+ catch( TransitException e )
+ {
+ final String error =
+ "Internal error suring home initialization.";
+ throw new HomeRuntimeException( error, e );
+ }
+ }
+
+ public TypeHandler resolveTypeHandler( URI uri ) throws
HandlerNotFoundException, IOException
+ {
+ Handler handler = resolveHandler( uri );
+ return (TypeHandler) handler;
+ }
+
+ public PartHandler resolvePartHandler( URI uri ) throws
HandlerNotFoundException, IOException
+ {
+ Handler handler = resolveHandler( uri );
+ return (PartHandler) handler;
+ }
+
+ private Handler resolveHandler( URI uri ) throws
HandlerNotFoundException, IOException
+ {
+ String key = uri.toString();
+ synchronized( m_handlers )
+ {
+ Handler handler = (Handler) m_handlers.get( key );
+ if( null == handler )
+ {
+ handler = loadHandler( uri );
+ m_handlers.put( key, handler );
+ }
+ return handler;
+ }
+ }
+
+ private Handler loadHandler( URI uri ) throws HandlerNotFoundException
+ {
+ ClassLoader classloader = Handler.class.getClassLoader();
+ try
+ {
+ return (Handler) m_loader.getPlugin( classloader, uri, new
Object[]{ this } );
+ }
+ catch( IOException e )
+ {
+ throw new HandlerNotFoundException( uri, e );
+ }
+ }
+}

Modified: development/laboratory/plus/index.xml
==============================================================================
--- development/laboratory/plus/index.xml (original)
+++ development/laboratory/plus/index.xml Mon Mar 14 10:09:23 2005
@@ -183,6 +183,7 @@
<status>SNAPSHOT</status>
<types>
<type>jar</type>
+ <type>registry</type>
</types>
</info>
<dependencies>

Modified: development/laboratory/plus/standard/builder/build.xml
==============================================================================
--- development/laboratory/plus/standard/builder/build.xml (original)
+++ development/laboratory/plus/standard/builder/build.xml Mon Mar 14
10:09:23 2005
@@ -7,8 +7,12 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="init" depends="standard.init">
- <x:filter key="dpml-metro-control-impl" feature="plugin"
token="STRATEGY-URI"/>
- <x:filter feature="plugin" token="BUILDER-URI"/>
+ <x:filter key="dpml-metro-model-api" feature="plugin"
token="TYPE-BUILDER-URI"/>
+ <x:filter key="dpml-metro-model-api" feature="plugin"
token="TYPE-HANDLER-URI"/>
+ <x:filter key="dpml-metro-model-api" feature="plugin"
token="PART-BUILDER-URI"/>
+ <x:filter key="dpml-metro-model-api" feature="plugin"
token="PART-HANDLER-URI"/>
+ <x:filter key="dpml-metro-model-api" feature="plugin"
token="CONTROL-BUILDER-URI"/>
+ <x:filter key="dpml-metro-model-api" feature="plugin"
token="CONTROL-HANDLER-URI"/>
</target>

<target name="package" depends="standard.package">

Added:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentModelBuilderTask.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,270 @@
+/*
+ * 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.builder.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.rmi.MarshalledObject;
+import java.util.Arrays;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.ArrayList;
+
+import net.dpml.metro.model.ComponentModel;
+
+import net.dpml.metro.builder.PartBuilder;
+import net.dpml.metro.builder.IntrospectionException;
+import net.dpml.metro.meta.PartDescriptor;
+import net.dpml.metro.meta.ComponentTypeHandler;
+import net.dpml.metro.part.Part;
+import net.dpml.metro.part.PartHolder;
+import net.dpml.metro.part.Registry;
+import net.dpml.metro.part.Type;
+import net.dpml.metro.part.TypeReference;
+import net.dpml.metro.part.TypeHandler;
+import net.dpml.metro.part.TypeNotFoundException;
+import net.dpml.metro.part.RegistryNotFoundException;
+import net.dpml.metro.part.BadStrategyException;
+
+import net.dpml.magic.tasks.ProjectTask;
+import net.dpml.magic.model.Resource;
+import net.dpml.magic.model.ResourceRef;
+import net.dpml.magic.model.Definition;
+import net.dpml.magic.model.Policy;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.Path;
+
+/**
+ * A builder that handles the construction of an IncludeDirective using Ant.
+ *
+ * @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 ComponentModelBuilderTask extends ComponentTypeBuilderTask
implements PartBuilder
+{
+ //--------------------------------------------------------------------
+ // state
+ //--------------------------------------------------------------------
+
+ private String m_key;
+ //private String m_name;
+ private URI m_registry;
+
+ //--------------------------------------------------------------------
+ // features
+ //--------------------------------------------------------------------
+
+ /**
+ * Set the key for this component part.
+ * @param name component name
+ */
+ public void setKey( final String key )
+ {
+ m_key = key;
+ }
+
+ /**
+ * Set the component part name.
+ * @param name component name
+ */
+ //public void setName( final String name )
+ //{
+ // m_name = name;
+ //}
+
+ /**
+ * Set the catalog that the part type is declared within. If not defined
+ * the value will default to an enclusing catalog uri. If the task is
+ * not executing within a catalog an exception will be thrown during
+ * task part handling.
+ *
+ * @param uri the catalog uri
+ */
+ public void setRegistry( final URI uri )
+ {
+ m_registry = uri;
+ }
+
+ //--------------------------------------------------------------------
+ // PartBuilder
+ //--------------------------------------------------------------------
+
+ public URI getPartHandlerURI()
+ {
+ return PART_HANDLER_URI;
+ }
+
+ /**
+ * Set the key for this component part.
+ * @param name component name
+ */
+ public String getKey()
+ {
+ return m_key;
+ }
+
+ /**
+ * Build the part.
+ * @param descriptor a part usage descriptor
+ * @return the serializable part
+ * @exception Exception if a construction error occurs
+ */
+ public Part buildPart( ClassLoader classloader )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+ return buildPart( classloader, null );
+ }
+
+ /**
+ * Build the part.
+ * @param descriptor a part usage descriptor
+ * @return the serializable part
+ * @exception Exception if a construction error occurs
+ */
+ public Part buildPart( ClassLoader classloader, PartDescriptor
descriptor )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+System.out.println( "## building part: " + descriptor );
+ Type type = resolveType( classloader );
+System.out.println( "## resolved type: " + type );
+ URI registry = resolveRegistryURI();
+ String classname = type.getClassname();
+ TypeReference reference = new TypeReference( registry, classname );
+System.out.println( "## typeref: " + reference );
+
+
//******************************************************************************//
+ // Lots of things to be done here concerning the validation,
//
+ // configuration, and assembly of the part. Also to be included
here is //
+ // the ability to add custom aspect builders and corresponding
controllers //
+ // and have these aspects visible at the generic part level.
//
+
//******************************************************************************//
+
+ if( null != descriptor )
+ {
+ //checkTypeMeetsCriteria( reference, descriptor );
+ }
+
+ return new ComponentModel( reference );
+ }
+
+ private Type resolveType( ClassLoader classloader )
+ throws IntrospectionException, IOException,
ClassNotFoundException,
+ RegistryNotFoundException, BadStrategyException,
TypeNotFoundException
+ {
+ if( null == m_registry )
+ {
+ return buildType( classloader );
+ }
+ else
+ {
+ String classname = getClassname();
+ TypeReference reference = new TypeReference( m_registry,
classname );
+ TypeHandler handler = new ComponentTypeHandler();
+ return handler.loadType( reference );
+ }
+ }
+
+ private URI resolveRegistryURI()
+ {
+ if( null != m_registry )
+ {
+ return m_registry;
+ }
+ else
+ {
+ Definition definition = getDefinition();
+ if( definition.getInfo().isa( "registry" ) )
+ {
+ return definition.getArtifactURI( "registry" );
+ }
+ else
+ {
+ final String error =
+ "Component directive does not declare a registry uri.";
+ throw new BuildException( error, getLocation() );
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------
+ // Task
+ //--------------------------------------------------------------------
+
+ public void execute()
+ {
+System.out.println( "executing component part" );
+
+ Project project = getProject();
+ Path path = getDefinition().getPath( project, Policy.RUNTIME );
+ File classes = getContext().getClassesDirectory();
+ path.createPathElement().setLocation( classes );
+ ClassLoader classloader = new AntClassLoader( project, path );
+
+ try
+ {
+ URI uri = getPartHandlerURI();
+ Part part = buildPart( classloader );
+ byte[] bytes = MarshalledObjectHelper.writeToByteArray( part );
+ PartHolder holder = new PartHolder( uri, bytes );
+
+ File output = getOutputFile();
+ MarshalledObjectHelper.write( holder, output );
+ }
+ catch( BuildException e )
+ {
+ throw e;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Internal error while attempting to marshall the part.";
+ throw new BuildException( error, e, getLocation() );
+ }
+ }
+
+ private File getOutputFile()
+ {
+ File dir = getContext().getDeliverablesDirectory( "part" );
+ String filename = getDefinition().getFilename( "part" );
+ File file = new File( dir, filename );
+ File parent = file.getParentFile();
+ if( !parent.exists() )
+ {
+ parent.mkdirs();
+ }
+ return file;
+ }
+
+ private static URI PART_HANDLER_URI = setupURI( "@PART-HANDLER-URI@" );
+ private static URI PART_BUILDER_URI = setupURI( "@PART-BUILDER-URI@" );
+
+}

Added:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentTypeBuilderTask.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ComponentTypeBuilderTask.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,501 @@
+/*
+ * 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.builder.impl;
+
+import java.io.File;
+import java.io.Serializable;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Properties;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.ArrayList;
+import java.lang.reflect.Method;
+import java.net.URI;
+
+import net.dpml.metro.meta.ComponentDescriptor;
+import net.dpml.metro.meta.ServiceDescriptor;
+import net.dpml.metro.meta.DependencyDescriptor;
+import net.dpml.metro.meta.PartDescriptor;
+import net.dpml.metro.meta.InfoDescriptor;
+import net.dpml.metro.part.Part;
+import net.dpml.metro.part.Type;
+import net.dpml.metro.part.Descriptor;
+import net.dpml.metro.part.RegistryNotFoundException;
+import net.dpml.metro.part.BadStrategyException;
+import net.dpml.metro.part.TypeNotFoundException;
+import net.dpml.metro.builder.TypeBuilder;
+import net.dpml.metro.builder.PartBuilder;
+import net.dpml.metro.builder.IntrospectionException;
+
+import net.dpml.magic.model.Definition;
+import net.dpml.magic.project.Context;
+import net.dpml.magic.tasks.ProjectTask;
+
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * The ComponentTypeTask creates a descriptor of a component type.
+ *
+ * @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 ComponentTypeBuilderTask extends ProjectTask implements
TypeBuilder
+{
+ //---------------------------------------------------------------
+ // state
+ //---------------------------------------------------------------
+
+ private String m_classname;
+ private PartsDataType m_parts;
+ private ControlsDataType m_controls;
+
+ //---------------------------------------------------------------
+ // setters
+ //---------------------------------------------------------------
+
+ public void setClass( String classname )
+ {
+ m_classname = classname;
+ }
+
+ public PartsDataType createParts()
+ {
+ if( null == m_parts )
+ {
+System.out.println( "## creating parts element" );
+ m_parts = new PartsDataType( this );
+ }
+ return m_parts;
+ }
+
+ public ControlsDataType createControls()
+ {
+ if( null == m_controls )
+ {
+System.out.println( "## creating controls element" );
+ m_controls = new ControlsDataType( this );
+ }
+ return m_controls;
+ }
+
+ //---------------------------------------------------------------
+ // Builder
+ //---------------------------------------------------------------
+
+ /**
+ * Return a urn identitifying the component type strategy that this
+ * builder is supporting.
+ *
+ * @return a uri identifiying the type strategy
+ */
+ public URI getTypeHandlerURI()
+ {
+ return TYPE_HANDLER_URI;
+ }
+
+ /**
+ * Return a uri identitifying the builder.
+ *
+ * @return a uri identifiying the type builder
+ */
+ public URI getBuilderURI()
+ {
+ return TYPE_BUILDER_URI;
+ }
+
+ //---------------------------------------------------------------
+ // TypeBuilder
+ //---------------------------------------------------------------
+
+ public Type buildType( ClassLoader classloader )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+ return buildComponentDescriptor( classloader );
+ }
+
+ //---------------------------------------------------------------
+ // internals
+ //---------------------------------------------------------------
+
+ protected String getClassname()
+ {
+ if( null == m_classname )
+ {
+ final String error =
+ "Component type does not declare a classname.";
+ throw new BuildException( error, getLocation() );
+ }
+ return m_classname;
+ }
+
+ public ComponentDescriptor buildComponentDescriptor( ClassLoader
classloader )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+ Class subject = loadSubjectClass( classloader );
+ System.out.println( "## component: " + subject.getName() );
+ InfoDescriptor info = createInfoDescriptor( subject );
+ ServiceDescriptor[] services = createServiceDescriptors( subject );
+ DependencyDescriptor[] dependencies = createDependencyDescriptors(
subject );
+ PartDescriptor[] parts = createPartDescriptors( subject );
+ return new ComponentDescriptor( info, services, dependencies, parts
);
+ }
+
+ private InfoDescriptor createInfoDescriptor( Class subject )
+ {
+ String classname = subject.getName();
+ return new InfoDescriptor( classname );
+ }
+
+ /**
+ * If the class contains an inner class named "Dependencies" then
+ * resolve the key/inteterface clasname pairs based on the inner class
+ * method names.
+ * @param subject the component implmentation class
+ * @return an array of dependency descriptors
+ */
+ private DependencyDescriptor[] createDependencyDescriptors( Class
subject ) throws IntrospectionException
+ {
+ String classname = subject.getName();
+ Class[] classes = subject.getClasses();
+ Class dependencies = locateClass( "$Dependencies", classes );
+ if( null == dependencies )
+ {
+ return new DependencyDescriptor[0];
+ }
+ else
+ {
+ ArrayList list = new ArrayList();
+ Method[] methods = dependencies.getMethods();
+ for( int i=0; i<methods.length; i++ )
+ {
+ Method method = methods[i];
+ DependencyDescriptor dep = createDependencyDescriptor(
method );
+ list.add( dep );
+ }
+ return (DependencyDescriptor[]) list.toArray( new
DependencyDescriptor[0] );
+ }
+ }
+
+ private DependencyDescriptor createDependencyDescriptor( Method method )
throws IntrospectionException
+ {
+ validateMethodName( method );
+ Class returnType = method.getReturnType();
+ validateNonNullReturnType( method, returnType );
+ validateNonArrayReturnType( method, returnType );
+ validateInterfaceReturnType( method, returnType );
+ validateNoExceptions( method );
+ validateNoParameters( method );
+
+ String key = method.getName().substring( 3 );
+ String type = returnType.getName();
+ System.out.println( "### dep: " + key + ", " + type );
+ return new DependencyDescriptor( key, type );
+ }
+
+ private ServiceDescriptor[] createServiceDescriptors( Class subject )
+ {
+ ArrayList list = new ArrayList();
+ Class[] interfaces = subject.getInterfaces();
+ for( int i=0; i<interfaces.length; i++ )
+ {
+ Class service = interfaces[i];
+ ServiceDescriptor descriptor = createServiceDescriptor( service
);
+ if( null != descriptor )
+ {
+ list.add( descriptor );
+ }
+ }
+ return new ServiceDescriptor[0];
+ }
+
+ public ServiceDescriptor createServiceDescriptor( Class subject )
+ {
+ String type = subject.getName();
+ if( type.startsWith( "java." ) )
+ {
+ return null; // ignore java.* interfaces
+ }
+ else
+ {
+ System.out.println( "### service: " + type );
+ return new ServiceDescriptor( type );
+ }
+ }
+
+ private PartDescriptor[] createPartDescriptors( Class subject )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+ String classname = subject.getName();
+ Class[] classes = subject.getClasses();
+ Class parts = locateClass( "$Parts", classes );
+ if( null == parts )
+ {
+ return new PartDescriptor[0];
+ }
+ else
+ {
+ //
+ // For each method in the Parts interface we construct a part
+ // descriptor. The descriptor identifies the part key, the
return
+ // type, and the location of the serialized part resource.
+ //
+
+ Method[] methods = parts.getMethods();
+ ArrayList list = new ArrayList();
+ PartBuilder[] builders = createParts().getPartBuilders();
+ for( int i=0; i<methods.length; i++ )
+ {
+ Method method = methods[i];
+ PartDescriptor descriptor = createPartDescriptor( method );
+ PartBuilder builder = locateBuilder( method,
descriptor.getKey(), builders );
+ writeEmbeddedPart( subject.getClassLoader(), descriptor,
method, builder );
+ list.add( descriptor );
+ }
+ return (PartDescriptor[]) list.toArray( new PartDescriptor[0] );
+ }
+ }
+
+ private void writeEmbeddedPart(
+ ClassLoader classloader, PartDescriptor descriptor, Method method,
PartBuilder builder )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+ Part part = constructPart( classloader, descriptor, builder );
+ System.out.println( "### part directive: " + part );
+ String path = getEmbeddedResourcePath( method );
+ File output = getEmbeddedOutputFile( path );
+ System.out.println( "### saving part to: " + output );
+ MarshalledObjectHelper.write( part, output );
+ }
+
+ private Part constructPart( ClassLoader classloader, PartDescriptor
descriptor, PartBuilder builder )
+ throws IntrospectionException, IOException, ClassNotFoundException,
RegistryNotFoundException,
+ BadStrategyException, TypeNotFoundException
+ {
+ if( builder instanceof ComponentModelBuilderTask )
+ {
+ ComponentModelBuilderTask b = (ComponentModelBuilderTask)
builder;
+ return b.buildPart( classloader, descriptor );
+ }
+ else
+ {
+ return builder.buildPart( classloader );
+ }
+ }
+
+ /**
+ * Creation of a new part descriptor using a supplied method and a part
builder.
+ * The method is the method used by the component implementation to get
the part
+ * runtime instance. The part builder establishes the deployment
solution for the
+ * part implementation.
+ */
+ private PartDescriptor createPartDescriptor( Method method )
+ throws IntrospectionException
+ {
+ validateMethodName( method );
+ validateNoExceptions( method );
+ validateNoParameters( method );
+
+ Class returnType = method.getReturnType();
+ validateNonNullReturnType( method, returnType );
+ validateNonArrayReturnType( method, returnType );
+
+ String key = getPartKey( method );
+ String type = returnType.getName();
+ System.out.println( "### part descriptor " + key + ", " + type );
+ return new PartDescriptor( key, type );
+ }
+
+ private String getPartKey( Method method )
+ {
+ String name = method.getName();
+ String key = name.substring( 3 );
+ return key;
+ }
+
+ private String getEmbeddedResourcePath( Method method )
+ {
+ Class base = method.getDeclaringClass();
+ String classname = base.getName();
+ String path = classname.replace( '.', '/' );
+ String key = getPartKey( method );
+ String filename = path + "$" + key + ".part";
+ return filename;
+ }
+
+ private File getEmbeddedOutputFile( String filename )
+ {
+ File classes = getContext().getClassesDirectory();
+ File destination = new File( classes, filename );
+ return destination;
+ }
+
+ private Class locateClass( String postfix, Class[] classes )
+ {
+ for( int i=0; i<classes.length; i++ )
+ {
+ Class inner = classes[i];
+ String name = inner.getName();
+ if( name.endsWith( postfix ) )
+ {
+ return inner;
+ }
+ }
+ return null;
+ }
+
+ private void validateNonNullReturnType( Method method, Class returnType
) throws IntrospectionException
+ {
+ if( null == returnType )
+ {
+ final String error =
+ "Method ["
+ + method.getName()
+ + "] does not declare a return type.";
+ throw new IntrospectionException( error );
+ }
+ }
+
+ private void validateNonArrayReturnType( Method method, Class returnType
) throws IntrospectionException
+ {
+ if( null != returnType.getComponentType() )
+ {
+ final String error =
+ "Method ["
+ + method.getName()
+ + "] declares an array return type.";
+ throw new IntrospectionException( error );
+ }
+ }
+
+ private void validateInterfaceReturnType( Method method, Class
returnType ) throws IntrospectionException
+ {
+ if( returnType.isInterface() == false )
+ {
+ final String error =
+ "Method ["
+ + method.getName()
+ + "] declares a return type ["
+ + returnType.getName()
+ + "] that is not an interface.";
+ throw new IntrospectionException( error );
+ }
+ }
+
+ private void validateMethodName( Method method ) throws
IntrospectionException
+ {
+ if( method.getName().startsWith( "get" ) == false )
+ {
+ final String error =
+ "Method ["
+ + method.getName()
+ + "] does not start with 'get'.";
+ throw new IntrospectionException( error );
+ }
+ }
+
+ private void validateNoExceptions( Method method ) throws
IntrospectionException
+ {
+ Class[] exceptionTypes = method.getExceptionTypes();
+ if( exceptionTypes.length > 0 )
+ {
+ final String error =
+ "Method ["
+ + method.getName()
+ + "] declares one or more exceptions.";
+ throw new IntrospectionException( error );
+ }
+ }
+
+ private void validateNoParameters( Method method ) throws
IntrospectionException
+ {
+ Class[] parameterTypes = method.getParameterTypes();
+ if( parameterTypes.length > 0 )
+ {
+ final String error =
+ "Method ["
+ + method.getName()
+ + "] declares one or more parameters.";
+ throw new IntrospectionException( error );
+ }
+ }
+
+ private Class loadSubjectClass( ClassLoader classloader )
+ {
+ if( null == m_classname )
+ {
+ final String error =
+ "Missing component descriptor class attribute.";
+ throw new IllegalStateException( error );
+ }
+ try
+ {
+ return classloader.loadClass( m_classname );
+ }
+ catch( ClassNotFoundException e )
+ {
+ final String error =
+ "Component class reference ["
+ + m_classname
+ + "] is not present in the project path.";
+ throw new BuildException( error );
+ }
+ }
+
+ private PartBuilder locateBuilder( Method method, String key,
PartBuilder[] builders )
+ {
+ for( int i=0; i<builders.length; i++ )
+ {
+ PartBuilder builder = builders[i];
+System.out.println( "key : " + builder.getKey() );
+ if( key.equalsIgnoreCase( builder.getKey() ) )
+ {
+ return builder;
+ }
+ }
+ final String error =
+ "The component type declares a key ["
+ + key
+ + "] as an internal part under the method ["
+ + method.getName()
+ + "] however no corresponding part is defined within the build
directive.";
+ throw new BuildException( error, getLocation() );
+ }
+
+ private static URI TYPE_HANDLER_URI = setupURI( "@TYPE-HANDLER-URI@" );
+ private static URI TYPE_BUILDER_URI = setupURI( "@TYPE-BUILDER-URI@" );
+
+ protected static URI setupURI( String spec )
+ {
+ try
+ {
+ return new URI( spec );
+ }
+ catch( URISyntaxException ioe )
+ {
+ return null;
+ }
+ }
+}

Added:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ControlDescriptorBuilderTask.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ControlDescriptorBuilderTask.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,170 @@
+/*
+ * 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.builder.impl;
+
+import java.io.File;
+import java.io.Serializable;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Properties;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.ArrayList;
+import java.lang.reflect.Method;
+import java.net.URI;
+
+import net.dpml.metro.builder.ControlBuilder;
+import net.dpml.metro.part.ControlDescriptor;
+
+import net.dpml.magic.model.Definition;
+import net.dpml.magic.project.Context;
+import net.dpml.magic.tasks.ProjectTask;
+
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * The ComponentTypeTask creates a descriptor of a component type.
+ *
+ * @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 ControlDescriptorBuilderTask extends ProjectTask implements
ControlBuilder
+{
+ //---------------------------------------------------------------
+ // state
+ //---------------------------------------------------------------
+
+ private URI m_uri;
+ private String m_name;
+ private String m_description = "";
+ private boolean m_optional = true;
+ private boolean m_modelFlag = true;
+
+ //---------------------------------------------------------------
+ // setters
+ //---------------------------------------------------------------
+
+ public void setURI( URI uri )
+ {
+ m_uri = uri;
+ }
+
+ public void setName( String name )
+ {
+ m_name = name;
+ }
+
+ public void setDescription( String description )
+ {
+ m_description = description;
+ }
+
+ public void setOptional( boolean optional )
+ {
+ m_optional = optional;
+ }
+
+ public void setModel( boolean flag )
+ {
+ m_modelFlag = flag;
+ }
+
+ //---------------------------------------------------------------
+ // Builder
+ //---------------------------------------------------------------
+
+ /**
+ * Return a urn identitifying the component type strategy that this
+ * builder is supporting.
+ *
+ * @return a uri identifiying the type strategy
+ */
+ public URI getControlHandlerURI()
+ {
+ return CONTROL_HANDLER_URI;
+ }
+
+ /**
+ * Return a uri identitifying the builder.
+ *
+ * @return a uri identifiying the type builder
+ */
+ public URI getBuilderURI()
+ {
+ return CONTROL_BUILDER_URI;
+ }
+
+ //---------------------------------------------------------------
+ // ControlBuilder
+ //---------------------------------------------------------------
+
+ public ControlDescriptor buildControl()
+ {
+ URI uri = getURI();
+ String name = getName();
+ return new ControlDescriptor( name, uri, m_description, m_optional,
m_modelFlag );
+ }
+
+ //---------------------------------------------------------------
+ // internals
+ //---------------------------------------------------------------
+
+ private URI getURI()
+ {
+ if( null == m_uri )
+ {
+ final String error =
+ "Missing control uri attribute.";
+ throw new BuildException( error, getLocation() );
+ }
+ return m_uri;
+ }
+
+ private String getName()
+ {
+ if( null == m_name )
+ {
+ final String error =
+ "Missing control name attribute.";
+ throw new BuildException( error, getLocation() );
+ }
+ return m_name;
+ }
+
+ //---------------------------------------------------------------
+ // static utils
+ //---------------------------------------------------------------
+
+ private static URI CONTROL_HANDLER_URI = setupURI(
"@CONTROL-HANDLER-URI@" );
+ private static URI CONTROL_BUILDER_URI = setupURI(
"@CONTROL-BUILDER-URI@" );
+
+ protected static URI setupURI( String spec )
+ {
+ try
+ {
+ return new URI( spec );
+ }
+ catch( URISyntaxException ioe )
+ {
+ return null;
+ }
+ }
+}

Added:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ControlsDataType.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/ControlsDataType.java
Mon Mar 14 10:09:23 2005
@@ -0,0 +1,90 @@
+/*
+ * 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.builder.impl;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.net.URI;
+
+import net.dpml.metro.part.ControlDescriptor;
+import net.dpml.metro.builder.ControlBuilder;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.Target;
+import org.apache.tools.ant.ProjectHelper;
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.DynamicElementNS;
+import org.apache.tools.ant.taskdefs.Sequential;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Location;
+
+/**
+ * A datatype that enables custom part builders.
+ *
+ * @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 ControlsDataType extends ProjectComponent implements
DynamicElementNS
+{
+ private List m_builders = new LinkedList();
+ private Task m_owner;
+
+ public ControlsDataType( Task owner )
+ {
+ Project project = owner.getProject();
+ setProject( project );
+ m_owner = owner;
+ }
+
+ public ControlDescriptorBuilderTask createControl()
+ {
+ System.out.println( "# new control" );
+ ControlDescriptorBuilderTask builder = new
ControlDescriptorBuilderTask();
+ m_builders.add( builder );
+ return builder;
+ }
+
+ /**
+ * Operation used to construct a custom part type directive.
+ * @param uri the part handler uri
+ * @param name the element name
+ * @param qualified the qualified name
+ */
+ public Object createDynamicElement( String uri, String name, String
qualified )
+ {
+ throw new UnsupportedOperationException( "dynamic custom task not
available yet" );
+ }
+
+ /**
+ * Return the set of parts contained within this container.
+ * @return the contained parts
+ */
+ public ControlDescriptor[] getControlDescriptors() throws Exception
+ {
+ ControlBuilder[] builders = (ControlBuilder[]) m_builders.toArray(
new ControlBuilder[0] );
+ ControlDescriptor[] descriptors = new ControlDescriptor[
builders.length ];
+ for( int i=0; i<builders.length; i++ )
+ {
+ ControlBuilder builder = builders[i];
+ descriptors [i] = builder.buildControl();
+ }
+ return descriptors;
+ }
+}

Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/MarshalledObjectHelper.java
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/MarshalledObjectHelper.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/MarshalledObjectHelper.java
Mon Mar 14 10:09:23 2005
@@ -26,9 +26,12 @@
import java.io.OutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.rmi.MarshalledObject;

+import net.dpml.metro.builder.BuilderRuntimeException;
+
/**
* A datatype that enables custom part builders.
*
@@ -42,7 +45,7 @@
// static utility class
}

- public static void write( Object object, File file ) throws Exception
+ public static void write( Object object, File file ) throws IOException
{
ObjectOutputStream output = null;
FileOutputStream stream = null;
@@ -53,6 +56,10 @@
output = new ObjectOutputStream( stream );
output.writeObject( marshalled );
}
+ catch( IOException ioe )
+ {
+ throw ioe;
+ }
catch( Throwable e )
{
final String error =
@@ -60,7 +67,36 @@
+ "\ndestination: " + file
+ "\nclass: " + object.getClass().getName()
+ "\nreason: " + e.toString();
- throw new Exception( error, e );
+ throw new BuilderRuntimeException( error, e );
+ }
+ finally
+ {
+ closeStream( output );
+ }
+ }
+
+ public static byte[] writeToByteArray( Object object ) throws IOException
+ {
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ ObjectOutputStream output = null;
+ try
+ {
+ MarshalledObject marshalled = new MarshalledObject( object );
+ output = new ObjectOutputStream( stream );
+ output.writeObject( marshalled );
+ return stream.toByteArray();
+ }
+ catch( IOException ioe )
+ {
+ throw ioe;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to write out object to a
byte array."
+ + "\nclass: " + object.getClass().getName()
+ + "\nreason: " + e.toString();
+ throw new BuilderRuntimeException( error, e );
}
finally
{
@@ -68,6 +104,7 @@
}
}

+
private static void closeStream( OutputStream out )
{
if( null != out )

Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/PartsDataType.java
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/PartsDataType.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/PartsDataType.java
Mon Mar 14 10:09:23 2005
@@ -53,10 +53,10 @@
m_owner = owner;
}

- public ComponentModelBuilder createComponent()
+ public ComponentModelBuilderTask createComponent()
{
System.out.println( "# new component" );
- ComponentModelBuilder builder = new ComponentModelBuilder();
+ ComponentModelBuilderTask builder = new ComponentModelBuilderTask();
m_builders.add( builder );
return builder;
}
@@ -163,14 +163,14 @@
* Return the set of parts contained within this container.
* @return the contained parts
*/
- public Part[] getParts( URI[] uris ) throws Exception
+ public Part[] getParts( ClassLoader classloader ) throws Exception
{
PartBuilder[] builders = (PartBuilder[]) m_builders.toArray( new
PartBuilder[0] );
Part[] parts = new Part[ builders.length ];
for( int i=0; i<builders.length; i++ )
{
PartBuilder builder = builders[i];
- parts[i] = builder.buildPart( uris );
+ parts[i] = builder.buildPart( classloader );
}
return parts;
}

Copied:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
(from r2052,
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/CatalogTask.java)
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/CatalogTask.java
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/RegistryTask.java
Mon Mar 14 10:09:23 2005
@@ -28,19 +28,23 @@
import java.io.ObjectOutputStream;
import java.net.URI;
import java.rmi.MarshalledObject;
+import java.util.Arrays;
import java.util.Properties;
import java.util.List;
import java.util.LinkedList;
+import java.util.ArrayList;

import net.dpml.metro.part.Type;
-import net.dpml.metro.part.Catalog;
-import net.dpml.metro.part.CatalogEntry;
+import net.dpml.metro.part.Registry;
+import net.dpml.metro.part.TypeEntry;
import net.dpml.metro.builder.IntrospectionException;
import net.dpml.metro.builder.TypeBuilder;

import net.dpml.magic.tasks.ProjectTask;
import net.dpml.magic.model.Policy;
import net.dpml.magic.model.Definition;
+import net.dpml.magic.model.Resource;
+import net.dpml.magic.model.ResourceRef;
import net.dpml.magic.project.Context;

import org.apache.tools.ant.Project;
@@ -51,25 +55,24 @@
import org.apache.tools.ant.DynamicElementNS;

/**
- * Task that handles the construction of catalog entries.
+ * Task that handles the construction of registry of type entries.
*
* @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 CatalogTask extends ProjectTask implements DynamicElementNS
+public class RegistryTask extends ProjectTask implements DynamicElementNS
{
private List m_builders = new LinkedList();

- public ComponentDescriptorDataType createEntry()
+ public TypeBuilder createType()
{
- System.out.println( "# new catalog entry" );
- URI base = getDefinition().getArtifactURI( "jar" );
- Definition definition = getDefinition();
- Context context = getContext();
- ComponentDescriptorDataType data =
- new ComponentDescriptorDataType( this, context, definition );
- m_builders.add( data );
- return data;
+ System.out.println( "# new registry entry" );
+ Project project = getProject();
+ ComponentTypeBuilderTask builder = new ComponentTypeBuilderTask();
+ builder.setTaskName( "type" );
+ builder.setProject( project );
+ m_builders.add( builder );
+ return builder;
}

/**
@@ -82,7 +85,7 @@
{
String path = getProject().replaceProperties( uri );
System.out.println( "## creating type builder: " + path );
- TypeBuilder builder = loadTypeHandler( path, name );
+ TypeBuilder builder = loadTypeBuilder( path, name );
if( null == builder )
{
System.out.println( "## null builder" );
@@ -95,7 +98,7 @@
return builder;
}

- private TypeBuilder loadTypeHandler( String uri, String name ) throws
BuildException
+ private TypeBuilder loadTypeBuilder( String uri, String name ) throws
BuildException
{
String urn = uri + ":" + name;
Object builder = null;
@@ -156,18 +159,18 @@
File classes = getContext().getClassesDirectory();
path.createPathElement().setLocation( classes );
ClassLoader classloader = new AntClassLoader( project, path );
- Catalog catalog = constructCatalog( classloader );
- writeCatalog( catalog );
+ Registry registry = buildRegistry( classloader );
+ writeRegistry( registry );
}

- private void writeCatalog( Catalog catalog )
+ private void writeRegistry( Registry registry )
{
ObjectOutputStream output = null;
FileOutputStream stream = null;
File file = getOutputFile();
try
{
- MarshalledObject marshalled = new MarshalledObject( catalog );
+ MarshalledObject marshalled = new MarshalledObject( registry );
stream = new FileOutputStream( file );
output = new ObjectOutputStream( stream );
output.writeObject( marshalled );
@@ -175,9 +178,9 @@
catch( Throwable e )
{
final String error =
- "Unexpected error while attempting to externalize a catalog."
+ "Unexpected error while attempting to externalize a registry."
+ "\ndestination: " + file
- + "\nclass: " + catalog.getClass().getName()
+ + "\nclass: " + registry.getClass().getName()
+ "\nreason: " + e.toString();
throw new BuildException( error, e, getLocation() );
}
@@ -189,8 +192,8 @@

private File getOutputFile()
{
- File dir = getContext().getDeliverablesDirectory( "catalog" );
- String filename = getDefinition().getFilename( "catalog" );
+ File dir = getContext().getDeliverablesDirectory( "registry" );
+ String filename = getDefinition().getFilename( "registry" );
File file = new File( dir, filename );
File parent = file.getParentFile();
if( !parent.exists() )
@@ -200,31 +203,35 @@
return file;
}

- private Catalog constructCatalog( ClassLoader classloader )
+ private Registry buildRegistry( ClassLoader classloader )
{
- CatalogEntry[] entries = getCatalogEntries( classloader );
- Catalog catalog = new Catalog( entries );
- for( int i=0; i<entries.length; i++ )
- {
- CatalogEntry entry = entries[i];
- System.out.println( "# entry: " + entry.toString() );
- }
- return catalog;
+ TypeEntry[] entries = buildTypeEntries( classloader );
+
+ URI[] api = createURISequence( ResourceRef.API );
+ URI[] spi = filter( api, createURISequence( ResourceRef.SPI ) );
+ URI[] impl = filter( combine( api, spi ), createURISequence(
ResourceRef.IMPL ) );
+
+ URI uri = getDefinition().getArtifactURI( "registry" );
+ return new Registry( uri, api, spi, impl, entries );
}

- private CatalogEntry[] getCatalogEntries( ClassLoader classloader )
+ private TypeEntry[] buildTypeEntries( ClassLoader classloader )
{
+ System.out.println( "# building registry entries" );
TypeBuilder[] builders = (TypeBuilder[]) m_builders.toArray( new
TypeBuilder[0] );
- CatalogEntry[] entries = new CatalogEntry[ builders.length ];
+ TypeEntry[] entries = new TypeEntry[ builders.length ];
for( int i=0; i<builders.length; i++ )
{
+ System.out.println( "# type builder " + (i+1) );
TypeBuilder builder = builders[i];
+ URI strategy = builder.getTypeHandlerURI();
try
{
Type type = builder.buildType( classloader );
- URI strategy = builder.getStrategyURI();
- String path = builder.getResourcePath();
- entries[i] = new CatalogEntry( strategy, path );
+ System.out.println( "# type " + type );
+ String classname = type.getClassname();
+ byte[] bytes = MarshalledObjectHelper.writeToByteArray( type
);
+ entries[i] = new TypeEntry( strategy, classname, bytes );
}
catch( IntrospectionException e )
{
@@ -236,6 +243,12 @@
e.setLocation( getLocation() );
throw e;
}
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected catalog construction error.";
+ throw new BuildException( error, e, getLocation() );
+ }
}
return entries;
}
@@ -254,4 +267,61 @@
}
}
}
+
+ private URI[] filter( URI[] excludes, URI[] items )
+ {
+ List result = new ArrayList();
+ List list = Arrays.asList( excludes );
+ for( int i=0; i<items.length; i++ )
+ {
+ URI uri = items[i];
+ if( list.contains( uri ) != true )
+ {
+ result.add( uri );
+ }
+ }
+ return (URI[]) result.toArray( new URI[0] );
+ }
+
+ private URI[] combine( URI[] primary, URI[] secondary )
+ {
+ List list = new ArrayList();
+ for( int i=0; i<primary.length; i++ )
+ {
+ URI uri = primary[i];
+ list.add( uri );
+ }
+ for( int i=0; i<secondary.length; i++ )
+ {
+ URI uri = secondary[i];
+ if( list.contains( uri ) != true )
+ {
+ list.add( uri );
+ }
+ }
+ return (URI[]) list.toArray( new URI[0] );
+ }
+
+ private URI[] createURISequence( int category )
+ {
+ Definition def = getDefinition();
+ ArrayList list = new ArrayList();
+ final ResourceRef[] resources =
+ def.getResourceRefs( getProject(), Policy.RUNTIME, category, true
);
+ for( int i=0; i<resources.length; i++ )
+ {
+ final ResourceRef ref = resources[i];
+ final Policy policy = ref.getPolicy();
+ if( policy.isRuntimeEnabled() )
+ {
+ final Resource resource = getIndex().getResource( ref );
+ if( "jar".equals( resource.getInfo().getType() ) )
+ {
+ URI uri = resource.getArtifactURI( "jar" );
+ list.add( uri );
+ }
+ }
+ }
+ return (URI[]) list.toArray( new URI[0] );
+ }
}

Modified:
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/antlib.xml
==============================================================================
---
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/antlib.xml
(original)
+++
development/laboratory/plus/standard/builder/src/main/net/dpml/metro/builder/impl/antlib.xml
Mon Mar 14 10:09:23 2005
@@ -1,6 +1,7 @@
<?xml version="1.0"?>

<antlib>
- <taskdef name="catalog"
classname="net.dpml.metro.builder.impl.CatalogTask"/>
- <taskdef name="component"
classname="net.dpml.metro.builder.impl.ComponentModelBuilder"/>
+ <taskdef name="registry"
classname="net.dpml.metro.builder.impl.RegistryTask"/>
+ <taskdef name="type"
classname="net.dpml.metro.builder.impl.ComponentTypeBuilderTask"/>
+ <taskdef name="component"
classname="net.dpml.metro.builder.impl.ComponentModelBuilderTask"/>
</antlib>

Modified: development/laboratory/plus/standard/control/build.xml
==============================================================================
--- development/laboratory/plus/standard/control/build.xml (original)
+++ development/laboratory/plus/standard/control/build.xml Mon Mar 14
10:09:23 2005
@@ -6,6 +6,10 @@

<transit:import uri="artifact:template:dpml/magic/standard"/>

+ <target name="init" depends="standard.init">
+ <x:filter feature="plugin" token="CONTROLLER-URI"/>
+ </target>
+
<target name="package" depends="standard.package">
<x:export class="net.dpml.metro.control.impl.DefaultController"/>
</target>

Copied:
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DebugController.java
(from r2050,
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DefaultController.java)
==============================================================================
---
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DefaultController.java
(original)
+++
development/laboratory/plus/standard/control/src/main/net/dpml/metro/control/impl/DebugController.java
Mon Mar 14 10:09:23 2005
@@ -19,13 +19,14 @@
package net.dpml.metro.control.impl;

import java.net.URI;
+import java.net.URISyntaxException;

import net.dpml.metro.part.Part;
+import net.dpml.metro.part.PartHandler;
import net.dpml.metro.kernel.Kernel;
import net.dpml.metro.model.ComponentModel;
-import net.dpml.metro.model.ClassLoaderModel;
import net.dpml.metro.control.Controller;
-import net.dpml.metro.control.ControlMonitor;
+import net.dpml.metro.control.Monitor;

/**
* A initial test controller.
@@ -33,153 +34,122 @@
* @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 DefaultController implements Controller
+public class DebugController implements Controller
{
- private static final String LINE =
- "------------------------------------------------------------";
-
- private static final String CONTROLLER_NAME = "controller";
-
//--------------------------------------------------------------------
// state
//--------------------------------------------------------------------

- private final ControlMonitor m_monitor;
- private final Kernel m_kernel;
+ private Thread m_thread;

//--------------------------------------------------------------------
// constructor
//--------------------------------------------------------------------

- public DefaultController( Kernel kernel, ControlMonitor monitor )
+ public DebugController( PartHandler handler, Monitor monitor, Part part )
{
- m_monitor = monitor;
- m_kernel = kernel;
+ m_thread = new Worker( handler, monitor, part );
}

//--------------------------------------------------------------------
// Controller
//--------------------------------------------------------------------

+ public URI getControllerURI()
+ {
+ return CONTROLLER_URI;
+ }
+
public String getName()
{
- return CONTROLLER_NAME;
+ return "debugger";
}

/**
- * Load an object using a supplied part as the defintion of
- * the deployment criteria.
- * @param part the part model defintion
- * @exception Exception if an error occurs during loading
+ * Startup of the controller.
*/
- public void load( Part part ) throws Exception
+ public void start()
{
- if( part instanceof ComponentModel )
- {
- ComponentModel model = (ComponentModel) part;
- list( model );
- }
- else
- {
- final String error =
- "Part type not recognized.";
- throw new IllegalArgumentException( error );
- }
+ m_thread.start();
+ }
+
+ /**
+ * Stop the controller.
+ */
+ public void stop()
+ {
+ m_thread.interrupt();
}

- public void list( Part part )
+ //--------------------------------------------------------------------
+ // imlementation
+ //--------------------------------------------------------------------
+
+ /**
+ * A little worker thread to do the background stuff.
+ */
+ private static class Worker extends Thread
{
- StringBuffer buffer = new StringBuffer();
- buffer.append( LINE );
- buffer.append( "\nModel Listing" );
- buffer.append( "\nmodel class:" + part.getClass().getName() );
- buffer.append( "\nstrategy urn:" + part.getStrategyURN() );
- if( part instanceof ComponentModel )
+ private final Monitor m_monitor;
+ private final PartHandler m_handler;
+ private final Part m_part;
+
+ public Worker( PartHandler handler, Monitor monitor, Part part )
{
- ComponentModel model = (ComponentModel) part;
- buffer.append( "\nname:" + model.getName() );
- buffer.append( "\nclassname:" + model.getClassname() );
- listClassLoader( model, buffer );
- listServices( model, buffer );
- listDependencies( model, buffer );
- listParts( model, buffer );
+ m_handler = handler;
+ m_monitor = monitor;
+ m_part = part;
}
- else
- {
- //
- // we need a hook back to the kernel to request a
- // controller for the type of part we have just encountered
- //

- try
- {
- Controller controller = getKernel().getController( part );
- controller.list( part );
- }
- catch( Throwable e )
+ private boolean m_continue = true;
+
+ public void run()
+ {
+ while( m_continue )
{
- final String error =
- "Internal error while attempting to resolve a controller
for the part ["
- + part.getStrategyURN()
- + "]";
- getMonitor().error( error, e );
+ try
+ {
+ listPart();
+ getMonitor().notifyCompletion( true );
+ sleep( 1000 );
+ m_continue = false;
+ }
+ catch( InterruptedException ie )
+ {
+ getMonitor().notifyCompletion( false );
+ m_continue = false;
+ }
}
}
- }
-
- private void listServices( ComponentModel part, StringBuffer buffer )
- {
- buffer.append( "\nservices: NOT IMPLEMENTED " );
- }

- private void listDependencies( ComponentModel part, StringBuffer buffer )
- {
- buffer.append( "\ndependencies: NOT IMPLEMENTED " );
- }
-
- private void listParts( ComponentModel part, StringBuffer buffer )
- {
- Part[] parts = part.getParts();
- buffer.append( "\nparts:" + parts.length );
- getMonitor().info( buffer.toString() );
- for( int i=0; i<parts.length; i++ )
+ private Monitor getMonitor()
{
- Part p = parts[i];
- list( p );
+ return m_monitor;
}
- }

- private void listClassLoader( ComponentModel part, StringBuffer buffer )
- {
- ClassLoaderModel model = part.getClassLoaderModel();
- URI[] uris = model.getApiURIs();
- buffer.append( "\nclass loader model API entries: " + uris.length );
- for( int i=0; i<uris.length; i++ )
+ private PartHandler getPartHandler()
{
- URI uri = uris[i];
- buffer.append( "\n" + (i + 1) + ". " + uri );
+ return m_handler;
}
- uris = model.getImplementationURIs();
- buffer.append( "\nclass loader model IMPL entries: " + uris.length );
- for( int i=0; i<uris.length; i++ )
+
+ private void listPart()
{
- URI uri = uris[i];
- buffer.append( "\n" + (i + 1) + ". " + uri );
+ getMonitor().info( "listing part: " + m_part );
}
}

- //--------------------------------------------------------------------
- // imlementation
- //--------------------------------------------------------------------
+ private static URI CONTROLLER_URI = setupURI( "@CONTROLLER-URI@" );

- private ControlMonitor getMonitor()
+ protected static URI setupURI( String spec )
{
- return m_monitor;
- }
-
- private Kernel getKernel()
- {
- return m_kernel;
+ try
+ {
+ return new URI( spec );
+ }
+ catch( URISyntaxException ioe )
+ {
+ return null;
+ }
}

}

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 Mon Mar 14
10:09:23 2005
@@ -7,14 +7,17 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>

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

</project>

Modified: development/laboratory/plus/test/execution/build.xml
==============================================================================
--- development/laboratory/plus/test/execution/build.xml (original)
+++ development/laboratory/plus/test/execution/build.xml Mon Mar 14
10:09:23 2005
@@ -11,10 +11,12 @@
</target>

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



  • svn commit: r2062 - in development/laboratory/plus: . api/builder/src/main/net/dpml/metro/builder api/control/src/main/net/dpml/metro/control api/kernel/src/main/net/dpml/metro/home api/model api/model/src/main/net/dpml/metro/meta api/model/src/main/net/dpml/metro/model api/model/src/test/net/dpml/metro/model api/part/src/main/net/dpml/metro/part core/src/main/net/dpml/metro/home core/src/main/net/dpml/metro/home/impl core/src/main/net/dpml/metro/kernel/impl standard/builder standard/builder/src/main/net/dpml/metro/builder/impl standard/builder/src/main/net/dpml/metro/builder/part standard/builder/src/main/net/dpml/metro/builder/type standard/control standard/control/src/main/net/dpml/metro/control/impl test/example/impl test/execution, mcconnell, 03/13/2005

Archive powered by MHonArc 2.6.24.

Top of Page