diff --git a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
index ed0f52b..c5a1011 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleContextImpl.java
@@ -529,6 +529,14 @@
     public <S> ServiceObjects<S> getServiceObjects(final ServiceReference<S> ref)
     {
     	checkValidity();
+
+        Object sm = System.getSecurityManager();
+
+        if (sm != null)
+        {
+           ((SecurityManager) sm).checkPermission(new ServicePermission(ref, ServicePermission.GET));
+        }
+
         ServiceRegistrationImpl reg =
                 ((ServiceRegistrationImpl.ServiceReferenceImpl) ref).getRegistration();
         if ( reg.isValid() )
@@ -546,7 +554,7 @@
         private final ServiceReference<S> m_ref;
 
         private final List<S> srvObjects = new ArrayList<S>();
-        
+
         public ServiceObjectsImpl(final ServiceReference<S> ref)
         {
             this.m_ref = ref;
@@ -572,21 +580,21 @@
                 }
 
                 srvObj = m_felix.getService(m_bundle, m_ref, true);
-            } 
-            else 
+            }
+            else
             {
             	// getService handles singleton and bundle scope
             	srvObj = BundleContextImpl.this.getService(m_ref);
             }
-            
+
             if ( srvObj != null )
             {
             	synchronized ( srvObjects )
             	{
             		srvObjects.add(srvObj);
             	}
-            } 
-            
+            }
+
             return srvObj;
         }
 
@@ -595,22 +603,22 @@
         	if ( srvObj != null )
         	{
                 // check if this object was returned by this service objects
-                synchronized ( srvObjects ) 
+                synchronized ( srvObjects )
                 {
 	                boolean found = false;
 	                int i = 0;
-	                while ( !found && i < srvObjects.size() ) 
+	                while ( !found && i < srvObjects.size() )
 	                {
 	                	found = srvObjects.get(i) == srvObj;
 	                	i++;
 	                }
-	                if ( !found ) 
+	                if ( !found )
 	                {
-	                	throw new IllegalArgumentException();	                	
+	                	throw new IllegalArgumentException();
 	                }
 	                srvObjects.remove(i-1);
                 }
-        		
+
         	}
             // special handling for prototype scope
             if ( m_ref.getProperty(Constants.SERVICE_SCOPE) == Constants.SCOPE_PROTOTYPE )
@@ -618,7 +626,7 @@
                 checkValidity();
 
                 // Unget the specified service.
-                if ( !m_felix.ungetService(m_bundle, m_ref, srvObj) ) 
+                if ( !m_felix.ungetService(m_bundle, m_ref, srvObj) )
                 {
                 	throw new IllegalArgumentException();
                 }
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java b/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
index 5247ab2..9c3befc 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
@@ -33,6 +33,8 @@
 import java.net.URLStreamHandler;
 import java.security.CodeSource;
 import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
 import java.security.ProtectionDomain;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
@@ -44,6 +46,7 @@
 import java.util.jar.JarOutputStream;
 import org.apache.felix.framework.cache.Content;
 import org.apache.felix.framework.cache.JarContent;
+import org.osgi.framework.PackagePermission;
 
 import org.osgi.framework.wiring.BundleRevision;
 
@@ -372,6 +375,7 @@
     private final int m_hashCode;
     private final String m_toString;
     private final WeakReference m_revision;
+    private volatile PermissionCollection m_woven;
 
     BundleProtectionDomain(Felix felix, BundleImpl bundle, Object certificates)
         throws MalformedURLException
@@ -412,6 +416,20 @@
             felix.impliesBundlePermission(this, permission, true) : false;
     }
 
