Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2075 - in development/laboratory/plus: . api/builder/src/main/net/dpml/metro/builder api/control/src/main/net/dpml/metro/control api/kernel core test/example/impl test/execution test/execution/src/test/net/dpml/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: r2075 - in development/laboratory/plus: . api/builder/src/main/net/dpml/metro/builder api/control/src/main/net/dpml/metro/control api/kernel core test/example/impl test/execution test/execution/src/test/net/dpml/test/execution
  • Date: Mon, 14 Mar 2005 20:23:01 -0500

Author: mcconnell AT dpml.net
Date: Mon Mar 14 20:23:01 2005
New Revision: 2075

Added:

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

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Control.java
- copied, changed from r2071,
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Controller.java

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

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

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

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

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

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

development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Manager.java
- copied, changed from r2071,
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/MasterController.java

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

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

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

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

development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
- copied, changed from r2068,
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/KernelTestCase.java
Removed:

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

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

development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/KernelTestCase.java
Modified:

development/laboratory/plus/api/builder/src/main/net/dpml/metro/builder/PartBuilder.java
development/laboratory/plus/index.xml
development/laboratory/plus/test/example/impl/build.xml
development/laboratory/plus/test/execution/build.xml
Log:


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 20:23:01 2005
@@ -22,7 +22,8 @@
import java.io.IOException;

import net.dpml.metro.part.Part;
-import net.dpml.metro.part.BadStrategyException;
+
+import net.dpml.metro.control.BadStrategyException;

/**
* The contract for builders that create component part.

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/BadStrategyException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/BadStrategyException.java
Mon Mar 14 20:23:01 2005
@@ -0,0 +1,52 @@
+/*
+ * 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 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_handler;
+ private URI m_requested;
+
+ public BadStrategyException( URI handler, URI requested )
+ {
+ super( requested.toString() );
+ m_handler = handler;
+ m_requested = requested ;
+ }
+
+ public URI getHandlerURI()
+ {
+ return m_handler;
+ }
+
+ public URI getRequestedURI()
+ {
+ return m_requested;
+ }
+}
+

Copied:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Control.java
(from r2071,
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/Control.java
Mon Mar 14 20:23:01 2005
@@ -23,28 +23,27 @@
import net.dpml.metro.part.Part;

/**
- * Common interface implemented by controllers.
+ * Common interface implemented by controls.
*
* @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 Controller
+public interface Control
{
/**
- * Return a human readable short name of the controller.
- * @return the controller name
+ * Return the uri identifying this controller.
+ * @return the controller uri
*/
- String getName();
+ URI getURI();

/**
- * Return the uri identifying this controller type.
- * @return the controller uri
+ * Return a human readable short name of the controller.
+ * @return the controller name
*/
- URI getControllerURI();
+ String getName();

