notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2948 - in development/main/metro: composition/builder/src/main/net/dpml/composition/builder composition/builder/src/main/net/dpml/composition/builder/assembly composition/builder/src/main/net/dpml/composition/builder/datatypes composition/control/src/main/net/dpml/composition/control composition/control/src/main/net/dpml/composition/runtime part/src/main/net/dpml/part/control
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2948 - in development/main/metro: composition/builder/src/main/net/dpml/composition/builder composition/builder/src/main/net/dpml/composition/builder/assembly composition/builder/src/main/net/dpml/composition/builder/datatypes composition/control/src/main/net/dpml/composition/control composition/control/src/main/net/dpml/composition/runtime part/src/main/net/dpml/part/control
- Date: Fri, 01 Jul 2005 20:57:43 -0400
Author: mcconnell AT dpml.net
Date: Fri Jul 1 20:57:43 2005
New Revision: 2948
Added:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/assembly/
Removed:
development/main/metro/part/src/main/net/dpml/part/control/EntryNotFoundException.java
development/main/metro/part/src/main/net/dpml/part/control/LifecycleRuntimeException.java
development/main/metro/part/src/main/net/dpml/part/control/LifestyleException.java
development/main/metro/part/src/main/net/dpml/part/control/UnknownSchemaException.java
Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LifecycleHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LoggingHandler.java
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/ValueHandler.java
development/main/metro/part/src/main/net/dpml/part/control/LifecycleException.java
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
Log:
Some cleaning up of the codebase.
Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/ComponentBuilderTask.java
Fri Jul 1 20:57:43 2005
@@ -227,6 +227,7 @@
{
if( null == m_dependencies )
{
+ System.out.println( "# Creating dependencies datatype." );
m_dependencies = new DependenciesDataType();
return m_dependencies;
}
@@ -257,6 +258,7 @@
{
ClassLoaderDirective cld = constructClassLoaderDirective();
ComponentProfile profile = buildComponentProfile( classloader,
cld );
+
URI uri = getDefinition().getArtifactURI( Part.ARTIFACT_TYPE );
if( null == m_output )
{
Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/DependenciesDataType.java
Fri Jul 1 20:57:43 2005
@@ -41,6 +41,7 @@
*/
public DependencyDataType createDependency()
{
+ System.out.println( "# Creating new dependency" );
final DependencyDataType dep = new DependencyDataType ();
m_dependencies.add( dep );
return dep;
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
Fri Jul 1 20:57:43 2005
@@ -280,6 +280,7 @@
if( isRecognizedPart( part ) )
{
ClassLoader classloader = getClassLoader( parent );
+
if( part instanceof ValueDirective )
{
ValueDirective directive = (ValueDirective) part;
@@ -303,7 +304,7 @@
final String error =
"Unsupported part implementation class ["
+ classname
- + "] passed to newComponent/4.";
+ + "] passed to newComponent/3.";
throw new UnsupportedPartTypeException( CONTROLLER_URI,
classname, error );
}
}
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LifecycleHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LifecycleHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LifecycleHandler.java
Fri Jul 1 20:57:43 2005
@@ -34,7 +34,6 @@
import net.dpml.parameters.Parameters;
import net.dpml.part.control.LifecycleException;
-import net.dpml.part.control.LifecycleRuntimeException;
/**
@@ -140,7 +139,7 @@
+ "] decares an unsupported constructor parameter type ["
+ c.getName()
+ "].";
- throw new LifecycleRuntimeException( error );
+ throw new LifecycleException( error );
}
}
@@ -150,98 +149,14 @@
}
catch( Throwable e )
{
- Class clazz = constructor.getDeclaringClass();
- throw new LifecycleException( component, e );
+ final String error =
+ "Instantiation failure."
+ + "\nComponent class: " + constructor.getDeclaringClass();
+ throw new LifecycleException( error, e );
}
}
/**
- * Return the state manager for the component instance.
- *
- * @return the state manager (possibly null)
- */
- /*
- public Manager getManager( ComponentHandler component ) throws
LifecycleException, InvocationTargetException
- {
- if( getLogger().isDebugEnabled() )
- {
- final String message =
- "Instantiating state manager for ["
- + component.getURI()
- + "].";
- getLogger().debug( message );
- }
-
- Class subject = component.getDeploymentClass();
- Class control = getInnerClass( subject, "Controller" );
- if( null == control )
- {
- if( Startable.class.isAssignableFrom( subject ) )
- {
- return new StartableManager( component );
- }
- else if( Executable.class.isAssignableFrom( subject ) )
- {
- return new ExecutableManager( component );
- }
- else
- {
- return new NullManager( component );
- }
- }
-
- URI uri = component.getURI();
- ClassLoader classloader = subject.getClassLoader();
- Constructor constructor = getConstructor( control );
- Class[] classes = constructor.getParameterTypes();
- Object[] args = new Object[ classes.length ];
- Object instance = component.getValue();
-
- for( int i=0; i<classes.length; i++ )
- {
- Class c = classes[i];
- if( java.util.logging.Logger.class.isAssignableFrom( c ) )
- {
- args[i] = getJavaLogger( component );
- }
- else if( Logger.class.isAssignableFrom( c ) )
- {
- args[i] = getLoggingChannel( component );
- }
- else if( subject.isAssignableFrom( c ) )
- {
- args[i] = instance;
- }
- else if( ChangeListener.class.isAssignableFrom( c ) )
- {
- args[i] = component;
- }
- else
- {
- final String error =
- "The controller class ["
- + control.getName()
- + "] in the component ["
- + subject.getName()
- + "] decares an unsupported constructor parameter type ["
- + c.getName()
- + "].";
- throw new LifecycleRuntimeException( error );
- }
- }
-
- try
- {
- return (Manager) constructor.newInstance( args );
- }
- catch( Throwable e )
- {
- throw new LifecycleException( component, e );
- }
- }
- */
-
- /**
* Apply the etherialization process to the supplied instance.
*
* @param object the object to etherialize
@@ -278,7 +193,7 @@
}
}
- private Constructor getConstructor( Class subject ) throws
LifecycleRuntimeException
+ private Constructor getConstructor( Class subject ) throws
LifecycleException
{
Constructor[] constructors = subject.getConstructors();
if( constructors.length < 1 )
@@ -287,7 +202,7 @@
"The component class ["
+ subject.getName()
+ "] does not declare a public constructor.";
- throw new LifecycleRuntimeException( error );
+ throw new LifecycleException( error );
}
else if( constructors.length > 1 )
{
@@ -295,7 +210,7 @@
"The component class ["
+ subject.getName()
+ "] declares more than one public constructor.";
- throw new LifecycleRuntimeException( error );
+ throw new LifecycleException( error );
}
else
{
@@ -303,7 +218,7 @@
}
}
- private Object newParametersInvocationHandler( Parameters params )
throws LifecycleRuntimeException
+ private Object newParametersInvocationHandler( Parameters params )
throws LifecycleException
{
try
{
@@ -314,12 +229,12 @@
catch( Throwable e )
{
final String error =
- "Unexpected error while attempting to construct the
configuration invocation handler.";
- throw new LifecycleRuntimeException( error, e );
+ "Unexpected error while attempting to construct the parameters
invocation handler.";
+ throw new LifecycleException( error, e );
}
}
- private Object newConfigurationInvocationHandler( Configuration config )
throws LifecycleRuntimeException
+ private Object newConfigurationInvocationHandler( Configuration config )
throws LifecycleException
{
try
{
@@ -331,12 +246,12 @@
{
final String error =
"Unexpected error while attempting to construct the
configuration invocation handler.";
- throw new LifecycleRuntimeException( error, e );
+ throw new LifecycleException( error, e );
}
}
private Object newContextInvocationHandler(
- ComponentHandler component, Class clazz ) throws
LifecycleRuntimeException
+ ComponentHandler component, Class clazz ) throws LifecycleException
{
try
{
@@ -348,7 +263,7 @@
{
final String error =
"Unexpected error while attempting to construct the context
invocation handler.";
- throw new LifecycleRuntimeException( error, e );
+ throw new LifecycleException( error, e );
}
}
@@ -364,7 +279,7 @@
{
final String error =
"Unexpected error while attempting to construct the parts
invocation handler.";
- throw new LifecycleRuntimeException( error, e );
+ throw new LifecycleException( error, e );
}
}
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LoggingHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LoggingHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/LoggingHandler.java
Fri Jul 1 20:57:43 2005
@@ -32,8 +32,6 @@
import net.dpml.parameters.Parameters;
-import net.dpml.part.control.LifecycleException;
-import net.dpml.part.control.LifecycleRuntimeException;
import net.dpml.part.manager.Component;
Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/ValueHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/ValueHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/runtime/ValueHandler.java
Fri Jul 1 20:57:43 2005
@@ -669,9 +669,7 @@
}
else
{
- final String error =
- "Context urn not recognized: " + argument;
- throw new IllegalArgumentException( error );
+ return null;
}
}
}
Modified:
development/main/metro/part/src/main/net/dpml/part/control/LifecycleException.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/control/LifecycleException.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/control/LifecycleException.java
Fri Jul 1 20:57:43 2005
@@ -18,9 +18,6 @@
package net.dpml.part.control;
-import net.dpml.part.manager.Component;
-
-
/**
* Exception to indicate that there was a lifecycle related error.
*
@@ -29,22 +26,25 @@
*/
public class LifecycleException extends Exception
{
- private Component m_component;
-
/**
* Construct a new <code>LifecycleException</code> instance.
*
- * @param throwable the root cause of the exception
+ * @param message the exception message
*/
- public LifecycleException( final Component component, final Throwable
throwable )
+ public LifecycleException( final String message )
{
- super( null, throwable );
- m_component = component;
+ this( message, null );
}
- public Component getComponent()
+ /**
+ * Construct a new <code>LifecycleException</code> instance.
+ *
+ * @param message the exception message
+ * @param throwable the root cause of the exception
+ */
+ public LifecycleException( final String message, final Throwable
throwable )
{
- return m_component;
+ super( null, throwable );
}
}
Modified:
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
Fri Jul 1 20:57:43 2005
@@ -40,12 +40,6 @@
URI getURI() throws RemoteException;
/**
- * Load the model controller.
- * @return the controller
- */
- //Controller getController() throws RemoteException;
-
- /**
* Load a part handler giiven a handler uri.
* @return the part handler
*/
- svn commit: r2948 - in development/main/metro: composition/builder/src/main/net/dpml/composition/builder composition/builder/src/main/net/dpml/composition/builder/assembly composition/builder/src/main/net/dpml/composition/builder/datatypes composition/control/src/main/net/dpml/composition/control composition/control/src/main/net/dpml/composition/runtime part/src/main/net/dpml/part/control, mcconnell, 07/01/2005
Archive powered by MHonArc 2.6.24.