+    boolean impliesWoven(Permission permission)
+    {
+        return m_woven != null && m_woven.implies(permission);
+    }
+
+    synchronized void addWoven(String s)
+    {
+        if (m_woven == null)
+        {
+            m_woven = new Permissions();
+        }
+        m_woven.add(new PackagePermission(s, PackagePermission.IMPORT));
+    }
+
     BundleImpl getBundle()
     {
         return (BundleImpl) m_bundle.get();
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
index cd345cc..8e984cd 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
@@ -2075,23 +2075,23 @@
                     // as a race condition, doing any necessary clean up in
                     // the error handling.
                     Felix felix = ((BundleImpl) m_wiring.m_revision.getBundle()).getFramework();
-                    
+
                     Set<ServiceReference<WeavingHook>> hooks =
                         felix.getHooks(WeavingHook.class);
-                    
-                    Set<ServiceReference<WovenClassListener>> wovenClassListeners = 
+
+                    Set<ServiceReference<WovenClassListener>> wovenClassListeners =
                         felix.getHooks(WovenClassListener.class);
-                    
+
                     WovenClassImpl wci = null;
                     if (!hooks.isEmpty())
                     {
                         // Create woven class to be used for hooks.
                         wci = new WovenClassImpl(name, m_wiring, bytes);
-                        try 
+                        try
                         {
                             transformClass(felix, wci, hooks, wovenClassListeners,
                                     name, bytes);
-                        } 
+                        }
                         catch (Error e)
                         {
                             // Mark the woven class as incomplete.
@@ -2129,12 +2129,12 @@
                         }
                     }
 
-                    try 
+                    try
                     {
                         clazz = defineClass(felix, wovenClassListeners, wci, name,
                                 clazz, bytes, content, pkgName, lock);
-                    } 
-                    catch (ClassFormatError e) 
+                    }
+                    catch (ClassFormatError e)
                     {
                         if(wci != null)
                         {
@@ -2182,7 +2182,7 @@
                 Set<ServiceReference<WovenClassListener>> wovenClassListeners,
                 WovenClassImpl wci, String name, Class clazz, byte[] bytes,
                 Content content, String pkgName, Object lock)
-                        throws ClassFormatError 
+                        throws ClassFormatError
         {
 
             try
@@ -2385,7 +2385,7 @@
                 Set<ServiceReference<WeavingHook>> hooks,
                 Set<ServiceReference<WovenClassListener>> wovenClassListeners,
                 String name, byte[] bytes) throws Error {
-      
+
             // Loop through hooks in service ranking order.
             for (ServiceReference<WeavingHook> sr : hooks)
             {
@@ -2430,7 +2430,7 @@
             wci.setState(WovenClass.TRANSFORMED);
             callWovenClassListeners(felix, wovenClassListeners, wci);
         }
-        
+
         protected void callWovenClassListeners(Felix felix, Set<ServiceReference<WovenClassListener>> wovenClassListeners, WovenClass wovenClass)
         {
             if(wovenClassListeners != null)
@@ -2438,15 +2438,15 @@
                 for(ServiceReference<WovenClassListener> currentWovenClassListenerRef : wovenClassListeners)
                 {
                     WovenClassListener currentWovenClassListner = felix.getService(felix, currentWovenClassListenerRef, false);
-                    try 
+                    try
                     {
                         BundleRevisionImpl.getSecureAction().invokeWovenClassListener(currentWovenClassListner, wovenClass);
-                    } 
-                    catch (Exception e) 
+                    }
+                    catch (Exception e)
                     {
                         m_logger.log(Logger.LOG_ERROR, "Woven Class Listner failed.", e);
-                    } 
-                    finally 
+                    }
+                    finally
                     {
                         felix.ungetService(felix, currentWovenClassListenerRef, null);
                     }
diff --git a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
index f146e7a..541365b 100644
--- a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
+++ b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
@@ -54,6 +54,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
+import org.osgi.framework.FrameworkEvent;
 import org.osgi.framework.Version;
 import org.osgi.framework.namespace.NativeNamespace;
 import org.osgi.framework.wiring.BundleCapability;
@@ -141,6 +142,22 @@
     private volatile Bundle[] m_extensionsCache;
     private final Set m_names;
     private final Map m_sourceToExtensions;
+    private final List<ExtensionTuple> m_extensionTuples = Collections.synchronizedList(new ArrayList<ExtensionTuple>());
+
+    private static class ExtensionTuple
+    {
+        private final BundleActivator m_activator;
+        private final Bundle m_bundle;
+        private volatile boolean m_failed;
+        private volatile boolean m_started;
+
+        public ExtensionTuple(BundleActivator activator, Bundle bundle)
+        {
+            m_activator = activator;
+            m_bundle = bundle;
+        }
+
+    }
 
     // This constructor is only used for the private instance added to the parent
     // classloader.
@@ -406,7 +423,7 @@
             {
                 exports = ManifestParser.parseExportHeader(
                     m_logger, m_systemBundleRevision,
-                    (String) ((BundleRevisionImpl) bundle.adapt(BundleRevision.class))
+                    (String) ((BundleRevisionImpl) bundle.adapt(BundleRevisionImpl.class))
                         .getHeaders().get(Constants.EXPORT_PACKAGE),
                     m_systemBundleRevision.getSymbolicName(), m_systemBundleRevision.getVersion());
                 exports = aliasSymbolicName(exports);
@@ -417,7 +434,7 @@
                     bundle,
                     Logger.LOG_ERROR,
                     "Error parsing extension bundle export statement: "
-                    + ((BundleRevisionImpl) bundle.adapt(BundleRevision.class))
+                    + ((BundleRevisionImpl) bundle.adapt(BundleRevisionImpl.class))
                         .getHeaders().get(Constants.EXPORT_PACKAGE), ex);
                 return;
             }
@@ -443,7 +460,7 @@
             throw ex;
         }
 