/**
* Start the controller.
- * @param monitor a control monitor supplied by a controlling system
* @exception if a startup failure occurs
*/
void start() throws Exception;

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/DuplicateNameException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/DuplicateNameException.java
Mon Mar 14 20:23:01 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.control;
+
+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 DuplicateNameException extends HomeException
+{
+ private String m_name;
+
+ public DuplicateNameException( String name )
+ {
+ super( name );
+ m_name = name;
+ }
+
+ public String getName()
+ {
+ return m_name;
+ }
+
+}
+

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Handler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Handler.java
Mon Mar 14 20:23:01 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.control;
+
+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/control/src/main/net/dpml/metro/control/HandlerNotFoundException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/HandlerNotFoundException.java
Mon Mar 14 20:23:01 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.control;
+
+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, Throwable cause )
+ {
+ super( uri.toString(), cause );
+ m_uri = uri;
+ }
+
+ public URI getURI()
+ {
+ return m_uri;
+ }
+
+}
+

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Home.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Home.java
Mon Mar 14 20:23:01 2005
@@ -0,0 +1,55 @@
+/*
+ * 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 java.net.URI;
+import java.io.IOException;
+
+import net.dpml.metro.part.Part;
+
+/**
+ * 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
+{
+ /**
+ * Load the handler for the supplied part.
+ * @param part the part
+ * @return the part controller
+ */
+ PartHandler getPartHandler( Part part ) throws IOException,
HandlerNotFoundException;
+
+ /**
+ * Load a part
+ * @param uri the part uri
+ * @return the part instance
+ */
+ Part loadPart( URI uri ) throws PartNotFoundException,
HandlerNotFoundException, IOException;
+
+ /**
+ * Resolve a part handler.
+ * @param uri the uri identifying the part type
+ * @return the part handler
+ */
+ PartHandler resolvePartHandler( URI uri ) throws
HandlerNotFoundException, IOException;
+}

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/HomeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/HomeException.java
Mon Mar 14 20:23:01 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.control;
+
+/**
+ * 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/control/src/main/net/dpml/metro/control/HomeRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/HomeRuntimeException.java
Mon Mar 14 20:23:01 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.control;
+
+/**
+ * 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 );
+ }
+
+}
+

Copied:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Manager.java
(from r2071,
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/MasterController.java)
==============================================================================
---
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/MasterController.java
(original)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/Manager.java
Mon Mar 14 20:23:01 2005
@@ -18,10 +18,11 @@

package net.dpml.metro.control;

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

/**
- * Master controller interface. This interface should allow the dynamic
+ * Part manager 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.
@@ -29,22 +30,36 @@
* @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
+public interface Manager extends Control
{
/**
- * Return an array of the standard controllers asociated
- * with the part.
+ * Add a part to the collection of parts managed by this controller.
+ *
+ * @param part
+ */
+ void addPart( String name, Part part )
+ throws DuplicateNameException, UnsupportedPartTypeException;
+
+ /**
+ * Return an array of managed parts.
+ * @return the parts array
+ */
+ Part[] getParts();
+
+ /**
+ * Return an array of controller descriptors asociated
+ * with the part type.
*
* @return the standard controller descriptor array
*/
- ControlDescriptor[] getControllers();
+ //ControlDescriptor[] getControllers();

/**
* Returns the descriptor of a named controller.
*
* @return the controller descriptor
*/
- ControlDescriptor getControlDescriptor( String name ) throws
NoSuchControlException;
+ //ControlDescriptor getControlDescriptor( String name ) throws
NoSuchControlException;

