aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r1056446 - in /aries/sandbox/jbohn/interceptor-proto: blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ blueprint/blueprint-testbundlea/src/...
Date Fri, 07 Jan 2011 18:30:06 GMT
Author: jbohn
Date: Fri Jan  7 18:30:06 2011
New Revision: 1056446

URL: http://svn.apache.org/viewvc?rev=1056446&view=rev
Log:
revert to creating service references in handler and some other minor tweaks

Modified:
    aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
    aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
    aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
    aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java

Modified: aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1056446&r1=1056445&r2=1056446&view=diff
==============================================================================
--- aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
(original)
+++ aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
Fri Jan  7 18:30:06 2011
@@ -282,7 +282,7 @@ public class BlueprintContainerImpl impl
                         break;
                     }
                     case Populated:
-                        addInterceptorRefs();
+//                        addInterceptorRefs();
                         getRepository();
                         trackServiceReferences();
                         Runnable r = new Runnable() {

Modified: aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
URL: http://svn.apache.org/viewvc/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java?rev=1056446&r1=1056445&r2=1056446&view=diff
==============================================================================
--- aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
(original)
+++ aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/InterceptorManager.java
Fri Jan  7 18:30:06 2011
@@ -31,7 +31,6 @@ import org.apache.aries.blueprint.Compon
 import org.apache.aries.blueprint.container.BlueprintRepository;
 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;
@@ -160,57 +159,6 @@ public class InterceptorManager {
         return interceptorServiceRefList; 
     } 
     
-    
-    public static synchronized void addServiceReference(ServiceReference interceptorReference,
int availability, ParserContext pc) 
-    {
-        LOGGER.debug("addServiceReference for {} ", interceptorReference);
-
-        long parsingBundleId = (Long) interceptorReference.getProperty(BUNDLE_ID);
-        String interceptorId = interceptorReference.getProperty(URI).toString();
-        String beanId = interceptorReference.getProperty(BEAN).toString();
-        ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
-               
-        if (parsingBundleId!=0) {
-
-            String interceptorKey = interceptorId + DELIM + parsingBundleId + DELIM + beanId;
-
-            if (serviceReferenceCollection.get(interceptorKey) == null) {
-        
-                String id = pc.generateId();
-                String filter = FILTER_START + 
-                                  FILTER_AND + 
-                                   FILTER_START + 
-                                      BUNDLE_ID + "=" + parsingBundleId + 
-                                    FILTER_END + 
-                                    FILTER_START + 
-                                      BEAN + "=" + beanId + 
-                                    FILTER_END +                             
-                                    FILTER_START +                                      
  
-                                       URI + "=" + interceptorId +
-                                    FILTER_END +        
-                               FILTER_END;
-
-                ReferenceMetadataImpl referenceMetadata = new ReferenceMetadataImpl();
-                referenceMetadata.setId(id);
-                referenceMetadata.setAvailability(availability);
-                referenceMetadata.setRuntimeInterface(Interceptor.class);
-                referenceMetadata.setInterface(Interceptor.class.getName());
-                referenceMetadata.setFilter(filter);
-
-                LOGGER.debug("addServiceReference about to register interceptor service reference
{}", referenceMetadata);
-                cdr.registerComponentDefinition(referenceMetadata); 
-                
-                serviceReferenceCollection.put(interceptorKey, referenceMetadata);
-            }
-            else {
-                LOGGER.debug("addServiceReference interceptor already registered for bundle
& bean " + interceptorKey );      
-            }
-        }
-        else {
-            LOGGER.debug("addServiceReference bundleId is null - can not register interceptor
service");
-        }
-    }
-    
     public static synchronized void addServiceReference(ServiceReference interceptorReference,
int availability, ComponentDefinitionRegistry cdr) 
     {
         LOGGER.debug("addServiceReference for {} ", interceptorReference);
@@ -260,7 +208,7 @@ public class InterceptorManager {
         }
     }
     
-    public static List<Interceptor> getInterceptorsForBean(String beanId, final ExtendedBlueprintContainer
blueprintContainer) 
+    public static List<Interceptor> getInterceptorsForBean(String beanId, ExtendedBlueprintContainer
blueprintContainer) 
     {
         LOGGER.debug("getInterceptorsForBean {}", beanId);
 

Modified: aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
URL: http://svn.apache.org/viewvc/aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java?rev=1056446&r1=1056445&r2=1056446&view=diff
==============================================================================
--- aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
(original)
+++ aries/sandbox/jbohn/interceptor-proto/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
Fri Jan  7 18:30:06 2011
@@ -124,7 +124,7 @@ public class NSHandlerTwo implements Nam
             ServiceReference interceptorReference = InterceptorManager.registerInterceptorService(tracker,
100, component.getId(), parsingBundleId);
             
             //Register a Mandatory Service Reference for the interceptor Service
-            if (interceptorReference != null) InterceptorManager.addServiceReference(interceptorReference,
ServiceReferenceMetadata.AVAILABILITY_MANDATORY, context);
+            if (interceptorReference != null) InterceptorManager.addServiceReference(interceptorReference,
ServiceReferenceMetadata.AVAILABILITY_MANDATORY, context.getComponentDefinitionRegistry());
             
             
         }

Modified: aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
URL: http://svn.apache.org/viewvc/aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java?rev=1056446&r1=1056445&r2=1056446&view=diff
==============================================================================
--- aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
(original)
+++ aries/sandbox/jbohn/interceptor-proto/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/parsing/TxElementHandler.java
Fri Jan  7 18:30:06 2011
@@ -239,8 +239,7 @@ public class TxElementHandler implements
             ServiceReference interceptorReference = InterceptorManager.registerInterceptorService(txInterceptor,
interceptorRanking, beanId, parsingBundleId);
             
             //Register a Mandatory Service Reference for the interceptor Service
-            // @JAB temporarily remove to try lookup/add in Blueprint Container
-            // if (interceptorReference != null) InterceptorManager.addServiceReference(interceptorReference,
ServiceReferenceMetadata.AVAILABILITY_MANDATORY, pc); 
+            if (interceptorReference != null) InterceptorManager.addServiceReference(interceptorReference,
ServiceReferenceMetadata.AVAILABILITY_MANDATORY, cdr); 
         
         }
     }    



Mime
View raw message