incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r1022251 - in /incubator/aries/sandbox/jbohn/interceptor-proto: application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/ application/application-modeller/src/test/java/org/apache/aries/application/modelling/...
Date Wed, 13 Oct 2010 19:28:22 GMT
Author: jbohn
Date: Wed Oct 13 19:28:20 2010
New Revision: 1022251

URL: http://svn.apache.org/viewvc?rev=1022251&view=rev
Log:
ARIES-420 Some initial changes to register bean interceptors as services and use service references to locate them when constructing the bean proxy - also increase service lookup timeouts so there are fewer failures in the tests on slower machines

Added:
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java   (with props)
Modified:
    incubator/aries/sandbox/jbohn/interceptor-proto/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/application/application-modeller/src/test/java/org/apache/aries/application/modelling/impl/ParserProxyImplTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/Interceptor.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/Parser.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractMultiBundleTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/QuiesceBlueprintTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/TestConfigAdmin.java
    incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
    incubator/aries/sandbox/jbohn/interceptor-proto/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/QuiesceJPATest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-itests/src/test/java/org/apache/aries/spifly/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/pom.xml
    incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
    incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
    incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml
    incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
    incubator/aries/sandbox/jbohn/interceptor-proto/web/web-itests/src/test/java/org/apache/aries/web/converter/itest/WabConverterITest.java

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -47,7 +47,7 @@ import org.osgi.util.tracker.ServiceTrac
 @RunWith(JUnit4TestRunner.class)
 public class AbstractIntegrationTest {
 
-  public static final long DEFAULT_TIMEOUT = 30000;
+  public static final long DEFAULT_TIMEOUT = 60000;
 
   @Inject
   protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/application/application-modeller/src/test/java/org/apache/aries/application/modelling/impl/ParserProxyImplTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/application/application-modeller/src/test/java/org/apache/aries/application/modelling/impl/ParserProxyImplTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/application/application-modeller/src/test/java/org/apache/aries/application/modelling/impl/ParserProxyImplTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/application/application-modeller/src/test/java/org/apache/aries/application/modelling/impl/ParserProxyImplTest.java Wed Oct 13 19:28:20 2010
@@ -87,7 +87,7 @@ public class ParserProxyImplTest {
     urls.add ((bp2Xml.toURI()).toURL());
     
     List<? extends WrappedServiceMetadata> results = _parserProxy.parse(urls);
-    assertTrue ("Four results expected, not " + results.size(), results.size() == 4);
+    assertTrue ("Five results expected, not " + results.size(), results.size() == 5);
     
     Set<WrappedServiceMetadata> resultSet = new HashSet<WrappedServiceMetadata>(results);
     Set<WrappedServiceMetadata> expectedResults = getTest1ExpectedResults();
@@ -192,6 +192,10 @@ public class ParserProxyImplTest {
   private Set<WrappedServiceMetadata> getTest1ExpectedResults() { 
     Set<WrappedServiceMetadata> expectedResults = new HashSet<WrappedServiceMetadata>();
     Map<String, Object> props = new HashMap<String, Object>();
+    props.put("osgi.service.blueprint.compname", "namedInnerBean");
+    expectedResults.add(_modellingManager.getExportedService("namedInnerBean", 0, Arrays.asList("foo.bar.NamedInnerBeanService"), props));
+
+    props = new HashMap<String, Object>();
     props.put ("priority", "9");
     props.put("volume", "11");
     props.put("osgi.service.blueprint.compname", "myBean");

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -56,7 +56,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 public abstract class AbstractIntegrationTest {
 
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
 
     private List<ServiceTracker> srs;
 

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/Interceptor.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/Interceptor.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/Interceptor.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/Interceptor.java Wed Oct 13 19:28:20 2010
@@ -65,4 +65,14 @@ public interface Interceptor {
      * @return the rank of the interceptor
      */
     public int getRank();
+    
+    /**
+     * Return an identity for this interceptor.  For most interceptors that are introduced by custom namespace handlers 
+     * this will be the namespace uri.  For other interceptors it should be some relatively unique itendentity to 
+     * distringuish this interceptor from other interceptors.  The identity is used to guarantee uniqueness when 
+     * dynamically registering an interceptor for a bean or service.  
+     * 
+     * @return the identity of the interceptor
+     */
+    public String getIdentity();
 }

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java Wed Oct 13 19:28:20 2010
@@ -32,7 +32,6 @@ import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.Callable;
 
 import org.apache.aries.blueprint.BeanProcessor;
 import org.apache.aries.blueprint.ComponentDefinitionRegistry;
@@ -42,6 +41,7 @@ import org.apache.aries.blueprint.di.Abs
 import org.apache.aries.blueprint.di.Recipe;
 import org.apache.aries.blueprint.proxy.AsmInterceptorWrapper;
 import org.apache.aries.blueprint.proxy.UnableToProxyException;
+import org.apache.aries.blueprint.utils.InterceptorManager;
 import org.apache.aries.blueprint.utils.ReflectionUtils;
 import org.apache.aries.blueprint.utils.ReflectionUtils.PropertyDescriptor;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
@@ -74,7 +74,6 @@ public class BeanRecipe extends Abstract
     private boolean reorderArguments;
     private final boolean allowsFieldInjection;
     private BeanMetadata interceptorLookupKey;
-    
 
     public BeanRecipe(String name, ExtendedBlueprintContainer blueprintContainer, Object type, boolean allowsFieldInjection) {
         super(name);
@@ -673,9 +672,24 @@ public class BeanRecipe extends Abstract
             throws ComponentDefinitionException {
 
         Object intercepted = null;
-        ComponentDefinitionRegistry reg = blueprintContainer
-                .getComponentDefinitionRegistry();
-        List<Interceptor> interceptors = reg.getInterceptors(interceptorLookupKey);
+        ComponentDefinitionRegistry reg = blueprintContainer.getComponentDefinitionRegistry();    
+        String beanId = getName();
+        BeanMetadata beanData = (BeanMetadata) blueprintContainer.getComponentDefinitionRegistry().getComponentDefinition(getName());
+        
+        // lookup interceptors using the old mechanism
+//        List<Interceptor> interceptorsOld = reg.getInterceptors(interceptorLookupKey);
+        
+        //get interceptors registered as services for this bean Id
+        List<Interceptor> interceptors = InterceptorManager.getInterceptorsForBean(beanId, blueprintContainer);
+
+//        if ((interceptorsOld != null) && (interceptors != null)) {
+            // if there are interceptors using both mechanisms, then merge the lists
+//            interceptors.addAll(interceptorsOld);
+//        } else if ((interceptorsOld != null) && (interceptors == null)) {
+            // if there are only interceptors using the old mechanism then use that list
+//            interceptors = interceptorsOld;
+//        }
+        
         if (interceptors != null && interceptors.size() > 0) {
             try {
                 // Try load load an asm class (to make sure it's actually

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/Parser.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/Parser.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/Parser.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/Parser.java Wed Oct 13 19:28:20 2010
@@ -507,6 +507,8 @@ public class Parser {
                 metadata.setActivation(parseActivation(element));
             }
         } else {
+            // always set id for element (even for in-line or anonymous beans)
+            metadata.setId(getId(element));
             metadata.setActivation(ComponentMetadata.ACTIVATION_LAZY);
         }
         if (element.hasAttribute(CLASS_ATTRIBUTE)) {

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/QuiesceInterceptor.java Wed Oct 13 19:28:20 2010
@@ -53,4 +53,9 @@ public class QuiesceInterceptor implemen
     {
     	return 0;
     }
+    
+    public String getIdentity()
+    {
+      return this.getClass().getName();
+    }    
 }

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java Wed Oct 13 19:28:20 2010
@@ -129,7 +129,7 @@ public class ComponentDefinitionRegistry
 
     public List<Interceptor> getInterceptors(ComponentMetadata component) {
         List<Interceptor> result = interceptors.get(component);
-        return (result == null) ? Collections.<Interceptor>emptyList() : result;
+        return (result == null) ? new ArrayList<Interceptor>() : result;
     }
     
 }

Added: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java?rev=1022251&view=auto
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java (added)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java Wed Oct 13 19:28:20 2010
@@ -0,0 +1,178 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.aries.blueprint.utils;
+
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.aries.blueprint.ComponentDefinitionRegistry;
+import org.apache.aries.blueprint.ExtendedBlueprintContainer;
+import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.PassThroughMetadata;
+import org.apache.aries.blueprint.reflect.ReferenceMetadataImpl;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Utility class to assist in registering Interceptors as
+ * Services and locating applicable Interceptors
+ * 
+ * @version $Revision$
+ */
+public class InterceptorManager {
+    private static final Logger LOGGER = LoggerFactory.getLogger(InterceptorManager.class);
+    private static final String BEAN = "bean";    
+    private static final String BUNDLE_ID = "bundle-id";
+    private static final String URI = "uri";
+    private static final String BLUEPRINT_BUNDLE = "blueprintBundle";
+    private static final String FILTER_START = "(";
+    private static final String FILTER_END = ")";
+    private static final String FILTER_AND = "&";
+
+//@JAB TODO:  Need to pass desired interceptor rank to use as service rank (or continue use the the existing interceptor rank when regsitering service)    
+    public static void addInterceptorForBean(Interceptor interceptor, String beanId, ParserContext pc) 
+    {
+        LOGGER.debug("addInterceptorForBean interceptor {} bean {}", interceptor, beanId);
+
+        long bundleId = 0;   
+        ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
+        Bundle bundle = FrameworkUtil.getBundle(interceptor.getClass());
+        
+        if (cdr.containsComponentDefinition(BLUEPRINT_BUNDLE)) {
+            PassThroughMetadata ptMetadata = (PassThroughMetadata) cdr.getComponentDefinition(BLUEPRINT_BUNDLE);
+            Bundle parsingBundle = (Bundle) ptMetadata.getObject();
+            if (parsingBundle != null) bundleId = parsingBundle.getBundleId();
+        }
+        
+        if (bundle!=null && bundleId!=0) {
+            Dictionary properties = new Hashtable();
+            properties.put(BUNDLE_ID, bundleId);
+            properties.put(BEAN, beanId);
+            properties.put(URI, interceptor.getIdentity());                    
+            BundleContext bundleContext = bundle.getBundleContext();
+
+            //@JAB TODO:  Need to ensure that we only register service once per bean/bundle/interceptor
+            LOGGER.debug("addInterceptorForBean about to register interceptor service with properties {}", properties);
+            ServiceRegistration registration = bundleContext.registerService(Interceptor.class.getName(), interceptor, properties);
+
+            String id = pc.generateId();
+            String filter = FILTER_START + 
+                              FILTER_AND + 
+                                FILTER_START + 
+                                  BUNDLE_ID + "=" + bundleId + 
+                                FILTER_END + 
+                                FILTER_START + 
+                                  BEAN + "=" + beanId + 
+                                FILTER_END + 
+//@JAB TODO:  Need to create a filter that will resolve to correct, single match but 1st need 
+//            to resolve filter comparison on get so that it does not need to be exact                               
+//                                FILTER_START +                                         
+//                                   URI + "=" + interceptor.getIdentity() +
+//                                FILTER_END +        
+                            FILTER_END;
+
+            ReferenceMetadataImpl referenceMetadata = new ReferenceMetadataImpl();
+            referenceMetadata.setId(id);
+//@JAB TODO:  Need to allow the reference to be either mandatory or optional as required by the caller            
+            referenceMetadata.setAvailability(ReferenceMetadataImpl.AVAILABILITY_MANDATORY);
+            referenceMetadata.setRuntimeInterface(Interceptor.class);
+            referenceMetadata.setInterface(Interceptor.class.getName());
+            referenceMetadata.setFilter(filter);
+
+            //@JAB TODO:  Should only need to create one reference per bean/bundle/interceptor
+            LOGGER.debug("addInterceptorForBean about to register interceptor service reference {}", properties);
+            cdr.registerComponentDefinition(referenceMetadata);  
+
+        }
+        else {
+            LOGGER.debug("addInterceptorForBean bundle is null - can not register interceptor service");
+        }
+
+    }
+    
+    public static List<Interceptor> getInterceptorsForBean(String beanId, ExtendedBlueprintContainer blueprintContainer) 
+    {
+        LOGGER.debug("getInterceptorsForBean {}", beanId);
+
+        List<Interceptor> interceptorList = null;
+        
+        //setup dictionary for Interceptor Filter check
+        Dictionary properties = new Hashtable();
+        properties.put(BEAN, beanId);
+        BundleContext bundleContext = blueprintContainer.getBundleContext();
+        Bundle bundle = bundleContext.getBundle();
+        if (bundle != null) {
+            long bundleId = bundle.getBundleId();
+            
+            LOGGER.debug("getInterceptorsForBean searching for interceptors for bundle {} bean ", bundleId, beanId);
+
+            properties.put(BUNDLE_ID, bundleId);    
+            
+            //Look up all interceptors that match the filter for this bundle/bean
+            //@JAB TODO:  This filter should be sufficient for lookup but at the moment the comparison  
+            //            requires an exact match and so the filter created on the reference is not complete              
+            String filter = FILTER_START + 
+                              FILTER_AND + 
+                                FILTER_START + 
+                                  BUNDLE_ID + "=" + bundleId + 
+                                FILTER_END + 
+                                FILTER_START + 
+                                  BEAN + "=" + beanId + 
+                                FILTER_END + 
+                            FILTER_END;   
+            
+	        //Get interceptor references from service reference elements and then get the component instance
+	        for (ReferenceMetadataImpl interceptorRefMetadata : blueprintContainer.getMetadata(ReferenceMetadataImpl.class)) {
+	            Class interfaceClass = interceptorRefMetadata.getRuntimeInterface();
+	            if ((interfaceClass!=null) && (interfaceClass.equals(Interceptor.class))) {            
+	                try {
+	                    if (interceptorRefMetadata.getFilter()!=null) { 
+	                        Filter filterObj = blueprintContainer.getBundleContext().createFilter(interceptorRefMetadata.getFilter());
+	                        if (filterObj.match(properties)) {
+	                            LOGGER.debug("getInterceptorsForBean matching reference found, about to get instance {}", interceptorRefMetadata);       	
+	                            Interceptor interceptor = (Interceptor) blueprintContainer.getComponentInstance(interceptorRefMetadata.getId());
+	                            if(interceptorList==null) interceptorList = new ArrayList<Interceptor>();
+	                            //@JAB TODO:  Need to order filters by service rank
+	                            interceptorList.add(interceptor);                            	
+	                        } 
+	                    }
+	                } catch (InvalidSyntaxException ise) {
+	                    LOGGER.debug("getInterceptorsForBean InvalidSyntaxException using filter {}", filter, ise);       	
+	                }
+	            } 
+	        }            
+        } 
+        else {
+            LOGGER.debug("getInterceptorsForBean bundle is null - can not locate interceptors");       	
+        }
+               
+        return interceptorList;
+    }
+
+}

Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.io.*;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -58,7 +57,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 public abstract class AbstractIntegrationTest {
 
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
 
     private List<ServiceTracker> srs;
 
@@ -230,7 +229,7 @@ public abstract class AbstractIntegratio
     protected void testBlueprintContainer(BundleContext bc, Bundle bundle) throws Exception {
         BlueprintContainer blueprintContainer = getBlueprintContainerForBundle(
                 bc == null ? bundleContext : bc, "org.apache.aries.blueprint.sample",
-                5000);
+                DEFAULT_TIMEOUT);
         assertNotNull(blueprintContainer);
 
         Object obj = blueprintContainer.getComponentInstance("bar");
@@ -257,7 +256,7 @@ public abstract class AbstractIntegratio
         assertTrue(foo.isInitialized());
         assertFalse(foo.isDestroyed());
 
-        obj = getOsgiService(bc == null ? bundleContext : bc, Foo.class, null, 5000);
+        obj = getOsgiService(bc == null ? bundleContext : bc, Foo.class, null, DEFAULT_TIMEOUT);
         assertNotNull(obj);
         assertEquals(obj, foo);
         

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractMultiBundleTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractMultiBundleTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractMultiBundleTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/AbstractMultiBundleTest.java Wed Oct 13 19:28:20 2010
@@ -94,7 +94,7 @@ public class AbstractMultiBundleTest ext
         //bundleb's container will hold the beans we need to query to check the function
         //provided by bundlea functioned as expected
         BlueprintContainer beanContainer = 
-            getBlueprintContainerForBundle( bundleContext , "org.apache.aries.blueprint.testbundleb", 5000);
+            getBlueprintContainerForBundle( bundleContext , "org.apache.aries.blueprint.testbundleb", DEFAULT_TIMEOUT);
         assertNotNull(beanContainer);
 
         //TestBeanA should have the values below, no interference should be present from other sources.
@@ -122,7 +122,7 @@ public class AbstractMultiBundleTest ext
        
         //handlers are in bundlea, with its own container.
         BlueprintContainer handlerContainer = 
-            getBlueprintContainerForBundle( bundleContext , "org.apache.aries.blueprint.testbundlea", 5000);
+            getBlueprintContainerForBundle( bundleContext , "org.apache.aries.blueprint.testbundlea", DEFAULT_TIMEOUT);
         assertNotNull(handlerContainer);
         
         Object ns1 = handlerContainer.getComponentInstance("NSHandlerOne");

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintContainerTest.java Wed Oct 13 19:28:20 2010
@@ -74,7 +74,7 @@ public class BlueprintContainerTest exte
 
       bundle.start();
       
-      getBlueprintContainerForBundle(bundleContext, "org.apache.aries.blueprint.sample",5000);
+      getBlueprintContainerForBundle(bundleContext, "org.apache.aries.blueprint.sample", DEFAULT_TIMEOUT);
       
       // no actual assertions, we just don't want to deadlock
     }

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/QuiesceBlueprintTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/QuiesceBlueprintTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/QuiesceBlueprintTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/QuiesceBlueprintTest.java Wed Oct 13 19:28:20 2010
@@ -68,8 +68,6 @@ public class QuiesceBlueprintTest extend
 		return calls;
 	}
   }
-
-  private static final int DEFAULT_TIMEOUT = 30000;
   
   @Inject
   protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/TestConfigAdmin.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/TestConfigAdmin.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/TestConfigAdmin.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/TestConfigAdmin.java Wed Oct 13 19:28:20 2010
@@ -53,7 +53,7 @@ public class TestConfigAdmin extends Abs
         assertNotNull(bundle);
         bundle.start();
 
-        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", 5000);
+        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", DEFAULT_TIMEOUT);
         assertNotNull(blueprintContainer);
 
         Foo foo = (Foo) blueprintContainer.getComponentInstance("none-managed");
@@ -87,7 +87,7 @@ public class TestConfigAdmin extends Abs
         assertNotNull(bundle);
         bundle.start();
 
-        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", 5000);
+        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", DEFAULT_TIMEOUT);
         assertNotNull(blueprintContainer);
 
         Foo foo = (Foo) blueprintContainer.getComponentInstance("container-managed");
@@ -120,7 +120,7 @@ public class TestConfigAdmin extends Abs
         assertNotNull(bundle);
         bundle.start();
 
-        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", 5000);
+        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", DEFAULT_TIMEOUT);
         assertNotNull(blueprintContainer);
 
         Foo foo = (Foo) blueprintContainer.getComponentInstance("component-managed");
@@ -156,7 +156,7 @@ public class TestConfigAdmin extends Abs
         assertNotNull(bundle);
         bundle.start();
 
-        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", 5000);
+        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample", DEFAULT_TIMEOUT);
         assertNotNull(blueprintContainer);
 
         Thread.sleep(5000);

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java Wed Oct 13 19:28:20 2010
@@ -26,6 +26,7 @@ import java.util.Set;
 import org.apache.aries.blueprint.Interceptor;
 import org.apache.aries.blueprint.NamespaceHandler;
 import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.utils.InterceptorManager;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
 import org.w3c.dom.Element;
@@ -98,6 +99,11 @@ public class NSHandlerTwo implements Nam
         public int getRank() {
             return 0;
         }
+        
+        public String getIdentity()
+        {
+          return this.getClass().getName();
+        } 
     };
     
     //
@@ -105,10 +111,11 @@ public class NSHandlerTwo implements Nam
             ParserContext context) {
         
         if(node.getLocalName().equals(ATTRIB_ONE)){
-            if(context.getComponentDefinitionRegistry().getInterceptors(component) == null ||
-               !context.getComponentDefinitionRegistry().getInterceptors(component).contains(tracker) ){
-                context.getComponentDefinitionRegistry().registerInterceptorWithComponent(component, tracker);
-            }
+            InterceptorManager.addInterceptorForBean(tracker, component.getId(), context);
+//            if(context.getComponentDefinitionRegistry().getInterceptors(component) == null ||
+//               !context.getComponentDefinitionRegistry().getInterceptors(component).contains(tracker) ){
+//                context.getComponentDefinitionRegistry().registerInterceptorWithComponent(component, tracker);
+//            }
         }
         return component;
     }

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/jmx/jmx-itests/src/test/java/org/apache/aries/jmx/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -62,7 +62,7 @@ import org.osgi.util.tracker.ServiceTrac
 @RunWith(JUnit4TestRunner.class)
 public class AbstractIntegrationTest {
     
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
 
     ServiceRegistration registration;
     ServiceReference reference;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/blueprint/aries/itest/JPAInjectionTest.java Wed Oct 13 19:28:20 2010
@@ -42,7 +42,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 @RunWith(JUnit4TestRunner.class)
 public class JPAInjectionTest {
-  public static final long DEFAULT_TIMEOUT = 30000;
+  public static final long DEFAULT_TIMEOUT = 60000;
 
   @Inject
   protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/container/itest/JPAContainerTest.java Wed Oct 13 19:28:20 2010
@@ -49,7 +49,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 @RunWith(JUnit4TestRunner.class)
 public class JPAContainerTest {
-  public static final long DEFAULT_TIMEOUT = 30000;
+  public static final long DEFAULT_TIMEOUT = 60000;
 
   @Inject
   protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/context/itest/JPAContextTest.java Wed Oct 13 19:28:20 2010
@@ -51,7 +51,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 @RunWith(JUnit4TestRunner.class)
 public class JPAContextTest {
-  public static final long DEFAULT_TIMEOUT = 30000;
+  public static final long DEFAULT_TIMEOUT = 60000;
 
   @Inject
   protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/QuiesceJPATest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/QuiesceJPATest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/QuiesceJPATest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/jpa/jpa-container-itest/src/test/java/org/apache/aries/jpa/quiesce/itest/QuiesceJPATest.java Wed Oct 13 19:28:20 2010
@@ -106,7 +106,7 @@ public class QuiesceJPATest {
   }
   
   
-  public static final long DEFAULT_TIMEOUT = 30000;
+  public static final long DEFAULT_TIMEOUT = 60000;
 
   @Inject
   protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/quiesce/quiesce-manager-itest/src/test/java/org/apache/aries/quiesce/manager/itest/QuiesceManagerTest.java Wed Oct 13 19:28:20 2010
@@ -21,6 +21,8 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
 import static org.ops4j.pax.exam.OptionUtils.combine;
+//import org.ops4j.pax.exam.container.def.options.VMOption;
+//import org.ops4j.pax.exam.options.TimeoutOption;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -53,7 +55,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 @RunWith(JUnit4TestRunner.class)
 public class QuiesceManagerTest {
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
     private QuiesceManager manager;
     private Bundle b1;
     private Bundle b2;
@@ -310,6 +312,9 @@ public class QuiesceManagerTest {
                 mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.serp"),
                 mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api"),
                 mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.manager"),
+                
+                //new VMOption( "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" ),
+                //new TimeoutOption( 0 ),
 
                 equinox().version("3.5.0"));
         options = updateOptions(options);

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/samples/blog/blog-itests/src/test/java/org/apache/aries/samples/blog/itests/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -55,7 +55,7 @@ import org.osgi.util.tracker.ServiceTrac
 public abstract class AbstractIntegrationTest {
 
     private static final int CONNECTION_TIMEOUT = 30000;
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
 
 	@Inject
   	protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-itests/src/test/java/org/apache/aries/spifly/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-itests/src/test/java/org/apache/aries/spifly/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-itests/src/test/java/org/apache/aries/spifly/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/spi-fly/spi-fly-itests/src/test/java/org/apache/aries/spifly/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -43,7 +43,7 @@ import org.osgi.util.tracker.ServiceTrac
 @RunWith(JUnit4TestRunner.class)
 public class AbstractIntegrationTest {
 
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
 
     @Inject
     protected BundleContext bundleContext;

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/pom.xml?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/pom.xml (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/pom.xml Wed Oct 13 19:28:20 2010
@@ -48,7 +48,8 @@
 		<dependency>
 			<groupId>org.osgi</groupId>
 			<artifactId>org.osgi.core</artifactId>
-			<scope>test</scope>
+			<!-- <scope>test</scope> -->
+            <scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.osgi</groupId>

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java Wed Oct 13 19:28:20 2010
@@ -24,6 +24,7 @@ import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 
 import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.transaction.Constants;
 import org.apache.aries.transaction.exception.TransactionRollbackException;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 import org.slf4j.Logger;
@@ -41,6 +42,11 @@ public class TxInterceptorImpl implement
       // TODO Auto-generated method stub
       return 0;
     }
+   
+    public String getIdentity()
+    {
+      return Constants.TRANSACTION11URI;
+    }
 
     public void postCallWithException(ComponentMetadata cm, Method m,
         Throwable ex, Object preCallToken)

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java Wed Oct 13 19:28:20 2010
@@ -28,6 +28,7 @@ import org.apache.aries.blueprint.Compon
 import org.apache.aries.blueprint.Interceptor;
 import org.apache.aries.blueprint.NamespaceHandler;
 import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.utils.InterceptorManager;
 import org.apache.aries.transaction.Constants;
 import org.apache.aries.transaction.TxComponentMetaDataHelper;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
@@ -54,20 +55,25 @@ public class TxElementHandler implements
         if ("transaction".equals(elt.getLocalName())) {
             if (LOGGER.isDebugEnabled())
                 LOGGER.debug("parser adding interceptor for " + elt);
-
-            ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
             
+            ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
+   
             if (cm == null) {
                 // if the enclosing component is null, then we assume this is the top element 
                 
-                
                 String bean = elt.getAttribute(Constants.BEAN);
-                registerComponentsWithInterceptor(cdr, bean);
+                registerComponentsWithInterceptor(bean, pc);
 
                 metaDataHelper.populateBundleWideTransactionData(pc.getComponentDefinitionRegistry(), 
                         elt.getAttribute(Constants.VALUE), elt.getAttribute(Constants.METHOD), bean);
             } else {
-                cdr.registerInterceptorWithComponent(cm, interceptor);
+                String beanId = cm.getId(); 
+                
+//                cdr.registerInterceptorWithComponent(cm, interceptor);                
+                   
+                //Create interceptor service and reference for this bean instance
+                InterceptorManager.addInterceptorForBean(interceptor, beanId, pc);
+
                 if (LOGGER.isDebugEnabled())
                     LOGGER.debug("parser setting comp trans data for " + elt.getAttribute(Constants.VALUE) + "  "
                             + elt.getAttribute(Constants.METHOD));
@@ -134,7 +140,10 @@ public class TxElementHandler implements
         return false;
     }
     
-    private void registerComponentsWithInterceptor(ComponentDefinitionRegistry cdr, String bean) {
+    private void registerComponentsWithInterceptor(String bean, ParserContext pc) {
+
+        ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
+
         // if it is already registered all components in the component definition registry, do nothing
         if (isRegistered(cdr)) {
             return;
@@ -147,8 +156,9 @@ public class TxElementHandler implements
             // if the component has already been registered with this interceptor,
             // the registration will be ignored.
             for (String id : ids) {
-                ComponentMetadata componentMetadata = cdr.getComponentDefinition(id);
-                cdr.registerInterceptorWithComponent(componentMetadata, interceptor);
+                InterceptorManager.addInterceptorForBean(interceptor, id, pc);
+//                ComponentMetadata componentMetadata = cdr.getComponentDefinition(id);
+//                cdr.registerInterceptorWithComponent(componentMetadata, interceptor);
             }
             synchronized (registered) {
                 registered.add(cdr);
@@ -159,8 +169,9 @@ public class TxElementHandler implements
             for (String id : ids) {
                 Matcher m = p.matcher(id);
                 if (m.matches()) {
-                    ComponentMetadata componentMetadata = cdr.getComponentDefinition(id);
-                    cdr.registerInterceptorWithComponent(componentMetadata, interceptor);
+                    InterceptorManager.addInterceptorForBean(interceptor, id, pc);
+//                    ComponentMetadata componentMetadata = cdr.getComponentDefinition(id);
+//                    cdr.registerInterceptorWithComponent(componentMetadata, interceptor);
                 }
             }
         }

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/resources/OSGI-INF/blueprint/transaction.xml Wed Oct 13 19:28:20 2010
@@ -22,28 +22,45 @@
             xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
             default-activation="lazy">
             
-  <service interface="org.apache.aries.blueprint.NamespaceHandler">
+  <service id="txNameSpaceService" interface="org.apache.aries.blueprint.NamespaceHandler">
         <service-properties>
             <entry key="osgi.service.blueprint.namespace">
-            	<list>
-				    <value>http://aries.apache.org/xmlns/transactions/v1.0.0</value>
-				    <value>http://aries.apache.org/xmlns/transactions/v1.1.0</value>
-			    </list>
-			</entry>
+                <list>
+                    <value>http://aries.apache.org/xmlns/transactions/v1.0.0</value>
+                    <value>http://aries.apache.org/xmlns/transactions/v1.1.0</value>
+                </list>
+            </entry>
         </service-properties>
         <bean class="org.apache.aries.transaction.parsing.TxElementHandler">
-            <property ref="txenhancer" name="txMetaDataHelper"/>
-            <property ref="txinterceptor" name="transactionInterceptor"/>
+            <property ref="txEnhancer" name="txMetaDataHelper"/>
+            <!--<property ref="txinterceptor" name="transactionInterceptor"/>-->
+            <property ref="txInterceptor" name="transactionInterceptor"/>
         </bean>
   </service>              
   
-  <bean id="txenhancer" class="org.apache.aries.transaction.TxComponentMetaDataHelperImpl"/>
+  <bean id="txEnhancer" class="org.apache.aries.transaction.TxComponentMetaDataHelperImpl"/>
+ 
+  <reference id="tm" interface="javax.transaction.TransactionManager"/>
   
-  <bean id="txinterceptor" class="org.apache.aries.transaction.TxInterceptorImpl">
-    <property name="transactionManager" ref="tm"/>
-    <property ref="txenhancer" name="txMetaDataHelper"/>
+  <bean id="txInterceptor" class="org.apache.aries.transaction.TxInterceptorImpl">
+      <property ref="tm" name="transactionManager"/>
+      <property ref="txEnhancer" name="txMetaDataHelper"/>
   </bean>
-  
-  <reference id="tm" interface="javax.transaction.TransactionManager"/>
-
+    
+<!--   
+  <service id="txInterceptorService" ref="txInterceptor" interface="org.apache.aries.blueprint.Interceptor">
+    <service-properties>
+        <entry key="osgi.service.blueprint.namespace">
+            <list>
+                <value>http://aries.apache.org/xmlns/transactions/v1.0.0</value>
+                <value>http://aries.apache.org/xmlns/transactions/v1.1.0</value>
+            </list>
+        </entry>
+    </service-properties>
+    <bean class="org.apache.aries.transaction.TxInterceptorImpl">
+      <property name="transactionManager" ref="tm"/>
+      <property ref="txEnhancer" name="txMetaDataHelper"/>
+    </bean>
+  </service>
+-->
 </blueprint>
\ No newline at end of file

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java Wed Oct 13 19:28:20 2010
@@ -25,6 +25,8 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
 import static org.ops4j.pax.exam.OptionUtils.combine;
 import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+import org.ops4j.pax.exam.container.def.options.VMOption;
+import org.ops4j.pax.exam.options.TimeoutOption;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -49,7 +51,8 @@ import org.osgi.util.tracker.ServiceTrac
 @RunWith(JUnit4TestRunner.class)
 public abstract class AbstractIntegrationTest {
 
-    public static final long DEFAULT_TIMEOUT = 30000;
+    public static final long DEFAULT_TIMEOUT = 60000;
+//    public static final long DEFAULT_TIMEOUT = 0;
     
     private List<ServiceTracker> srs;
 

Modified: incubator/aries/sandbox/jbohn/interceptor-proto/web/web-itests/src/test/java/org/apache/aries/web/converter/itest/WabConverterITest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/jbohn/interceptor-proto/web/web-itests/src/test/java/org/apache/aries/web/converter/itest/WabConverterITest.java?rev=1022251&r1=1022250&r2=1022251&view=diff
==============================================================================
--- incubator/aries/sandbox/jbohn/interceptor-proto/web/web-itests/src/test/java/org/apache/aries/web/converter/itest/WabConverterITest.java (original)
+++ incubator/aries/sandbox/jbohn/interceptor-proto/web/web-itests/src/test/java/org/apache/aries/web/converter/itest/WabConverterITest.java Wed Oct 13 19:28:20 2010
@@ -57,7 +57,7 @@ import org.osgi.util.tracker.ServiceTrac
 
 @RunWith(JUnit4TestRunner.class)
 public class WabConverterITest {
-  public static final long DEFAULT_TIMEOUT = 30000;
+  public static final long DEFAULT_TIMEOUT = 60000;
 
   @Inject
   protected BundleContext bundleContext;



Mime
View raw message