-        BundleRevisionImpl bri = (BundleRevisionImpl) bundle.adapt(BundleRevision.class);
+        BundleRevisionImpl bri = (BundleRevisionImpl) bundle.adapt(BundleRevisionImpl.class);
         List<BundleRequirement> reqs = bri.getDeclaredRequirements(BundleRevision.HOST_NAMESPACE);
         List<BundleCapability> caps = getCapabilities(BundleRevision.HOST_NAMESPACE);
         BundleWire bw = new BundleWireImpl(bri, reqs.get(0), m_systemBundleRevision, caps.get(0));
@@ -470,13 +487,18 @@
      */
     void startExtensionBundle(Felix felix, BundleImpl bundle)
     {
-        Dictionary<?,?> headers = bundle.getHeaders();
+        Map<?,?> headers = bundle.adapt(BundleRevisionImpl.class).getHeaders();
         String activatorClass = (String) headers.get(Constants.EXTENSION_BUNDLE_ACTIVATOR);
+        boolean felixExtension = false;
         if (activatorClass == null)
+        {
+            felixExtension = true;
             activatorClass = (String) headers.get(FelixConstants.FELIX_EXTENSION_ACTIVATOR);
+        }
 
         if (activatorClass != null)
         {
+            ExtensionTuple tuple = null;
             try
             {
 // TODO: SECURITY - Should this consider security?
@@ -484,26 +506,93 @@
                     felix.getClass().getClassLoader().loadClass(
                         activatorClass.trim()).newInstance();
 
-// TODO: EXTENSIONMANAGER - This is kind of hacky, can we improve it?
-                felix.m_activatorList.add(activator);
-
                 BundleContext context = felix._getBundleContext();
 
                 bundle.setBundleContext(context);
 
+// TODO: EXTENSIONMANAGER - This is kind of hacky, can we improve it?
+                if (!felixExtension)
+                {
+                    tuple = new ExtensionTuple(activator, bundle);
+                    m_extensionTuples.add(tuple);
+                }
+                else
+                {
+                    felix.m_activatorList.add(activator);
+                }
+
                 if ((felix.getState() == Bundle.ACTIVE) || (felix.getState() == Bundle.STARTING))
                 {
+                    if (tuple != null)
+                    {
+                        tuple.m_started = true;
+                    }
                     Felix.m_secureAction.startActivator(activator, context);
                 }
             }
             catch (Throwable ex)
             {
+                if (tuple != null)
+                {
+                    tuple.m_failed = true;
+                }
+                felix.fireFrameworkEvent(FrameworkEvent.ERROR, bundle,
+                            new BundleException("Unable to start Bundle", ex));
+
                 m_logger.log(bundle, Logger.LOG_WARNING,
                     "Unable to start Extension Activator", ex);
             }
         }
     }
 
