aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1205487 - in /aries/trunk/blueprint: blueprint-bundle/ blueprint-core/ blueprint-core/src/main/java/org/apache/aries/blueprint/container/ blueprint-core/src/main/java/org/apache/aries/blueprint/services/ blueprint-core/src/main/java/org/ap...
Date Wed, 23 Nov 2011 16:37:42 GMT
Author: dkulp
Date: Wed Nov 23 16:37:41 2011
New Revision: 1205487

URL: http://svn.apache.org/viewvc?rev=1205487&view=rev
Log:
Restore compatibility with CXF 2.5.0

Added:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/packageinfo
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
  (with props)
Modified:
    aries/trunk/blueprint/blueprint-bundle/pom.xml
    aries/trunk/blueprint/blueprint-core/pom.xml
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/RecipeBuilder.java
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ExtendedBlueprintContainer.java

Modified: aries/trunk/blueprint/blueprint-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-bundle/pom.xml?rev=1205487&r1=1205486&r2=1205487&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-bundle/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-bundle/pom.xml Wed Nov 23 16:37:41 2011
@@ -82,13 +82,16 @@
           	org.apache.aries.blueprint.mutable,
             org.apache.aries.blueprint.ext,
             org.apache.aries.blueprint.ext.evaluator,
-            org.apache.aries.blueprint.utils
+            org.apache.aries.blueprint.utils,
+            org.apache.aries.blueprint.container,
+            org.apache.aries.blueprint.di,
+            org.apache.aries.blueprint.reflect,
         </aries.osgi.export.pkg>
         <aries.osgi.private.pkg>
 	        org.apache.aries.blueprint.parser,
 	        org.apache.aries.blueprint.reflect,
-	        org.apache.aries.blueprint.container,
-	        org.apache.aries.blueprint.di,
+            org.apache.aries.blueprint.container,
+            org.apache.aries.blueprint.di,
             org.apache.aries.blueprint.ext.impl,
 	        org.apache.aries.blueprint.namespace,
 	        org.apache.aries.blueprint.proxy,

Modified: aries/trunk/blueprint/blueprint-core/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/pom.xml?rev=1205487&r1=1205486&r2=1205487&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-core/pom.xml Wed Nov 23 16:37:41 2011
@@ -53,6 +53,9 @@
           org.apache.aries.blueprint.ext.evaluator,
           org.apache.aries.blueprint.services,
           org.apache.aries.blueprint.utils,
+          org.apache.aries.blueprint.container,
+          org.apache.aries.blueprint.di,
+          org.apache.aries.blueprint.reflect,
           org.osgi.service.blueprint;version=1.0.0
       </aries.osgi.export.pkg>
       <!-- 
@@ -74,9 +77,10 @@
       </aries.osgi.import>
       <aries.osgi.private.pkg>
         org.apache.aries.blueprint.parser,
-        org.apache.aries.blueprint.reflect,
         org.apache.aries.blueprint.container,
         org.apache.aries.blueprint.di,