// MUCH MORE PENDING


Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/PartHandler.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/PartHandler.java
Mon Mar 14 20:23:01 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.control;
+
+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
+{
+ URI getURI();
+
+ Part loadPart( URI uri )
+ throws BadStrategyException, PartNotFoundException, IOException;
+
+ Part loadPart( URI strategy, byte[] bytes ) throws BadStrategyException,
IOException;
+}

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/PartHandlerRuntimeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/PartHandlerRuntimeException.java
Mon Mar 14 20:23:01 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.control;
+
+/**
+ * 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/control/src/main/net/dpml/metro/control/PartNotFoundException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/PartNotFoundException.java
Mon Mar 14 20:23:01 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.control;
+
+import java.net.URI;
+
+/**
+ * Exception thrown when an attempt is made to reference an unknown 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 class PartNotFoundException extends HomeException
+{
+ private URI m_uri;
+
+ public PartNotFoundException( URI uri )
+ {
+ this( uri, null );
+ }
+
+ public PartNotFoundException( URI uri, Exception cause )
+ {
+ super( uri.toString(), cause );
+ m_uri = uri;
+ }
+
+ public URI getURI()
+ {
+ return m_uri;
+ }
+
+}
+

Added:
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/UnsupportedPartTypeException.java
==============================================================================
--- (empty file)
+++
development/laboratory/plus/api/control/src/main/net/dpml/metro/control/UnsupportedPartTypeException.java
Mon Mar 14 20:23:01 2005
@@ -0,0 +1,53 @@
+/*
+ * 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 java.net.URI;
+
+import net.dpml.metro.part.Part;
+
+/**
+ * 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 UnsupportedPartTypeException extends Exception
+{
+ private String m_type;
+
+ public UnsupportedPartTypeException( Part part )
+ {
+ this( part.getClass().getName() );
+ }
+
+ public UnsupportedPartTypeException( String classname )
+ {
+ super( classname );
+ m_type = classname;
+ }
+
+ public String getPartTypeClassname()
+ {
+ return m_type;
+ }
+
+}
+

Modified: development/laboratory/plus/index.xml
==============================================================================
--- development/laboratory/plus/index.xml (original)
+++ development/laboratory/plus/index.xml Mon Mar 14 20:23:01 2005
@@ -49,10 +49,10 @@
</info>
</project>

- <project basedir="api/builder">
+ <project basedir="api/control">
<info>
<group>dpml/metro</group>
- <name>dpml-metro-builder-api</name>
+ <name>dpml-metro-control-api</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
<types>
@@ -64,10 +64,10 @@
</dependencies>
</project>

- <project basedir="api/control">
+ <project basedir="api/builder">
<info>
<group>dpml/metro</group>
- <name>dpml-metro-control-api</name>
+ <name>dpml-metro-builder-api</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
<types>
@@ -76,13 +76,14 @@
</info>
<dependencies>
<include key="dpml-metro-part-api"/>
+ <include key="dpml-metro-control-api"/>
</dependencies>
</project>

- <project basedir="api/kernel">
+ <project basedir="standard/part">
<info>
<group>dpml/metro</group>
- <name>dpml-metro-kernel-api</name>
+ <name>dpml-metro-part-impl</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
<types>
@@ -90,24 +91,26 @@
</types>
</info>
<dependencies>
- <include key="dpml-metro-part-api"/>
<include key="dpml-metro-control-api"/>
+ <include key="dpml-metro-part-api"/>
+ <include key="dpml-transit-main"/>
</dependencies>
</project>

- <project basedir="core">
+ <project basedir="standard/control">
<info>
<group>dpml/metro</group>
- <name>dpml-metro-kernel-impl</name>
+ <name>dpml-metro-control-impl</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
<types>
<type>jar</type>
+ <type>plugin</type>
</types>
</info>
<dependencies>
- <include key="dpml-metro-kernel-api"/>
- <include key="dpml-transit-main"/>
+ <include key="dpml-metro-control-api"/>
+ <include key="dpml-metro-part-impl"/>
</dependencies>
</project>

@@ -123,47 +126,14 @@
</types>
</info>
<dependencies>
- <include key="dpml-metro-part-api" tag="api"/>
- <include key="dpml-metro-model-api"/>
<include key="dpml-metro-builder-api"/>
+ <include key="dpml-metro-control-impl"/>
+ <include key="dpml-metro-part-impl"/>
<include key="dpml-transit-tools"/>
<include key="dpml-magic-core"/>
</dependencies>
</project>

- <project basedir="standard/model">
- <info>
- <group>dpml/metro</group>
- <name>dpml-metro-model-api</name>
- <version>1.0.0</version>
- <status>SNAPSHOT</status>
- <types>
- <type>jar</type>
- </types>
- </info>
- <dependencies>
- <include key="dpml-metro-part-api"/>
- <include key="dpml-transit-main"/>
- </dependencies>
- </project>
-
- <project basedir="standard/control">
- <info>
- <group>dpml/metro</group>
- <name>dpml-metro-control-impl</name>
- <version>1.0.0</version>
- <status>SNAPSHOT</status>
- <types>
- <type>jar</type>
- </types>
- </info>
- <dependencies>
- <include key="dpml-metro-kernel-api"/>
- <include key="dpml-metro-control-api"/>
- <include key="dpml-metro-model-api"/>
- </dependencies>
- </project>
-
<project basedir="test/example/api">
<info>
<group>dpml/metro</group>
@@ -209,7 +179,6 @@
<include key="dpml-test-hello-api" tag="api"/>
<include key="dpml-test-hello-impl" tag="impl"/>
<include key="dpml-transit-main" test="true" runtime="false"/>
- <include key="dpml-metro-kernel-impl" test="true" runtime="false"/>
<include key="dpml-metro-control-impl" test="true" runtime="false"/>
</dependencies>
<plugins>

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
20:23:01 2005
@@ -7,7 +7,10 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="package" depends="standard.package">
+ <x:property feature="uri" type="registry" name="registry.uri"/>
<x:property key="dpml-metro-control-impl" feature="plugin"
name="debugger.uri"/>
+
+ <!-- example of the creation of a serialized registry -->
<registry xmlns="plugin:dpml/metro/dpml-metro-builder-impl">
<type class="net.dpml.test.hello.impl.HelloComponent">
<controls>
@@ -18,6 +21,10 @@
</parts>
</type>
</registry>
+
+ <!-- example of the creation of a standalone part -->
+ <component xmlns="plugin:dpml/metro/dpml-metro-builder-impl"
+ class="net.dpml.test.hello.impl.HelloComponent"
uri="${registry.uri}"/>
</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
20:23:01 2005
@@ -7,10 +7,14 @@
<transit:import uri="artifact:template:dpml/magic/standard"/>

<target name="init" depends="standard.init">
- <filter token="XPATH"
value="target/deliverables/parts/${project.filename}"/>
+ <x:property name="spec" key="dpml-test-hello-impl" feature="uri"
type="part"/>
+ <filter token="HELLO-PART-URI" value="${spec}"/>
+ <filter token="PATH"
value="target/deliverables/parts/${project.filename}"/>
+ <x:filter token="PART-CONTROLLER-URI" key="dpml-metro-control-impl"
feature="plugin"/>
<x:property key="dpml-test-hello-impl" feature="uri" type="registry"
name="hello.registry"/>
</target>

+ <!--
<target name="package" depends="standard.package">
<component xmlns="plugin:dpml/metro/dpml-metro-builder-impl"
class="net.dpml.test.hello.impl.HelloComponent"
uri="${hello.registry}">
@@ -19,6 +23,7 @@
</parts>
</component>
</target>
+ -->

</project>


Copied:
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
(from r2068,
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/KernelTestCase.java)
==============================================================================
---
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/KernelTestCase.java
(original)
+++
development/laboratory/plus/test/execution/src/test/net/dpml/test/execution/HomeTestCase.java
Mon Mar 14 20:23:01 2005
@@ -21,8 +21,11 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.net.URL;
+import java.net.URI;

-import net.dpml.metro.kernel.impl.DefaultKernel;
+import net.dpml.metro.part.Part;
+import net.dpml.metro.control.impl.TransitHome;

import junit.framework.TestCase;

@@ -33,28 +36,49 @@
* @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 KernelTestCase extends TestCase
+public class HomeTestCase extends TestCase
{
static
{
System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
}

- private static final String XPATH = "@XPATH@";
+ private static final String CONTROLLER_URI_SPEC = "@PATH@";

- private DefaultKernel m_kernel;
+ private TransitHome m_home;

public void setUp() throws Exception
{
- m_kernel = new DefaultKernel();
+ m_home = new TransitHome();
}

- public void testKernel() throws Exception
+ public void testHome() throws Exception
{
+ Part part = m_home.loadPart( HELLO_PART_URI );
+ System.out.println( "#part: " + part );
+
+ /*
+ Controller controller = m_home.loadController( HELLO_PART_URI );
File basedir = new File( System.getProperty( "project.basedir" ) );
- File file = new File( basedir, XPATH );
- InputStream input = new FileInputStream( file.getCanonicalFile() );
- m_kernel.load( input );
+ File file = new File( basedir, PATH );
+ URL url = file.toURL();
+ Part part = m_home.loadPart( uri );
+ System.out.println( "#part: " + part );
+ */
}

+ private static final URI HELLO_PART_URI = createStaticURI(
"@HELLO-PART-URI@" );
+ private static final URI PART_CONTROLLER_URI = createStaticURI(
"@PART-CONTROLLER-URI@" );
+
+ private static URI createStaticURI( String path )
+ {
+ try
+ {
+ return new URI( path );
+ }
+ catch( Throwable e )
+ {
+ return null;
+ }
+ }
}



  • svn commit: r2075 - in development/laboratory/plus: . api/builder/src/main/net/dpml/metro/builder api/control/src/main/net/dpml/metro/control api/kernel core test/example/impl test/execution test/execution/src/test/net/dpml/test/execution, mcconnell, 03/14/2005

Archive powered by MHonArc 2.6.24.

Top of Page