+    void startPendingExtensionBundles(Felix felix)
+    {
+        for (int i = 0;i < m_extensionTuples.size();i++)
+        {
+            if (!m_extensionTuples.get(i).m_started)
+            {
+                m_extensionTuples.get(i).m_started = true;
+                try
+                {
+                    Felix.m_secureAction.startActivator(m_extensionTuples.get(i).m_activator, felix._getBundleContext());
+                }
+                catch (Throwable ex)
+                {
+                    m_extensionTuples.get(i).m_failed = true;
+
+                    felix.fireFrameworkEvent(FrameworkEvent.ERROR, m_extensionTuples.get(i).m_bundle,
+                                new BundleException("Unable to start Bundle", BundleException.ACTIVATOR_ERROR, ex));
+
+                    m_logger.log(m_extensionTuples.get(i).m_bundle, Logger.LOG_WARNING,
+                        "Unable to start Extension Activator", ex);
+                }
+            }
+        }
+    }
+
+    void stopExtensionBundles(Felix felix)
+    {
+        for (int i = m_extensionTuples.size() - 1; i >= 0;i--)
+        {
+            if (m_extensionTuples.get(i).m_started && !m_extensionTuples.get(i).m_failed)
+            {
+                try
+                {
+                    Felix.m_secureAction.stopActivator(m_extensionTuples.get(i).m_activator, felix._getBundleContext());
+                }
+                catch (Throwable ex)
+                {
+                    felix.fireFrameworkEvent(FrameworkEvent.ERROR, m_extensionTuples.get(i).m_bundle,
+                                new BundleException("Unable to stop Bundle", BundleException.ACTIVATOR_ERROR, ex));
+
+                    m_logger.log(m_extensionTuples.get(i).m_bundle, Logger.LOG_WARNING,
+                        "Unable to stop Extension Activator", ex);
+                }
+            }
+        }
+        m_extensionTuples.clear();
+    }
+
     /**
      * Remove all extension registered by the given framework instance. Note, it
      * is not possible to unregister allready loaded classes form those extensions.
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index e533fde..2a409f5 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -83,6 +83,7 @@
 import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.PackagePermission;
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceException;
 import org.osgi.framework.ServiceFactory;
@@ -617,19 +618,16 @@
         return true;
     }
 
-    /**
-     * This method initializes the framework, which is comprised of resolving
-     * the system bundle, reloading any cached bundles, and activating the system
-     * bundle. The framework is left in the <tt>Bundle.STARTING</tt> state and
-     * reloaded bundles are in the <tt>Bundle.INSTALLED</tt> state. After
-     * successfully invoking this method, <tt>getBundleContext()</tt> will
-     * return a valid <tt>BundleContext</tt> for the system bundle. To finish
-     * starting the framework, invoke the <tt>start()</tt> method.
-     *
-     * @throws org.osgi.framework.BundleException if any error occurs.
-    **/
+
     public void init() throws BundleException
     {
+        init((FrameworkListener[]) null);
+    }
+    /**
+     * @see org.osgi.framework.launch.Framework#init(org.osgi.framework.FrameworkListener[])
+     */
+    public void init(final FrameworkListener... listeners) throws BundleException
+    {
         // The system bundle can only be initialized if it currently isn't started.
         acquireBundleLock(this,
             Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.ACTIVE);
@@ -825,6 +823,15 @@
                 // so create a gate for that purpose.
                 m_shutdownGate = new ThreadGate();
 
+                // add framework listeners
+                if ( listeners != null )
+                {
+                    for(final FrameworkListener fl : listeners)
+                    {
+                        addFrameworkListener(this, fl);
+                    }
+                }
+
                 // Start services
                 m_fwkWiring.start();
                 m_fwkStartLevel.start();
@@ -892,6 +899,9 @@
                     }
                 }
 
+                m_extensionManager.startPendingExtensionBundles(Felix.this);
+                m_fwkWiring.refreshBundles(null);
+
                 // Clear the cache of classes coming from the system bundle.
                 // This is only used for Felix.getBundle(Class clazz) to speed
                 // up class lookup for the system bundle.
@@ -904,6 +914,14 @@
         finally
         {
             releaseBundleLock(this);
+
+            if ( listeners != null )
+            {
+                for(final FrameworkListener fl : listeners)
+                {
+                    removeFrameworkListener(this, fl);
+                }
+            }
         }
     }
 