+        org.apache.aries.blueprint.utils,
+        org.apache.aries.blueprint.reflect,
         org.apache.aries.blueprint.ext.impl,
         org.apache.aries.blueprint.namespace,
         org.apache.aries.blueprint.proxy,

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/RecipeBuilder.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/RecipeBuilder.java?rev=1205487&r1=1205486&r2=1205487&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/RecipeBuilder.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/RecipeBuilder.java
Wed Nov 23 16:37:41 2011
@@ -72,11 +72,11 @@ import org.osgi.service.blueprint.reflec
 public class RecipeBuilder {
 
     private final Set<String> names = new HashSet<String>();
-    private final ExtendedBlueprintContainer blueprintContainer;
+    private final BlueprintContainerImpl blueprintContainer;
     private final ComponentDefinitionRegistry registry;
     private final IdSpace recipeIdSpace;
 
-    public RecipeBuilder(ExtendedBlueprintContainer blueprintContainer, IdSpace recipeIdSpace)
{
+    public RecipeBuilder(BlueprintContainerImpl blueprintContainer, IdSpace recipeIdSpace)
{
         this.recipeIdSpace = recipeIdSpace;
         this.blueprintContainer = blueprintContainer;
         this.registry = blueprintContainer.getComponentDefinitionRegistry();

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java?rev=1205487&r1=1205486&r2=1205487&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/ServiceRecipe.java
Wed Nov 23 16:37:41 2011
@@ -70,7 +70,7 @@ public class ServiceRecipe extends Abstr
     final static String LOG_ENTRY = "Method entry: {}, args {}";
     final static String LOG_EXIT = "Method exit: {}, returning {}";
 
-    private final ExtendedBlueprintContainer blueprintContainer;
+    private final BlueprintContainerImpl blueprintContainer;
     private final ServiceMetadata metadata;
     private final Recipe serviceRecipe;
     private final CollectionRecipe listenersRecipe;
@@ -90,7 +90,7 @@ public class ServiceRecipe extends Abstr
     private Collection<DestroyCallback> destroyCallbacks = new ArrayList<DestroyCallback>();
     
     public ServiceRecipe(String name,
-                         ExtendedBlueprintContainer blueprintContainer,
+                         BlueprintContainerImpl blueprintContainer,
                          ServiceMetadata metadata,
                          Recipe serviceRecipe,
                          CollectionRecipe listenersRecipe,

Added: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/packageinfo
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/packageinfo?rev=1205487&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/packageinfo
(added)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/packageinfo
Wed Nov 23 16:37:41 2011
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+version 0.4

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ExtendedBlueprintContainer.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ExtendedBlueprintContainer.java?rev=1205487&r1=1205486&r2=1205487&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ExtendedBlueprintContainer.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/services/ExtendedBlueprintContainer.java
Wed Nov 23 16:37:41 2011
@@ -53,6 +53,10 @@ public interface ExtendedBlueprintContai
 
     <T extends Processor> List<T> getProcessors(Class<T> type);
 
+    /**
+     * To be removed as internal API
+     */
+    @Deprecated
     Repository getRepository();
     
     ServiceRegistration registerService(String[] classes, Object service, Dictionary properties);

Added: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java?rev=1205487&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
(added)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
Wed Nov 23 16:37:41 2011
@@ -0,0 +1,136 @@
+/*
+ * 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.io.IOException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * A ClassLoader delegating to a given OSGi bundle.
+ *
+ * @version $Rev$, $Date$
+ * @deprecated - will be removed in a future version of Aries Blueprint
+ *           Use AriesFrameworkUtil#getClassLoader(Bundle) and
+ *           or AriesFrameworkUtil#getClassLoaderForced(Bundle) instead     
+ */
+@Deprecated
+public class BundleDelegatingClassLoader extends ClassLoader {
+
+    private final Bundle bundle;
+    private final ClassLoader classLoader;
+
+    public BundleDelegatingClassLoader(Bundle bundle) {
+        this(bundle, null);
+    }
+
+    public BundleDelegatingClassLoader(Bundle bundle, ClassLoader classLoader) {
+        this.bundle = bundle;
+        this.classLoader = classLoader;
+    }
+
+    protected Class<?> findClass(final String name) throws ClassNotFoundException {
+        try {
+            return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>()
{
+                public Class<?> run() throws ClassNotFoundException 
+                {
+                    return bundle.loadClass(name);
+                }
+            
+            });
+        } catch (PrivilegedActionException e) {
+            Exception cause = e.getException();
+          
+            if (cause instanceof ClassNotFoundException) throw (ClassNotFoundException)cause;
+            else throw (RuntimeException)cause;
+        }    
+    }
+
+    protected URL findResource(final String name) {
+        URL resource = AccessController.doPrivileged(new PrivilegedAction<URL>() {
+            public URL run()
+            {
+                return bundle.getResource(name);
+            }
+        });        
+        if (classLoader != null && resource == null) {
+            resource = classLoader.getResource(name);
+        }
+        return resource;
+    }
+
+    protected Enumeration<URL> findResources(final String name) throws IOException
{
+        Enumeration<URL> urls;
+        try {
+            urls =  AccessController.doPrivileged(new PrivilegedExceptionAction<Enumeration<URL>>()
{
+                @SuppressWarnings("unchecked")
+                public Enumeration<URL> run() throws IOException
+                {
+                    return (Enumeration<URL>)bundle.getResources(name);
+                }
+          
+            });
+        } catch (PrivilegedActionException e) {
+            Exception cause = e.getException();
+        
+            if (cause instanceof IOException) throw (IOException)cause;
+            else throw (RuntimeException)cause;
+        }
+      
+        if (urls == null) {
+            urls = Collections.enumeration(new ArrayList<URL>());
+        }
+      
+        return urls;    
+    }
+
+    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
{
+        Class clazz;
+        try {
+            clazz = findClass(name);
+        }
+        catch (ClassNotFoundException cnfe) {
+            if (classLoader != null) {
+                try {
+                    clazz = classLoader.loadClass(name);
+                } catch (ClassNotFoundException e) {
+                    throw new ClassNotFoundException(name + " from bundle " + bundle.getBundleId()
+ " (" + bundle.getSymbolicName() + ")", cnfe);
+                }
+            } else {
+                throw new ClassNotFoundException(name + " from bundle " + bundle.getBundleId()
+ " (" + bundle.getSymbolicName() + ")", cnfe);
+            }
+        }
+        if (resolve) {
+            resolveClass(clazz);
+        }
+        return clazz;
+    }
+
+    public Bundle getBundle() {
+        return bundle;
+    }
+}

Propchange: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message