You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by bo...@apache.org on 2014/11/20 14:45:37 UTC

svn commit: r1640741 - in /felix/trunk/framework/src: main/java/org/apache/felix/framework/BundleWiringImpl.java test/java/org/apache/felix/framework/BundleWiringImplTest.java

Author: bob
Date: Thu Nov 20 13:45:36 2014
New Revision: 1640741

URL: http://svn.apache.org/r1640741
Log:
FELIX-4705 Added logger to BundleClassLoader and BundleClassLoaderJava5

Added:
    felix/trunk/framework/src/test/java/org/apache/felix/framework/BundleWiringImplTest.java
Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java?rev=1640741&r1=1640740&r2=1640741&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java Thu Nov 20 13:45:36 2014
@@ -707,10 +707,10 @@ public class BundleWiringImpl implements
             try
             {
                 Constructor ctor = BundleRevisionImpl.getSecureAction()
-                    .getConstructor(clazz, new Class[] { BundleWiringImpl.class, ClassLoader.class });
+                    .getConstructor(clazz, new Class[] { BundleWiringImpl.class, ClassLoader.class, Logger.class });
                 m_classLoader = (BundleClassLoader)
                     BundleRevisionImpl.getSecureAction().invoke(ctor,
-                    new Object[] { this, determineParentClassLoader() });
+                    new Object[] { this, determineParentClassLoader(), m_logger });
             }
             catch (Exception ex)
             {
@@ -1891,9 +1891,9 @@ public class BundleWiringImpl implements
 
         private final BundleWiringImpl m_wiring;
 
-        public BundleClassLoaderJava5(BundleWiringImpl wiring, ClassLoader parent)
+        public BundleClassLoaderJava5(BundleWiringImpl wiring, ClassLoader parent, Logger logger)
         {
-            super(wiring, parent);
+            super(wiring, parent, logger);
             m_wiring = wiring;
         }
 
@@ -1944,8 +1944,9 @@ public class BundleWiringImpl implements
         private static final int LIBPATH_IDX = 1;
         private final Map<String, Thread> m_classLocks = new HashMap<String, Thread>();
         private final BundleWiringImpl m_wiring;
+        private final Logger m_logger;
 
-        public BundleClassLoader(BundleWiringImpl wiring, ClassLoader parent)
+        public BundleClassLoader(BundleWiringImpl wiring, ClassLoader parent, Logger logger)
         {
             super(parent);
             if (m_dexFileClassLoadClass != null)
@@ -1957,6 +1958,7 @@ public class BundleWiringImpl implements
                 m_jarContentToDexFile = null;
             }
             m_wiring = wiring;
+            m_logger = logger;
         }
 
         protected boolean isParallel()

Added: felix/trunk/framework/src/test/java/org/apache/felix/framework/BundleWiringImplTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/test/java/org/apache/felix/framework/BundleWiringImplTest.java?rev=1640741&view=auto
==============================================================================
--- felix/trunk/framework/src/test/java/org/apache/felix/framework/BundleWiringImplTest.java (added)
+++ felix/trunk/framework/src/test/java/org/apache/felix/framework/BundleWiringImplTest.java Thu Nov 20 13:45:36 2014
@@ -0,0 +1,53 @@
+/*
+ * 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.felix.framework;
+
+import static org.junit.Assert.*;
+
+import java.lang.reflect.Constructor;
+
+import org.apache.felix.framework.BundleWiringImpl.BundleClassLoader;
+import org.junit.Before;
+import org.junit.Test;
+
+public class BundleWiringImplTest 
+{
+
+	private BundleWiringImpl bundleWiring;
+	
+	private BundleClassLoader bundleClassLoader;
+	
+	@Before
+	public void setUp() throws Exception 
+	{
+		Logger logger = new Logger();
+		Constructor ctor = BundleRevisionImpl.getSecureAction()
+                .getConstructor(BundleClassLoader.class, new Class[] { BundleWiringImpl.class, ClassLoader.class, Logger.class });
+            bundleClassLoader = (BundleClassLoader)
+                BundleRevisionImpl.getSecureAction().invoke(ctor,
+                new Object[] { bundleWiring, this.getClass().getClassLoader(), logger });
+	}
+
+	@Test
+	public void testBundleClassLoader() 
+	{
+		assertNotNull(bundleClassLoader);
+	}
+
+}