@@ -4398,6 +4416,13 @@
 
     boolean impliesBundlePermission(BundleProtectionDomain bundleProtectionDomain, Permission permission, boolean direct)
     {
+        if (direct && permission instanceof PackagePermission)
+        {
+            if (bundleProtectionDomain.impliesWoven(permission))
+            {
+                return true;
+            }
+        }
         if (m_securityProvider != null)
         {
             return m_securityProvider.hasBundlePermission(bundleProtectionDomain, permission, direct);
@@ -4782,10 +4807,23 @@
             m_activatorList.add(0, new URLHandlersActivator(m_configMap, Felix.this));
 
             // Start all activators.
-            for (int i = 0; i < m_activatorList.size(); i++)
+            for (Iterator<BundleActivator> iter = m_activatorList.iterator(); iter.hasNext(); )
             {
-                Felix.m_secureAction.startActivator(
-                    (BundleActivator) m_activatorList.get(i), context);
+                try
+                {
+                    Felix.m_secureAction.startActivator(
+                        iter.next(), context);
+                }
+                catch (Throwable throwable)
+                {
+                    iter.remove();
+                    fireFrameworkEvent(FrameworkEvent.ERROR, context.getBundle(),
+                            new BundleException("Unable to start Bundle", throwable));
+                    m_logger.log(
+                        Logger.LOG_WARNING,
+                        "Exception starting a system bundle activator.",
+                        throwable);
+                }
             }
         }
 
@@ -4860,6 +4898,7 @@
                 ((BundleImpl) bundles[i]).close();
             }
 
+            m_extensionManager.stopExtensionBundles(Felix.this);
             // Stop all system bundle activators.
             for (int i = 0; i < m_activatorList.size(); i++)
             {
@@ -4870,13 +4909,14 @@
                 }
                 catch (Throwable throwable)
                 {
+                    fireFrameworkEvent(FrameworkEvent.ERROR, context.getBundle(),
+                        new BundleException("Unable to stop Bundle", throwable));
                     m_logger.log(
                         Logger.LOG_WARNING,
                         "Exception stopping a system bundle activator.",
                         throwable);
                 }
             }
-
             if (m_securityManager != null)
             {
                 System.setSecurityManager(null);
@@ -5336,39 +5376,6 @@
         return m_urlHandlersActivator.getContentHandlerService(mimeType);
     }
 
-    /**
-     * @see org.osgi.framework.launch.Framework#init(org.osgi.framework.FrameworkListener[])
-     */
-    public void init(final FrameworkListener... listeners) throws BundleException
-    {
-        // add framework listeners
-        if ( listeners != null )
-        {
-            for(final FrameworkListener fl : listeners)
-            {
-                addFrameworkListener(this, fl);
-            }
-        }
-
-        // call init
-        try
-        {
-            this.init();
-        }
-
-        // remove framework listeners
-        finally
-        {
-            if ( listeners != null )
-            {
-                for(final FrameworkListener fl : listeners)
-                {
-                    removeFrameworkListener(this, fl);
-                }
-            }
-        }
-    }
-
     Collection<BundleCapability> findProviders(final Requirement requirement)
     {
         return m_resolver.findProvidersInternal(null, requirement, true, false);
diff --git a/framework/src/main/java/org/apache/felix/framework/FrameworkStartLevelImpl.java b/framework/src/main/java/org/apache/felix/framework/FrameworkStartLevelImpl.java
index 715158f..995faad 100644
--- a/framework/src/main/java/org/apache/felix/framework/FrameworkStartLevelImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/FrameworkStartLevelImpl.java
@@ -126,8 +126,10 @@
 
         synchronized (m_requests)
         {
-            // Start thread if necessary.
-            startThread();
+            if (m_thread == null)
+            {
+                throw new IllegalStateException("No inital startlevel yet");
+            }
             // Queue request.
             m_requestListeners.add(listeners);
             m_requests.add(new Integer(startlevel));
diff --git a/framework/src/main/java/org/apache/felix/framework/FrameworkWiringImpl.java b/framework/src/main/java/org/apache/felix/framework/FrameworkWiringImpl.java
index 0ab4c5e..a0173ed 100644
--- a/framework/src/main/java/org/apache/felix/framework/FrameworkWiringImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/FrameworkWiringImpl.java
@@ -125,6 +125,11 @@
                 new AdminPermission(m_felix, AdminPermission.RESOLVE));
         }
 
+        if (m_thread == null)
+        {
+            return false;
+        }
+
         return m_felix.resolveBundles(bundles);
     }
 
diff --git a/framework/src/main/java/org/apache/felix/framework/WovenClassImpl.java b/framework/src/main/java/org/apache/felix/framework/WovenClassImpl.java
index 07b7bb7..9ae77a3 100644
--- a/framework/src/main/java/org/apache/felix/framework/WovenClassImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/WovenClassImpl.java
@@ -28,8 +28,10 @@
 import org.apache.felix.framework.util.ImmutableList;
 import org.apache.felix.framework.util.manifestparser.ManifestParser;
 import org.osgi.framework.AdminPermission;
