mcconnell 2004/01/11 18:13:05
Modified: merlin project.xml
merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl
CompositeBlock.java DefaultAppliance.java
merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
DefaultContainmentModel.java
Log:
Add null provider check and note re. existing bug.
Revision Changes Path
1.21 +1 -1 avalon/merlin/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/project.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- project.xml 8 Jan 2004 16:48:12 -0000 1.20
+++ project.xml 12 Jan 2004 02:13:04 -0000 1.21
@@ -6,7 +6,7 @@
<groupId>merlin</groupId>
<id>merlin</id>
<name>Avalon Merlin</name>
- <currentVersion>3.2.5-dev</currentVersion>
+ <currentVersion>3.3-RC1</currentVersion>
<organization>
<name>Apache Software Foundation</name>
1.5 +11 -26
avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/CompositeBlock.java
Index: CompositeBlock.java
===================================================================
RCS file:
/home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/CompositeBlock.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CompositeBlock.java 8 Jan 2004 16:48:12 -0000 1.4
+++ CompositeBlock.java 12 Jan 2004 02:13:04 -0000 1.5
@@ -238,33 +238,18 @@
if( proxy == null ) throw new NullPointerException( "proxy" );
if( method == null ) throw new NullPointerException( "method" );
- //
- // if the invocation is against java.lang.Object then
- // delegate the operation to the block
- //
-
- if( method.getDeclaringClass().equals( java.lang.Object.class ) )
- {
- m_logger.debug( "invocation: " + method.getName() );
- try
- {
- return method.invoke( m_block, args );
- }
- catch( InvocationTargetException e )
- {
- final String error =
- "Unexpected delegation error on java.lang.Object";
- throw new ApplianceException( error, e.getTargetException() );
- }
- }
-
- //
- // otherwise we are delegating to an implementation component
- //
-
final ContainmentModel model = m_context.getContainmentModel();
+ Class source = method.getDeclaringClass();
ServiceDirective service =
- model.getExportDirective( method.getDeclaringClass() );
+ model.getExportDirective( source );
+ if( null == service )
+ {
+ final String error =
+ "Unable to resolve an provider for the class ["
+ + source.getName()
+ + "].";
+ throw new IllegalStateException( error );
+ }
String path = service.getPath();
Appliance provider = (Appliance) m_block.locate( path );
1.17 +2 -3
avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java
Index: DefaultAppliance.java
===================================================================
RCS file:
/home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DefaultAppliance.java 9 Jan 2004 14:13:00 -0000 1.16
+++ DefaultAppliance.java 12 Jan 2004 02:13:04 -0000 1.17
@@ -1164,8 +1164,7 @@
private Object createProvider( Object instance ) throws ApplianceException
{
- if( getComponentModel().
- getType().getInfo().
+ if( m_model.getType().getInfo().
getAttribute( "urn:activation:proxy", "true" ).equals( "false" ) )
{
return instance;
1.16 +6 -1
avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
Index: DefaultContainmentModel.java
===================================================================
RCS file:
/home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DefaultContainmentModel.java 9 Jan 2004 12:00:36 -0000 1.15
+++ DefaultContainmentModel.java 12 Jan 2004 02:13:05 -0000 1.16
@@ -1135,6 +1135,11 @@
*/
public ServiceDirective getExportDirective( Class clazz )
{
+ // ##
+ // ## BUG
+ // ## need to resolve class agaisnt class loaded from
+ // ## service export classname
+ // ##
return m_context.getContainmentProfile().getExportDirective( clazz );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]