You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by ha...@apache.org on 2004/07/08 01:27:35 UTC

svn commit: rev 22686 - in excalibur/branches/fortress-experiments: container-api/src/java/org/apache/avalon/fortress container-api/src/java/org/apache/avalon/fortress/attributes container-api/src/java/org/apache/avalon/fortress/interceptor container-impl/src/java/org/apache/avalon/fortress/impl container-impl/src/java/org/apache/avalon/fortress/impl/interceptor container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/cglib container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/simple container-impl/src/java/org/apache/avalon/fortress/impl/role container-test/src/test/org/apache/avalon/fortress/impl/interceptor container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples

Author: hammett
Date: Wed Jul  7 16:27:35 2004
New Revision: 22686

Added:
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/ExtendedMetaInfo.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/attributes/
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/attributes/AttributeInfo.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/Interceptor.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/InterceptorManager.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/InterceptorManagerException.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/InterceptorEnabledContainer.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/AbstractInterceptor.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/ComponentFamily.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/DefaultInterceptorManager.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/InterceptableFactory.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/TailInterceptor.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/cglib/
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/simple/
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/simple/SimpleInterceptableFactory.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/ComponentFamilyTestCase.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/DefaultInterceptorManagerTestCase.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/CustomerDAOImpl.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/CustomerDataAccessObject.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/DataAccessObject.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/test1.xconf
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/test1.xlog
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/AnotherValidInterceptor.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/InvalidInterceptor.java   (contents, props changed)
   excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/ValidInterceptor.java   (contents, props changed)
Modified:
   excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/MetaInfoManager.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultContainer.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultEventManager.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/AbstractMetaInfoManager.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ECMMetaInfoManager.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/FortressRoleManager.java
   excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ServiceMetaManager.java
Log:
Meta collection is being extended - not done yet (need to think about a more clever way to handle attributes definitions)
Interceptor insfrastructure almost ok, but depends on Meta.

Added: excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/ExtendedMetaInfo.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/ExtendedMetaInfo.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,50 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import org.apache.avalon.fortress.attributes.AttributeInfo;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class ExtendedMetaInfo
+{
+    private final AttributeInfo[] m_classAttributes;
+    private final Map m_method2Attributes;
+    
+    public ExtendedMetaInfo( AttributeInfo[] classAttributes, final Map method2Attributes )
+    { 
+        m_classAttributes = classAttributes;
+        m_method2Attributes = method2Attributes;
+    }
+    
+    public AttributeInfo[] getClassAttributes()
+    {
+        return m_classAttributes;
+    }
+    
+    public AttributeInfo[] getAttributesForMethod( final Method method )
+    {
+        return (AttributeInfo[]) m_method2Attributes.get( method );
+    }
+}

Modified: excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/MetaInfoManager.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/MetaInfoManager.java	(original)
+++ excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/MetaInfoManager.java	Wed Jul  7 16:27:35 2004
@@ -55,4 +55,12 @@
      * @return the proper {@link MetaInfoEntry}
      */
     MetaInfoEntry getMetaInfoForClassname( String classname );
+    
+    /**
+     * Pending
+     * 
+     * @param classname
+     * @return
+     */
+    ExtendedMetaInfo getExtendedMetaInfo( String classname );
 }

Added: excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/attributes/AttributeInfo.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/attributes/AttributeInfo.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,47 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.attributes;
+
+import java.util.Map;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class AttributeInfo
+{
+    private final String m_name;
+    private final Map m_properties;
+    
+    public AttributeInfo( final String name, final Map properties )
+    {
+        m_name = name;
+        m_properties = properties;
+    }
+    
+    public String getName()
+    {
+        return m_name;
+    }
+
+    public Map getProperties()
+    {
+        return m_properties;
+    }
+}

Added: excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/Interceptor.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/Interceptor.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,36 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.interceptor;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public interface Interceptor
+{
+    void init( Interceptor next );
+    
+    Interceptor getNext();
+    
+    Object intercept( Object instance, Method method, Object[] args ) 
+        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException; 
+}

Added: excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/InterceptorManager.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/InterceptorManager.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,34 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.interceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public interface InterceptorManager
+{
+    void add( String family, String name, String interceptorClass ) throws InterceptorManagerException;
+    
+    void remove( String family, String name );
+    
+    Interceptor buildChain( String family ) throws IllegalAccessException, InstantiationException;
+    
+    String[] getFamilies();
+}

Added: excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/InterceptorManagerException.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-api/src/java/org/apache/avalon/fortress/interceptor/InterceptorManagerException.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,62 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.interceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class InterceptorManagerException extends Exception
+{
+    public InterceptorManagerException()
+    {
+        super();
+    }
+
+    /**
+     * Pending
+     * 
+     * @param message
+     */
+    public InterceptorManagerException(String message)
+    {
+        super(message);
+    }
+
+    /**
+     * Pending
+     * 
+     * @param cause
+     */
+    public InterceptorManagerException(Throwable cause)
+    {
+        super(cause);
+    }
+
+    /**
+     * Pending
+     * 
+     * @param message
+     * @param cause
+     */
+    public InterceptorManagerException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+}

Modified: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultContainer.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultContainer.java	(original)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultContainer.java	Wed Jul  7 16:27:35 2004
@@ -91,6 +91,7 @@
         throws ConfigurationException
     {
         interpretProxy( config.getAttribute("proxy-type", "discover") );
+        addHookComponents( config );
         addComponents( config );
     }
 
@@ -121,11 +122,22 @@
         }
     }
 