+import org.osgi.framework.PackagePermission;
 import org.osgi.framework.hooks.weaving.WovenClass;
 import org.osgi.framework.wiring.BundleRequirement;
+import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.framework.wiring.BundleWiring;
 
 class WovenClassImpl implements WovenClass, List<String>
@@ -58,13 +60,13 @@
         m_bytes = (bytes == null) ? m_bytes : bytes;
         completeImports(imports);
     }
-    
+
     synchronized void completeImports(List<String> imports)
     {
         m_imports = (imports == null) ? ImmutableList.newInstance(m_imports)
                 : ImmutableList.newInstance(imports);
     }
-    
+
     synchronized void completeDefine(Class definedClass)
     {
         m_definedClass = definedClass;
@@ -199,11 +201,22 @@
                 re.initCause(ex);
                 throw re;
             }
+            checkImport(s);
             return m_imports.add(s);
         }
         return false;
     }
 
+    private void checkImport(String s)
+    {
+        SecurityManager sm = System.getSecurityManager();
+
+        if (sm != null)
+        {
+            sm.checkPermission(new PackagePermission(s, PackagePermission.IMPORT));
+        }
+    }
+
     public synchronized boolean remove(Object o)
     {
         SecurityManager sm = System.getSecurityManager();
@@ -241,6 +254,7 @@
                 re.initCause(ex);
                 throw re;
             }
+            checkImport(s);
         }
         return m_imports.addAll(collection);
     }
@@ -267,6 +281,7 @@
                 re.initCause(ex);
                 throw re;
             }
+            checkImport(s);
         }
         return m_imports.addAll(i, collection);
     }
@@ -295,6 +310,12 @@
 
     public synchronized void clear()
     {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null)
+        {
+            sm.checkPermission(new AdminPermission(m_wiring.getBundle(),
+                    AdminPermission.WEAVE));
+        }
         m_imports.clear();
     }
 
@@ -322,6 +343,7 @@
             re.initCause(ex);
             throw re;
         }
+        checkImport(s);
         return m_imports.set(i, s);
     }
 
@@ -344,6 +366,7 @@
             re.initCause(ex);
             throw re;
         }
+        checkImport(s);
         m_imports.add(i, s);
     }
 
@@ -396,7 +419,7 @@
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.osgi.framework.hooks.weaving.WovenClass#getState()
      */
     public synchronized int getState()
@@ -412,6 +435,15 @@
                 && (state == DEFINED || state == DEFINE_FAILED || state == TRANSFORMING_FAILED))
         {
             m_isComplete = true;
+            if (state == DEFINED || state == DEFINE_FAILED)
+            {
+                BundleProtectionDomain pd = (BundleProtectionDomain)
+                    ((BundleRevisionImpl) m_wiring.getRevision()).getProtectionDomain();
+                for (String s : m_imports)
+                {
+                    pd.addWoven(s);
+                }
+            }
         }
         if(state == TRANSFORMED)
         {
diff --git a/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java b/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
index 6ea08a5..0435464 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
@@ -197,6 +197,7 @@
             catch (IllegalStateException ex)
             {
                 // Bundle context is no longer valid, so just return.
+                return null;
             }
 
             Map<BundleContext, List<ListenerInfo>> listeners = null;
diff --git a/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java b/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
index 711a62c..f7cf9b3 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/SecureAction.java
@@ -1448,7 +1448,7 @@
             rh.end();
         }
     }
-    
+
     public void invokeWovenClassListener(
             org.osgi.framework.hooks.weaving.WovenClassListener wcl,
             org.osgi.framework.hooks.weaving.WovenClass wc)
@@ -1786,6 +1786,10 @@
                 case DELETE_FILEONEXIT_ACTION:
                     ((File) arg1).deleteOnExit();
                     return null;
+                case INVOKE_WOVEN_CLASS_LISTENER:
+                    ((org.osgi.framework.hooks.weaving.WovenClassListener) arg1).modified(
+                        (org.osgi.framework.hooks.weaving.WovenClass) arg2);
+                    return null;
             }
 
             return null;