+    /**
+     * Allows implementations to register components before any 
+     * user component.
+     * 
+     * @param config Configuration representing the contents in xconf file
+     * @throws ConfigurationException
+     */
+    protected void addHookComponents(final Configuration config) throws ConfigurationException
+    {
+    }
+
 	/**
 	 * Iterates throught nodes, which represent components, adding the 
 	 * component/configuration data to container.
 	 * 
-	 * @param config Configuration representing the content in xconf file
+	 * @param config Configuration representing the contents in xconf file
 	 * @throws ConfigurationException
 	 */
 	protected void addComponents(final Configuration config) throws ConfigurationException
@@ -137,14 +149,8 @@
 			final Configuration element = elements[i];
 			final String hint = element.getAttribute( "id", null );
 			
-			if ( null == hint )
-			{
-				// Only components with an id attribute are treated as components.
-				getLogger().debug( "Ignoring configuration for component, " + element.getName()
-					+ ", because the id attribute is missing." );
-			}
-			else
-			{
+            if (isValidComponent( element, hint ))
+            {
 				final String classname = getClassname( element );
 				final int activation = getActivation( element );
 				final ComponentHandlerMetaData metaData =
@@ -161,6 +167,32 @@
 			}
 		}
 	}
+
+    /**
+     * Checks if the necessary information was included in the component configuration.
+     * In other words, whether it has a valid 'id' or not.
+     * 
+     * @param config Component configuration node
+     * @param id name
+     * @return true if the registration can proceed.
+     * @throws ConfigurationException
+     */
+    protected boolean isValidComponent( final Configuration config, final String id )
+        throws ConfigurationException
+    {
+        boolean isValid = true;
+        
+        if ( null == id )
+        {
+            // Only components with an id attribute are treated as components.
+            getLogger().debug( "Ignoring configuration for component, " + config.getName()
+                + ", because the id attribute is missing." );
+            
+            isValid = false;
+        }
+        
+        return isValid;
+    }
 
     /**
      * Retrieve the classname for component configuration.

Modified: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultEventManager.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultEventManager.java	(original)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultEventManager.java	Wed Jul  7 16:27:35 2004
@@ -29,7 +29,7 @@
 /**
  * Default implementation of EventManager
  * 
- * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Team</a>
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
  */
 public class DefaultEventManager implements EventManager
 {

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/InterceptorEnabledContainer.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/InterceptorEnabledContainer.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,145 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl;
+
+import org.apache.avalon.fortress.impl.interceptor.DefaultInterceptorManager;
+import org.apache.avalon.fortress.interceptor.InterceptorManager;
+import org.apache.avalon.fortress.util.CompositeException;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.avalon.framework.context.ContextException;
+
+/**
+ * InterceptorEnabledContainer extends the default container behavior
+ * adding interceptor capabilities to it.
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class InterceptorEnabledContainer extends DefaultContainer
+{
+    ///
+    /// Static fields
+    /// 
+    
+    private static final String INTERCEPTOR_CONFIG_NAME = "interceptorManager";
+
+    ///
+    /// Instance fields
+    /// 
+    
+    /**
+     * InterceptorManager configuration node.
+     */
+    private Configuration m_managerConfiguration;
+    
+    /**
+     * InterceptorManager instance per container.
+     */
+    private InterceptorManager m_manager;
+    
+    ///
+    /// Public implementation
+    /// 
+    
+    public InterceptorManager getInterceptorManager()
+    {
+        return m_manager;
+    }
+    
+    ///
+    /// DefaultContainer's overrides
+    /// 
+    
+    /**
+     * Avoid the registration of interceptorManager configuration node. 
+     * 
+     * @see org.apache.avalon.fortress.impl.DefaultContainer#isValidComponent(org.apache.avalon.framework.configuration.Configuration, java.lang.String)
+     */
+    protected boolean isValidComponent( final Configuration config, final String id )
+        throws ConfigurationException
+    {
+        String name = config.getName();
+            
+        if (INTERCEPTOR_CONFIG_NAME.equalsIgnoreCase( name ))
+        {
+            return false;
+        }
+        
+        return super.isValidComponent( config, id );
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.impl.DefaultContainer#addHookComponents(org.apache.avalon.framework.configuration.Configuration)
+     */
+    protected void addHookComponents(Configuration config) throws ConfigurationException
+    {
+        super.addHookComponents(config);
+        
+        m_managerConfiguration = config.getChild( INTERCEPTOR_CONFIG_NAME, true );
+        
+        try
+        {
+            createAndConfigureInterceptorManager();
+        }
+        catch(ContextException ex)
+        {
+            throw new ConfigurationException( "Error trying to configure interceptor manager.", ex );
+        }
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     */
+    public void initialize() throws CompositeException, Exception
+    {
+        ContainerUtil.initialize( m_manager );
+        
+        super.initialize();
+    }
+    
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
+    public void dispose()
+    {
+        ContainerUtil.dispose( m_manager );
+        super.dispose();
+    }
+    
+    ///
+    /// Virtual implementation
+    ///
+    
+    protected void createAndConfigureInterceptorManager() throws ContextException, ConfigurationException
+    {
+        InterceptorManager manager = createInterceptorManager();
+        ContainerUtil.configure( manager, m_managerConfiguration );
+    }
+    
+    protected InterceptorManager createInterceptorManager() throws ContextException
+    {
+        return new DefaultInterceptorManager( m_context );
+    }
+}

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/AbstractInterceptor.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/AbstractInterceptor.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,64 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.avalon.fortress.interceptor.Interceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public abstract class AbstractInterceptor implements Interceptor
+{
+    private Interceptor m_next;
+    
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.Interceptor#getNext()
+     */
+    public Interceptor getNext()
+    {
+        return m_next;
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.Interceptor#init(org.apache.avalon.fortress.interceptor.Interceptor)
+     */
+    public void init(Interceptor next)
+    {
+        m_next = next;
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.Interceptor#intercept(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+     */
+    public Object intercept(Object instance, Method method, Object[] args)
+        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
+    {
+        return getNext().intercept( instance, method, args );
+    }
+}

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/ComponentFamily.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/ComponentFamily.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,217 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.avalon.fortress.interceptor.Interceptor;
+import org.apache.avalon.fortress.interceptor.InterceptorManagerException;
+
+/**
+ * Holds a interceptor chain for a specific component family.
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class ComponentFamily
+{
+    /**
+     * Family name (debug purpose)
+     */
+    private final String m_familyName;
+    
+    /**
+     * Maps interceptor name to InterceptorHolder instance 
+     */
+    private final Map m_name2Interceptor;
+
+    /**
+     * Used to determine the order of new interception definitions.
+     */
+    private int m_interceptorsCount;
+    
+    ///
+    /// Constructors
+    /// 
+    
+    /**
+     * Constructs a ComponentFamily instance.
+     */
+    public ComponentFamily( final String family )
+    {
+        m_name2Interceptor = new TreeMap( String.CASE_INSENSITIVE_ORDER );
+        m_interceptorsCount = 0;
+        
+        m_familyName = family;
+    }
+
+    ///
+    /// Public implementation
+    /// 
+    
+    /**
+     * Adds an interceptor definition. 
+     * The inclusion order is very import as it
+     * will determine the order of the interceptor chain.
+     * 
+     * @param interceptorName interceptor's id
+     * @param interceptorClassName full class name (must implement the Interceptor interface)
+     * @throws InterceptorManagerException if doesn't implements the Interceptor interface
+     * @throws ClassNotFoundException if class could not be found (using the getContextClassLoader)
+     */
+    public void add( final String interceptorName, final String interceptorClassName )
+        throws InterceptorManagerException, ClassNotFoundException
+    {
+        Class interceptorClass = obtainClass( interceptorClassName );
+        
+        if (!Interceptor.class.isAssignableFrom( interceptorClass ))
+        {
+            throw new InterceptorManagerException( 
+                "Interceptor class specified doesn't implements the Interceptor interface." );
+        }
+        
+        InterceptorHolder holder = null;
+        
+        if (!m_name2Interceptor.containsKey(interceptorName))
+        {
+            holder = new InterceptorHolder( interceptorClass, ++m_interceptorsCount );
+        }
+        else
+        {
+            InterceptorHolder oldHolder = (InterceptorHolder) m_name2Interceptor.remove( interceptorName );
+            holder = new InterceptorHolder( interceptorClass, oldHolder.getOrder() );
+        }
+
+        m_name2Interceptor.put( interceptorName, holder );
+    }
+
+    /**
+     * Removes an interception definition.
+     * 
+     * @param interceptorName interceptor's id
+     */
+    public void remove( final String interceptorName )
+    {
+        // We should not decrement the m_interceptorsCount as it is used 
+        // only as a hint to compose the interceptor chain's order.
+
+        m_name2Interceptor.remove( interceptorName );
+    }
+    
+    /**
+     * Returns the quantity of valid interceptors 
+     * registered at the moment.
+     */
+    public int interceptorsCount()
+    {
+        return m_name2Interceptor.size();
+    }
+    
+    /**
+     * Returns the family name.
+     */
+    public String getFamilyName()
+    {
+        return m_familyName;
+    }
+    
+    /**
+     * Returns an array of Interceptors. The instances are not 
+     * ready to use, they need to be connected throught the 'init(next)'. 
+     * 
+     * @return
+     */
+    public Interceptor[] buildOrderedChain() throws IllegalAccessException, InstantiationException
+    {
+        InterceptorHolder[] holders = (InterceptorHolder[])
+            m_name2Interceptor.values().toArray( new InterceptorHolder[0] );
+
+        Arrays.sort( holders, new Comparator()
+        {
+            public boolean equals(Object obj)
+            {
+                return false;
+            }
+
+            public int compare(Object o1, Object o2)
+            {
+                InterceptorHolder h1 = (InterceptorHolder) o1;
+                InterceptorHolder h2 = (InterceptorHolder) o2; 
+                return h2.getOrder() - h1.getOrder();
+            }
+        } );
+        
+        Interceptor[] interceptors = new Interceptor[ holders.length ];
+        
+        for (int i = 0; i < holders.length; i++)
+        {
+            InterceptorHolder holder = holders[i];
+            interceptors[ i ] = (Interceptor) holder.getInterceptor().newInstance();
+        }
+        
+        return interceptors;
+    }
+
+    /**
+     * Returns a friendly description of this object.
+     */
+    public String toString()
+    {
+        return "ComponentFamily [ " + m_familyName + " ] ";
+    }
+
+    /**
+     * Use the Context ClassLoader to load the specified class.
+     * 
+     * @param className
+     * @return
+     * @throws ClassNotFoundException
+     */    
+    protected Class obtainClass( final String className ) throws ClassNotFoundException
+    {
+        return Thread.currentThread().getContextClassLoader().loadClass( className );
+    }
+
+    /**
+     * Helper class to keep hold an interceptor class and the 
+     * order it should fill in the chain.
+     */
+    private static class InterceptorHolder
+    { 
+        private final Class m_interceptor;
+        private final int m_order;
+        
+        public InterceptorHolder( Class interceptor, int order )
+        {
+            m_order = order;
+            m_interceptor = interceptor;
+        }
+        
+        public Class getInterceptor()
+        {
+            return m_interceptor;
+        }
+
+        public int getOrder()
+        {
+            return m_order;
+        }
+    }
+}

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/DefaultInterceptorManager.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/DefaultInterceptorManager.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,289 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.avalon.fortress.Container;
+import org.apache.avalon.fortress.ContainerListener;
+import org.apache.avalon.fortress.MetaInfoEntry;
+import org.apache.avalon.fortress.interceptor.Interceptor;
+import org.apache.avalon.fortress.interceptor.InterceptorManager;
+import org.apache.avalon.fortress.interceptor.InterceptorManagerException;
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+
+/**
+ * Default (and simple) implementation of InterceptorManager capability.
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class DefaultInterceptorManager
+    implements InterceptorManager, Configurable, Contextualizable, Initializable, ContainerListener
+{
+    ///
+    /// Instance fields
+    ///
+
+    private Container m_container;
+    
+    private final Map m_families;
+
+    ///
+    /// Constructors
+    ///
+    
+    public DefaultInterceptorManager()
+    {
+        m_families = new TreeMap( String.CASE_INSENSITIVE_ORDER );
+    }
+
+    public DefaultInterceptorManager( Context context ) throws ContextException
+    {
+        this();
+        contextualize( context );
+    }
+
+    public DefaultInterceptorManager( Context context, Configuration config ) throws ContextException, ConfigurationException
+    {
+        this( context );
+        configure( config );
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
+     */
+    public void contextualize(Context context) throws ContextException
+    {
+        m_container = (Container) context.get("container");
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+     */
+    public void configure(final Configuration config) throws ConfigurationException
+    {
+        final Configuration[] sets = config.getChildren("set");
+        
+        for (int i = 0; i < sets.length; i++)
+        {
+            final Configuration set = sets[i];
+            final String familyName = set.getAttribute("family", "");
+            
+            if ( "".equals(familyName) )
+            {
+                throw new ConfigurationException("Element 'set' must " +
                    "specify a valid 'family' attribute.");
+            }
+            
+            Configuration[] interceptors = set.getChildren("interceptor");
+            
+            for (int j = 0; j < interceptors.length; j++)
+            {
+                final Configuration interceptor = interceptors[j];
+                final String key = interceptor.getAttribute("name", "");
+                final String clazz = interceptor.getAttribute("class", "");
+                
+                if ( "".equals(key) || "".equals(clazz) )
+                {
+                    throw new ConfigurationException("Element 'interceptor' must " +
                        "specify 'name' and 'class' attributes.");
+                }
+                
+                try
+                {
+                    add( familyName, key, clazz );
+                }
+                catch(InterceptorManagerException ex)
+                {
+                    throw new ConfigurationException("Invalid interceptor entry", ex);
+                }
+            }
+        }
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     */
+    public void initialize() throws Exception
+    {
+        m_container.getEventManager().addListener(this);
+    }
+
+    ///
+    /// ContainerListener implementation
+    /// 
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.ContainerListener#componentCreated(org.apache.avalon.fortress.MetaInfoEntry, java.lang.Object)
+     */
+    public Object componentCreated( final MetaInfoEntry entry, final Object instance )
+    {
+        return instance;
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.ContainerListener#componentDestroyed(org.apache.avalon.fortress.MetaInfoEntry, java.lang.Object)
+     */
+    public void componentDestroyed( final MetaInfoEntry entry, final Object instance )
+    {
+    }
+    
+    ///
+    /// InterceptorManager implementation
+    ///
+    
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.InterceptorManager#add(java.lang.String, java.lang.String, java.lang.String)
+     */
+    public void add( final String family, final String name, final String interceptorClass ) 
+        throws InterceptorManagerException
+    {
+        try
+        {
+            ComponentFamily componentFamily = obtainFamily( family );
+            componentFamily.add( name, interceptorClass );
+        
+            m_families.put( family, componentFamily );
+        }
+        catch(ClassNotFoundException ex)
+        {
+            throw new InterceptorManagerException( "Could not find class specified.", ex );
+        }
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.InterceptorManager#remove(java.lang.String, java.lang.String)
+     */
+    public void remove( final String family, final String name )
+    {
+        ComponentFamily componentFamily = obtainFamily( family );
+        componentFamily.remove( name );
+        removeIfEmpty( componentFamily );
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.InterceptorManager#buildChain(java.lang.String)
+     */
+    public Interceptor buildChain( final String family ) throws IllegalAccessException, InstantiationException
+    {
+        ComponentFamily componentFamily = obtainFamily( family );
+        Interceptor[] interceptors = componentFamily.buildOrderedChain();
+        return assemble( interceptors );
+    }
+
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.interceptor.InterceptorManager#getFamilies()
+     */
+    public String[] getFamilies()
+    {
+        return (String[]) m_families.keySet().toArray( new String[0] );
+    }
+    
+    ///
+    /// Overrideable Implementation
+    ///
+    
+    /**
+     * Connects the interceptors throught the init(next), adds
+     * the tail interceptor to execute the real invocation 
+     * and returns the first interceptor.
+     * 
+     * @param interceptors raw array of interceptor instances.
+     */
+    protected Interceptor assemble( final Interceptor[] interceptors )
+    {
+        Interceptor tail = createTailInterceptor( interceptors );
+        
+        for (int i = interceptors.length; i >= 0; i--)
+        {
+            Interceptor last = interceptors[i];
+            last.init( tail );
+            tail = last;
+        }
+        
+        return tail;
+    }
+    
+    /**
+     * Returns the last interceptor on the chain. The interceptor manager
+     * must provide the last interceptor to guarantee the real execution of the method, 
+     * although it doesn't necessarily needs to be execute. The chain can 
+     * determine when the actual execution will be performed using its own criteria. 
+     * 
+     * @param interceptors raw array of interceptor instances.
+     * @return
+     */
+    protected Interceptor createTailInterceptor( final Interceptor[] interceptors )
+    {
+        return new TailInterceptor();
+    }
+    
+    ///
+    /// Private implementation
+    ///
+
+    private void removeIfEmpty( final ComponentFamily componentFamily )
+    {
+        synchronized( m_families )
+        {
+            if (componentFamily.interceptorsCount() == 0)
+            {
+                m_families.remove( componentFamily.getFamilyName() );
+            }
+        }
+    }
+    
+    private ComponentFamily obtainFamily( final String family )
+    {
+        synchronized( m_families )
+        {
+            ComponentFamily componentFamily = (ComponentFamily) m_families.get( family );
+            
+            if (componentFamily == null)
+            {
+                componentFamily = new ComponentFamily( family );
+                m_families.put( family, componentFamily );
+            }
+
+            return componentFamily;
+        }
+    }
+}

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/InterceptableFactory.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/InterceptableFactory.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,31 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor;
+
+import org.apache.avalon.fortress.interceptor.Interceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public interface InterceptableFactory
+{
+    Object createInterceptableInstance( Object realInstance, /*ClassMetaData meta,*/ 
+        Class[] interfaces, Interceptor chain );
+}

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/TailInterceptor.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/TailInterceptor.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,38 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * The tail interceptor delegates the call to the object.
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class TailInterceptor extends AbstractInterceptor
+{
+    /**
+     * Simply invokes the method on the instance.
+     */
+    public Object intercept(Object instance, Method method, Object[] args)
+        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
+    {
+        return method.invoke( instance, args );
+    }
+}

Added: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/simple/SimpleInterceptableFactory.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/interceptor/strategies/simple/SimpleInterceptableFactory.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,66 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.strategies.simple;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.apache.avalon.fortress.impl.interceptor.InterceptableFactory;
+import org.apache.avalon.fortress.interceptor.Interceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class SimpleInterceptableFactory implements InterceptableFactory
+{
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.impl.interceptor.InterceptableFactory#createInterceptableInstance(java.lang.Object, org.apache.avalon.fortress.interceptor.Interceptor)
+     */
+    public Object createInterceptableInstance(Object realInstance, Class[] interfaces, Interceptor chain)
+    {
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        return Proxy.newProxyInstance( loader, interfaces, new InterceptorInvocationHandler( realInstance, chain ) );
+    }
+    
+    public static class InterceptorInvocationHandler implements InvocationHandler
+    {
+        private final Object m_instance;
+        private final Interceptor m_chain;
+        
+        public InterceptorInvocationHandler( Object instance, Interceptor chain )
+        {
+            m_instance = instance;
+            m_chain = chain;
+        }
+        
+        /**
+         * Pending
+         * 
+         * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+         */
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+        {
+            return m_chain.intercept( m_instance, method, args );
+        }
+    }
+}

Modified: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/AbstractMetaInfoManager.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/AbstractMetaInfoManager.java	(original)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/AbstractMetaInfoManager.java	Wed Jul  7 16:27:35 2004
@@ -17,11 +17,14 @@
 
 package org.apache.avalon.fortress.impl.role;
 
+import org.apache.avalon.fortress.ExtendedMetaInfo;
 import org.apache.avalon.fortress.MetaInfoEntry;
 import org.apache.avalon.fortress.MetaInfoManager;
 import org.apache.avalon.fortress.RoleManager;
+import org.apache.avalon.fortress.attributes.AttributeInfo;
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -35,6 +38,8 @@
  */
 public abstract class AbstractMetaInfoManager extends AbstractLogEnabled implements MetaInfoManager
 {
+    protected final static ExtendedMetaInfo EMPTY_EXTENDED_META_INFO;
+    
     /**
      * The classloader used to load and check roles and components.
      */
@@ -55,6 +60,11 @@
      */
     private final MetaInfoManager m_parent;
 
+    static
+    {
+        EMPTY_EXTENDED_META_INFO = new ExtendedMetaInfo( new AttributeInfo[0], Collections.EMPTY_MAP );
+    }
+
     /**
      * Default constructor--this RoleManager has no parent.
      */
@@ -184,6 +194,16 @@
         {
             return null;
         }
+    }
+    
+    /**
+     * Pending
+     * 
+     * @see org.apache.avalon.fortress.MetaInfoManager#getExtendedMetaInfo(java.lang.String)
+     */
+    public ExtendedMetaInfo getExtendedMetaInfo( final String classname )
+    {
+        return EMPTY_EXTENDED_META_INFO;
     }
 
     /**

Modified: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ECMMetaInfoManager.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ECMMetaInfoManager.java	(original)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ECMMetaInfoManager.java	Wed Jul  7 16:27:35 2004
@@ -31,7 +31,6 @@
  */
 public final class ECMMetaInfoManager extends AbstractMetaInfoManager
 {
-
     /**
      * Create a ECMMetaInfoManager.
      */
@@ -92,6 +91,5 @@
         props.setProperty("x-avalon.lifestyle", lifestyle); 
         props.setProperty("x-avalon.name", role + '/' + hint);
         super.addComponent(role, className, props, new ArrayList());
-        
     }
 }

Modified: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/FortressRoleManager.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/FortressRoleManager.java	(original)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/FortressRoleManager.java	Wed Jul  7 16:27:35 2004
@@ -27,7 +27,7 @@
  * @version CVS $Revision: 1.11 $ $Date: 2004/02/28 15:16:25 $
  */
 public final class FortressRoleManager
-    extends org.apache.avalon.fortress.impl.role.AbstractRoleManager
+    extends AbstractRoleManager
     implements Initializable
 {
     /**

Modified: excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ServiceMetaManager.java
==============================================================================
--- excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ServiceMetaManager.java	(original)
+++ excalibur/branches/fortress-experiments/container-impl/src/java/org/apache/avalon/fortress/impl/role/ServiceMetaManager.java	Wed Jul  7 16:27:35 2004
@@ -17,8 +17,11 @@
 
 package org.apache.avalon.fortress.impl.role;
 
+import org.apache.avalon.fortress.ExtendedMetaInfo;
+import org.apache.avalon.fortress.MetaInfoEntry;
 import org.apache.avalon.fortress.MetaInfoManager;
 import org.apache.avalon.fortress.RoleManager;
+import org.apache.avalon.fortress.attributes.AttributeInfo;
 import org.apache.avalon.fortress.util.Service;
 import org.apache.avalon.framework.activity.Initializable;
 
@@ -81,6 +84,18 @@
  */
 public final class ServiceMetaManager extends AbstractMetaInfoManager implements Initializable
 {
+
+        /**
+         * Pending
+         * 
+         * @param stream
+         * @param entry
+         */
+        public static void buildExtendedMeta(InputStream stream, MetaInfoEntry entry)
+        {
+            // TODO Auto-generated method stub
+            
+        }
     /**
      * Create a ServiceMetaManager.
      */
@@ -121,6 +136,11 @@
         super( parent, loader );
     }
 
+    public ExtendedMetaInfo getExtendedMetaInfo( final String classname )
+    {
+        return EMPTY_EXTENDED_META_INFO;
+    }
+    
     /**
      * Initialize the ServiceMetaManager by looking at all the services and
      * classes available in the system.
@@ -161,7 +181,7 @@
      *
      * @throws ClassNotFoundException if the role or component cannot be found
      */
-    private void setupImplementations( final String role )
+    protected void setupImplementations( final String role )
         throws ClassNotFoundException
     {
         final Iterator it = Service.providers( getLoader().loadClass( role ), getLoader() );
@@ -173,6 +193,7 @@
             if ( ! isAlreadyAdded( impl ) )
             {
                 readMeta( role, impl );
+                readExtendedMeta( role, impl );
             }
             else
             {
@@ -188,7 +209,7 @@
      * @param role
      * @param implementation
      */
-    private void readMeta( final String role, final String implementation )
+    protected void readMeta( final String role, final String implementation )
     {
         final Properties meta = new Properties();
         final List deps = new ArrayList();
@@ -210,6 +231,8 @@
                 );
                 return;
             }
+            
+            stream.close();
         }
         catch ( IOException ioe )
         {
@@ -246,6 +269,33 @@
     }
 
     /**
+     * Read the meta information in and actually add the role.
+     *
+     * @param role
+     * @param implementation
+     */
+    protected void readExtendedMeta( final String role, final String implementation )
+    {
+        try
+        {
+            final InputStream stream =
+                getLoader().getResourceAsStream( getAttributesFile( implementation ) );
+
+            MetaInfoEntry entry = getMetaInfoForClassname( implementation );
+            
+            AttributeDigester.buildExtendedMeta( stream, entry );
+            
+            stream.close();
+        }
+        catch ( IOException ioe )
+        {
+            getLogger().error( "Could not load meta information for " +
+                implementation + ", skipping this class." );
+            return;
+        }
+    }
+    
+    /**
      * Translate a class name into the meta file name.
      *
      * @param implementation
@@ -259,6 +309,19 @@
     }
 
     /**
+     * Translate a class name into the attributes file name.
+     *
+     * @param implementation
+     * @return String
+     */
+    private String getAttributesFile( final String implementation )
+    {
+        String entry = implementation.replace( '.', '/' );
+        entry += ".attrs";
+        return entry;
+    }
+
+    /**
      * Translate a class name into the meta file name.
      *
      * @param implementation
@@ -296,6 +359,113 @@
         finally
         {
             reader.close();
+        }
+    }
+    
+    public static class AttributeDigester 
+    {
+        /**
+         * Pending
+         * 
+         * @param stream
+         * @param entry
+         */
+        public static ExtendedMetaInfo buildExtendedMeta(InputStream stream, MetaInfoEntry entry)
+            throws IOException
+        {
+            ExtendedMetaInfo metaInfo = null;
+            
+            final BufferedReader reader = new BufferedReader( new InputStreamReader( stream ) );
+            
+            final List classAttrs = new ArrayList();
+            final Map method2Attributes = new HashMap();
+            
+            String line = null;
+            while( ( line = reader.readLine() ) != null )
+            {
+                if (line.length() == 0)
+                {
+                    continue;
+                }
+                
+                if (line.charAt(0) != '{')
+                {
+                    classAttrs.add( buildClassAttribute( line, entry ) );
+                }
+                else
+                {
+                    buildMethodAttribute( line, entry );
+                }
+            }
+            
+            AttributeInfo[] classAttributes = (AttributeInfo[]) 
+                classAttrs.toArray( new AttributeInfo[0] );
+            
+            metaInfo = new ExtendedMetaInfo( classAttributes, methodAttributes );
+            
+            reader.close(); 
+        }
+
+        private static AttributeInfo buildMethodAttribute( final String line, final MetaInfoEntry entry )
+        {
+            final Map mapProperties = new TreeMap( String.CASE_INSENSITIVE_ORDER ); 
+
+            int propInitIndex = line.indexOf( '[' );
+            int propEndIndex  = line.indexOf( ']' );
+
+            final String attName = line.substring(0, propInitIndex - 1);
+            final String properties = line.substring(propInitIndex, propEndIndex - 1).trim();
+            
+            StringTokenizer tokenizer = new StringTokenizer( properties, "," );
+            while(tokenizer.hasMoreTokens())
+            {
+                final String property =  tokenizer.nextToken();
+                final int equalIndex = property.indexOf( '=' );
+                
+                String key = property;
+                String value = "";
+                
+                if ( equalIndex != -1 )
+                {
+                    key = property.substring( 0, equalIndex );
+                    value = property.substring( equalIndex + 1 );
+                }
+
+                mapProperties.put( key, value );
+            }
+            
+            return new AttributeInfo( attName, mapProperties );
+        }
+
+        private static AttributeInfo buildClassAttribute( final String line, final MetaInfoEntry entry )
+        {
+            final Map mapProperties = new TreeMap( String.CASE_INSENSITIVE_ORDER ); 
+
+            int propInitIndex = line.indexOf( '[' );
+            int propEndIndex  = line.indexOf( ']' );
+
+            final String attName = line.substring(0, propInitIndex - 1);
+            final String properties = line.substring(propInitIndex, propEndIndex - 1).trim();
+            
+            StringTokenizer tokenizer = new StringTokenizer( properties, "," );
+            while(tokenizer.hasMoreTokens())
+            {
+                final String property =  tokenizer.nextToken();
+                final int equalIndex = property.indexOf( '=' );
+                
+                String key = property;
+                String value = "";
+                
+                if ( equalIndex != -1 )
+                {
+                    key = property.substring( 0, equalIndex );
+                    value = property.substring( equalIndex + 1 );
+                }
+
+                mapProperties.put( key, value );
+            }
+            
+            return new AttributeInfo( attName, mapProperties );
         }
     }
 }

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/ComponentFamilyTestCase.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/ComponentFamilyTestCase.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,131 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test;
+
+import org.apache.avalon.fortress.impl.interceptor.ComponentFamily;
+import org.apache.avalon.fortress.impl.interceptor.test.examples.AnotherValidInterceptor;
+import org.apache.avalon.fortress.impl.interceptor.test.examples.InvalidInterceptor;
+import org.apache.avalon.fortress.impl.interceptor.test.examples.ValidInterceptor;
+import org.apache.avalon.fortress.interceptor.Interceptor;
+import org.apache.avalon.fortress.interceptor.InterceptorManagerException;
+
+import junit.framework.TestCase;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class ComponentFamilyTestCase extends TestCase
+{
+    private ComponentFamily m_family;
+    
+    /**
+     * Constructor for ComponentFamilyTestCase.
+     * @param name
+     */
+    public ComponentFamilyTestCase(String name)
+    {
+        super(name);
+    }
+
+    /*
+     * @see TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        
+        m_family = new ComponentFamily( "Simpsons" );
+    }
+
+    public void testAdd() throws Exception
+    {
+        m_family.add( "key", ValidInterceptor.class.getName() );
+        assertEquals( 1, m_family.interceptorsCount() );
+    }
+
+    public void testAddClassNotImplementingInterceptorInterface() throws Exception
+    {
+        try
+        {
+            m_family.add( "key", InvalidInterceptor.class.getName() );
+            fail( "Should not allow to register an invalid class" );
+        }
+        catch(InterceptorManagerException ex)
+        {
+            // Expected
+        }
+        
+        assertEquals( 0, m_family.interceptorsCount() );
+    }
+
+    public void testAddInvalidClass() throws Exception
+    {
+        try
+        {
+            m_family.add( "key", "org.apache.avalon.fortress.impl.interceptor.test.examples.HomerInterceptor" );
+            fail( "Should not allow to register an invalid class" );
+        }
+        catch(ClassNotFoundException ex)
+        {
+            // Expected
+        }
+        
+        assertEquals( 0, m_family.interceptorsCount() );
+    }
+
+    public void testRemove() throws Exception
+    {
+        testAdd();
+        m_family.remove( "key" );
+        assertEquals( 0, m_family.interceptorsCount() );
+    }
+
+    public void testBuildOrderedChain() throws Exception
+    {
+        testAdd();
+        Interceptor[] interceptors = m_family.buildOrderedChain();
+        
+        assertNotNull( interceptors );
+        assertEquals( 1, interceptors.length );
+        assertNull( interceptors[0].getNext() );
+    }
+
+    public void testBuildOrderedChainWithAnotherSetup() throws Exception
+    {
+        m_family.add( "key1", ValidInterceptor.class.getName() );
+        m_family.add( "key2", AnotherValidInterceptor.class.getName() );
+        m_family.remove( "key1" ); 
+        m_family.add( "key1", ValidInterceptor.class.getName() );
+        m_family.add( "key1", ValidInterceptor.class.getName() );
+
+        Interceptor[] interceptors = m_family.buildOrderedChain();
+        
+        assertNotNull( interceptors );
+        assertEquals( 2, interceptors.length );
+        assertNull( interceptors[0].getNext() );
+        assertEquals( ValidInterceptor.class, interceptors[0].getClass() );
+        assertEquals( AnotherValidInterceptor.class, interceptors[1].getClass() );
+    }
+
+    public void testToString()
+    {
+        assertEquals( "ComponentFamily [ Simpsons ] ", m_family.toString() );
+    }
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/DefaultInterceptorManagerTestCase.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/DefaultInterceptorManagerTestCase.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,120 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test;
+
+import org.apache.avalon.fortress.ContainerManager;
+import org.apache.avalon.fortress.impl.DefaultContainerManager;
+import org.apache.avalon.fortress.impl.InterceptorEnabledContainer;
+import org.apache.avalon.fortress.impl.interceptor.TailInterceptor;
+import org.apache.avalon.fortress.impl.interceptor.test.examples.ValidInterceptor;
+import org.apache.avalon.fortress.interceptor.Interceptor;
+import org.apache.avalon.fortress.interceptor.InterceptorManager;
+import org.apache.avalon.fortress.util.FortressConfig;
+import org.apache.avalon.framework.container.ContainerUtil;
+
+import junit.framework.TestCase;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class DefaultInterceptorManagerTestCase extends TestCase
+{
+    private InterceptorEnabledContainer m_container;
+    private InterceptorManager m_interManager;
+    
+    /**
+     * Constructor for DefaultInterceptorManagerTestCase.
+     * @param name
+     */
+    public DefaultInterceptorManagerTestCase(String name)
+    {
+        super(name);
+    }
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        
+        m_container = createContainer();
+        m_interManager = m_container.getInterceptorManager();
+    }
+
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        
+        m_container.dispose();
+    }
+
+    public void testAddInterceptor() throws Exception
+    {
+        m_interManager.add( "dao", "key", ValidInterceptor.class.getName() );
+        String[] families = m_interManager.getFamilies();
+        
+        assertNotNull( families );
+        assertEquals( 1, families.length );
+        assertEquals( "dao", families[0] );
+    }
+
+    public void testRemoveInterceptor() throws Exception
+    {
+        testAddInterceptor();
+        
+        m_interManager.remove( "dao", "key" );
+        String[] families = m_interManager.getFamilies();
+        
+        assertNotNull( families );
+        assertEquals( 0, families.length );
+    }
+
+    public void testChain() throws Exception
+    {
+        testAddInterceptor();
+        
+        Interceptor interceptor = m_interManager.buildChain( "dao" );
+        assertNotNull( interceptor );
+        assertEquals( ValidInterceptor.class, interceptor.getClass() );
+        assertNotNull( interceptor.getNext() );
+        
+        // Setting the next 
+        
+        interceptor = interceptor.getNext();
+        assertNotNull( interceptor );
+        assertEquals( TailInterceptor.class, interceptor.getClass() );
+        assertNull( interceptor.getNext() );
+    }
+
+    private InterceptorEnabledContainer createContainer() throws Exception
+    {
+        final FortressConfig config = new FortressConfig();
+        config.setContainerClass( InterceptorEnabledContainer.class );
+        config.setContextDirectory( "./" );
+        config.setWorkDirectory( "./" );
+        
+        final String BASE = "resource://org/apache/avalon/fortress/impl/interceptor/test/components/";
+        config.setContainerConfiguration( BASE + "test1.xconf" );
+        config.setLoggerManagerConfiguration( BASE + "test1.xlog" );
+
+        final ContainerManager cm = new DefaultContainerManager( config.getContext() );
+        ContainerUtil.initialize( cm );
+
+        return (InterceptorEnabledContainer) cm.getContainer();
+    }
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/CustomerDAOImpl.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/CustomerDAOImpl.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,37 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test.components;
+
+/**
+ * @avalon.component
+ * @avalon.service type=CustomerDataAccessObject
+ * @x-avalon.lifestyle type=singleton
+ * @x-avalon.info name=customerDAO
+ * @excalibur.interceptable family=DAO
+ *
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class CustomerDAOImpl implements CustomerDataAccessObject
+{
+    /**
+     * @excalibur.transaction required
+     */
+    public void save( final Object data )
+    {
+    }
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/CustomerDataAccessObject.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/CustomerDataAccessObject.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,28 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test.components;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public interface CustomerDataAccessObject extends DataAccessObject
+{
+    
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/DataAccessObject.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/DataAccessObject.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,28 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test.components;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public interface DataAccessObject
+{
+    void save( Object data );
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/test1.xconf
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/test1.xconf	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,22 @@
+<!-- 
+Copyright 2004 The Apache Software Foundation
+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.
+-->
+<test>
+    <component1 id="customerDAO"
+        logger="customerDAO"
+        activation="lazy"/>
+</test>
+

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/test1.xlog
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/components/test1.xlog	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,39 @@
+<!-- 
+Copyright 2003-2004 The Apache Software Foundation
+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.
+-->
+<logkit>
+    <factories>
+        <factory type="file" class="org.apache.avalon.excalibur.logger.factory.FileTargetFactory"/>
+    </factories>
+
+    <targets>
+        <file id="root">
+            <filename>container-test.log</filename>
+            <format type="extended">
+            %7.7{priority} %5.5{time}   [%8.8{category}] (%{context}): %{message}\n%{throwable}
+        </format>
+        </file>
+    </targets>
+
+    <categories>
+        <category name="fortress" log-level="DEBUG">
+            <log-target id-ref="root"/>
+        </category>
+        <category name="" log-level="DEBUG">
+            <log-target id-ref="root"/>
+        </category>
+    </categories>
+</logkit>

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/AnotherValidInterceptor.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/AnotherValidInterceptor.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,30 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test.examples;
+
+import org.apache.avalon.fortress.impl.interceptor.AbstractInterceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class AnotherValidInterceptor extends AbstractInterceptor
+{
+
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/InvalidInterceptor.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/InvalidInterceptor.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,28 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test.examples;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class InvalidInterceptor
+{
+
+}

Added: excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/ValidInterceptor.java
==============================================================================
--- (empty file)
+++ excalibur/branches/fortress-experiments/container-test/src/test/org/apache/avalon/fortress/impl/interceptor/test/examples/ValidInterceptor.java	Wed Jul  7 16:27:35 2004
@@ -0,0 +1,29 @@
+/* 
+ * Copyright 2004 The Apache Software Foundation
+ * 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 org.apache.avalon.fortress.impl.interceptor.test.examples;
+
+import org.apache.avalon.fortress.impl.interceptor.AbstractInterceptor;
+
+/**
+ * Pending
+ * 
+ * @author <a href="mailto:dev@excalibur.apache.org">Excalibur Development Team</a>
+ */
+public class ValidInterceptor extends AbstractInterceptor
+{
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org