aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjwat...@apache.org
Subject svn commit: r1613136 [2/2] - in /aries/branches/subsystemsR6: ./ blueprint/ blueprint/blueprint-authz/ blueprint/blueprint-bundle/ blueprint/blueprint-compatibility/ blueprint/blueprint-core/ blueprint/blueprint-core/src/main/java/org/apache/aries/blue...
Date Thu, 24 Jul 2014 13:55:50 GMT
Modified: aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
(original)
+++ aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/CountingEntityManagerFactory.java
Thu Jul 24 13:55:49 2014
@@ -18,15 +18,11 @@
  */
 package org.apache.aries.jpa.container.impl;
 
-
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 
-import javax.persistence.Cache;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnitUtil;
+import javax.persistence.*;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.metamodel.Metamodel;
 
@@ -39,94 +35,123 @@ import org.osgi.framework.ServiceRegistr
  * so that it can be quiesced
  */
 public class CountingEntityManagerFactory implements EntityManagerFactory, DestroyCallback
{
-  /** Number of open EntityManagers */
-  private final AtomicLong count = new AtomicLong(0);
-  /** The real EMF */
-  private final EntityManagerFactory delegate;
-  /** The name of this unit */
-  private final String name;
-  /** A quiesce callback to call */
-  private final AtomicReference<NamedCallback> callback = new AtomicReference<NamedCallback>();
-  /** The service registration to unregister if we can quiesce */
-  private final AtomicReference<ServiceRegistration> reg = new AtomicReference<ServiceRegistration>();
-  
-  
-  public CountingEntityManagerFactory(
-      EntityManagerFactory containerEntityManagerFactory, String name) {
-    delegate = containerEntityManagerFactory;
-    this.name = name;
-  }
-
-  public void close() {
-    delegate.close();
-  }
-
-  public EntityManager createEntityManager() {
-    EntityManager em = delegate.createEntityManager();
-    count.incrementAndGet();
-    return new EntityManagerWrapper(em, this);
-  }
-
-  public EntityManager createEntityManager(Map arg0) {
-    EntityManager em = delegate.createEntityManager(arg0);
-    count.incrementAndGet();
-    return new EntityManagerWrapper(em, this);
-  }
-
-  public Cache getCache() {
-    return delegate.getCache();
-  }
-
-  public CriteriaBuilder getCriteriaBuilder() {
-    return delegate.getCriteriaBuilder();
-  }
-
-  public Metamodel getMetamodel() {
-    return delegate.getMetamodel();
-  }
-
-  public PersistenceUnitUtil getPersistenceUnitUtil() {
-    return delegate.getPersistenceUnitUtil();
-  }
-
-  public Map<String, Object> getProperties() {
-    return delegate.getProperties();
-  }
-
-  public boolean isOpen() {
-    return delegate.isOpen();
-  }
-
-  public void quiesce(NamedCallback callback, ServiceRegistration reg) {
-    this.reg.compareAndSet(null, reg);
-    this.callback.compareAndSet(null, callback);
-    if(count.get() == 0) {
-      AriesFrameworkUtil.safeUnregisterService(this.reg.getAndSet(null));
-      this.callback.set(null);
-      callback.callback(name);
-    }
-  }
-
-  public void callback() {
-    
-    if(count.decrementAndGet() == 0) {
-      NamedCallback c = callback.getAndSet(null);
-      if(c != null) {
-        AriesFrameworkUtil.safeUnregisterService(reg.getAndSet(null));
-        c.callback(name);
-      }
-    }
-      
-  }
-
-  public void clearQuiesce() {
-    //We will already be unregistered
-    reg.set(null);
-    NamedCallback c = callback.getAndSet(null);
-    //If there was a callback then call it in case time hasn't run out.
-    if(c != null) {
-      c.callback(name);
+
+    /**
+     * Number of open EntityManagers
+     */
+    private final AtomicLong count = new AtomicLong(0);
+    /**
+     * The real EMF
+     */
+    private final EntityManagerFactory delegate;
+    /**
+     * The name of this unit
+     */
+    private final String name;
+    /**
+     * A quiesce callback to call
+     */
+    private final AtomicReference<NamedCallback> callback = new AtomicReference<NamedCallback>();
+    /**
+     * The service registration to unregister if we can quiesce
+     */
+    private final AtomicReference<ServiceRegistration> reg = new AtomicReference<ServiceRegistration>();
+
+
+    public CountingEntityManagerFactory(
+            EntityManagerFactory containerEntityManagerFactory, String name) {
+        delegate = containerEntityManagerFactory;
+        this.name = name;
+    }
+
+    public void close() {
+        delegate.close();
+    }
+
+    public EntityManager createEntityManager() {
+        EntityManager em = delegate.createEntityManager();
+        count.incrementAndGet();
+        return new EntityManagerWrapper(em, this);
+    }
+
+    public EntityManager createEntityManager(Map arg0) {
+        EntityManager em = delegate.createEntityManager(arg0);
+        count.incrementAndGet();
+        return new EntityManagerWrapper(em, this);
+    }
+
+    public Cache getCache() {
+        return delegate.getCache();
+    }
+
+    public CriteriaBuilder getCriteriaBuilder() {
+        return delegate.getCriteriaBuilder();
+    }
+
+    public Metamodel getMetamodel() {
+        return delegate.getMetamodel();
+    }
+
+    public PersistenceUnitUtil getPersistenceUnitUtil() {
+        return delegate.getPersistenceUnitUtil();
+    }
+
+    public Map<String, Object> getProperties() {
+        return delegate.getProperties();
+    }
+
+    public boolean isOpen() {
+        return delegate.isOpen();
+    }
+
+    public void quiesce(NamedCallback callback, ServiceRegistration reg) {
+        this.reg.compareAndSet(null, reg);
+        this.callback.compareAndSet(null, callback);
+        if (count.get() == 0) {
+            AriesFrameworkUtil.safeUnregisterService(this.reg.getAndSet(null));
+            this.callback.set(null);
+            callback.callback(name);
+        }
+    }
+
+    public void callback() {
+        if (count.decrementAndGet() == 0) {
+            NamedCallback c = callback.getAndSet(null);
+            if (c != null) {
+                AriesFrameworkUtil.safeUnregisterService(reg.getAndSet(null));
+                c.callback(name);
+            }
+        }
+    }
+
+    public void clearQuiesce() {
+        //We will already be unregistered
+        reg.set(null);
+        NamedCallback c = callback.getAndSet(null);
+        //If there was a callback then call it in case time hasn't run out.
+        if (c != null) {
+            c.callback(name);
+        }
+    }
+
+    public <T> void addNamedEntityGraph(String arg0, EntityGraph<T> arg1) {
+        delegate.addNamedEntityGraph(arg0, arg1);
+    }
+
+    public void addNamedQuery(String arg0, Query arg1) {
+        delegate.addNamedQuery(arg0, arg1);
+    }
+
+    public EntityManager createEntityManager(SynchronizationType arg0) {
+        return delegate.createEntityManager(arg0);
+    }
+
+    public EntityManager createEntityManager(SynchronizationType arg0, Map arg1) {
+        return delegate.createEntityManager(arg0, arg1);
+    }
+
+    public <T> T unwrap(Class<T> arg0) {
+        return delegate.unwrap(arg0);
     }
-  }
 
 }

Modified: aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerWrapper.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerWrapper.java?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerWrapper.java
(original)
+++ aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerWrapper.java
Thu Jul 24 13:55:49 2014
@@ -18,194 +18,238 @@
  */
 package org.apache.aries.jpa.container.impl;
 
+import java.util.List;
 import java.util.Map;
 
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.FlushModeType;
-import javax.persistence.LockModeType;
-import javax.persistence.Query;
-import javax.persistence.TypedQuery;
+import javax.persistence.*;
 import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaDelete;
 import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.CriteriaUpdate;
 import javax.persistence.metamodel.Metamodel;
 
 /**
  * Wrapper an EntityManager so that we know when it has been closed
  */
 public class EntityManagerWrapper implements EntityManager {
-  
-  private final EntityManager delegate;
-  /** Call this when the EntityManager is closed */
-  private final DestroyCallback callback;
-
-  public EntityManagerWrapper(EntityManager em, DestroyCallback callback) {
-    delegate = em;
-    this.callback = callback;
-  }
-
-  public void clear() {
-    delegate.clear();
-  }
-
-  public void close() {
-    delegate.close();
-    //This will only ever be called once, the second time there
-    //will be an IllegalStateException from the line above
-    callback.callback();
-  }
-
-  public boolean contains(Object arg0) {
-    return delegate.contains(arg0);
-  }
-
-  public <T> TypedQuery<T> createNamedQuery(String arg0, Class<T> arg1)
{
-    return delegate.createNamedQuery(arg0, arg1);
-  }
-
-  public Query createNamedQuery(String arg0) {
-    return delegate.createNamedQuery(arg0);
-  }
-
-  public Query createNativeQuery(String arg0, Class arg1) {
-    return delegate.createNativeQuery(arg0, arg1);
-  }
-
-  public Query createNativeQuery(String arg0, String arg1) {
-    return delegate.createNativeQuery(arg0, arg1);
-  }
-
-  public Query createNativeQuery(String arg0) {
-    return delegate.createNativeQuery(arg0);
-  }
-
-  public <T> TypedQuery<T> createQuery(CriteriaQuery<T> arg0) {
-    return delegate.createQuery(arg0);
-  }
-
-  public <T> TypedQuery<T> createQuery(String arg0, Class<T> arg1) {
-    return delegate.createQuery(arg0, arg1);
-  }
-
-  public Query createQuery(String arg0) {
-    return delegate.createQuery(arg0);
-  }
-
-  public void detach(Object arg0) {
-    delegate.detach(arg0);
-  }
-
-  public <T> T find(Class<T> arg0, Object arg1, LockModeType arg2,
-      Map<String, Object> arg3) {
-    return delegate.find(arg0, arg1, arg2, arg3);
-  }
-
-  public <T> T find(Class<T> arg0, Object arg1, LockModeType arg2) {
-    return delegate.find(arg0, arg1, arg2);
-  }
-
-  public <T> T find(Class<T> arg0, Object arg1, Map<String, Object> arg2)
{
-    return delegate.find(arg0, arg1, arg2);
-  }
-
-  public <T> T find(Class<T> arg0, Object arg1) {
-    return delegate.find(arg0, arg1);
-  }
-
-  public void flush() {
-    delegate.flush();
-  }
-
-  public CriteriaBuilder getCriteriaBuilder() {
-    return delegate.getCriteriaBuilder();
-  }
-
-  public Object getDelegate() {
-    return delegate.getDelegate();
-  }
-
-  public EntityManagerFactory getEntityManagerFactory() {
-    return delegate.getEntityManagerFactory();
-  }
-
-  public FlushModeType getFlushMode() {
-    return delegate.getFlushMode();
-  }
-
-  public LockModeType getLockMode(Object arg0) {
-    return delegate.getLockMode(arg0);
-  }
-
-  public Metamodel getMetamodel() {
-    return delegate.getMetamodel();
-  }
-
-  public Map<String, Object> getProperties() {
-    return delegate.getProperties();
-  }
-
-  public <T> T getReference(Class<T> arg0, Object arg1) {
-    return delegate.getReference(arg0, arg1);
-  }
-
-  public EntityTransaction getTransaction() {
-    return delegate.getTransaction();
-  }
-
-  public boolean isOpen() {
-    return delegate.isOpen();
-  }
-
-  public void joinTransaction() {
-    delegate.joinTransaction();
-  }
-
-  public void lock(Object arg0, LockModeType arg1, Map<String, Object> arg2) {
-    delegate.lock(arg0, arg1, arg2);
-  }
-
-  public void lock(Object arg0, LockModeType arg1) {
-    delegate.lock(arg0, arg1);
-  }
-
-  public <T> T merge(T arg0) {
-    return delegate.merge(arg0);
-  }
-
-  public void persist(Object arg0) {
-    delegate.persist(arg0);
-  }
-
-  public void refresh(Object arg0, LockModeType arg1, Map<String, Object> arg2) {
-    delegate.refresh(arg0, arg1, arg2);
-  }
-
-  public void refresh(Object arg0, LockModeType arg1) {
-    delegate.refresh(arg0, arg1);
-  }
-
-  public void refresh(Object arg0, Map<String, Object> arg1) {
-    delegate.refresh(arg0, arg1);
-  }
-
-  public void refresh(Object arg0) {
-    delegate.refresh(arg0);
-  }
-
-  public void remove(Object arg0) {
-    delegate.remove(arg0);
-  }
-
-  public void setFlushMode(FlushModeType arg0) {
-    delegate.setFlushMode(arg0);
-  }
-
-  public void setProperty(String arg0, Object arg1) {
-    delegate.setProperty(arg0, arg1);
-  }
-
-  public <T> T unwrap(Class<T> arg0) {
-    return delegate.unwrap(arg0);
-  }
+
+    private final EntityManager delegate;
+    /**
+     * Call this when the EntityManager is closed
+     */
+    private final DestroyCallback callback;
+
+    public EntityManagerWrapper(EntityManager em, DestroyCallback callback) {
+        delegate = em;
+        this.callback = callback;
+    }
+
+    public void clear() {
+        delegate.clear();
+    }
+
+    public void close() {
+        delegate.close();
+        //This will only ever be called once, the second time there
+        //will be an IllegalStateException from the line above
+        callback.callback();
+    }
+
+    public boolean contains(Object arg0) {
+        return delegate.contains(arg0);
+    }
+
+    public <T> TypedQuery<T> createNamedQuery(String arg0, Class<T> arg1)
{
+        return delegate.createNamedQuery(arg0, arg1);
+    }
+
+    public Query createNamedQuery(String arg0) {
+        return delegate.createNamedQuery(arg0);
+    }
+
+    public StoredProcedureQuery createNamedStoredProcedureQuery(String arg0) {
+        return delegate.createNamedStoredProcedureQuery(arg0);
+    }
+
+    public StoredProcedureQuery createStoredProcedureQuery(String arg0) {
+        return delegate.createStoredProcedureQuery(arg0);
+    }
+
+    public StoredProcedureQuery createStoredProcedureQuery(String arg0, Class ... arg1) {
+        return delegate.createStoredProcedureQuery(arg0, arg1);
+    }
+
+    public StoredProcedureQuery createStoredProcedureQuery(String arg0, String ... arg1)
{
+        return delegate.createStoredProcedureQuery(arg0, arg1);
+    }
+
+    public Query createNativeQuery(String arg0, Class arg1) {
+        return delegate.createNativeQuery(arg0, arg1);
+    }
+
+    public Query createNativeQuery(String arg0, String arg1) {
+        return delegate.createNativeQuery(arg0, arg1);
+    }
+
+    public Query createNativeQuery(String arg0) {
+        return delegate.createNativeQuery(arg0);
+    }
+
+    public <T> TypedQuery<T> createQuery(CriteriaQuery<T> arg0) {
+        return delegate.createQuery(arg0);
+    }
+
+    public <T> TypedQuery<T> createQuery(String arg0, Class<T> arg1) {
+        return delegate.createQuery(arg0, arg1);
+    }
+
+    public Query createQuery(String arg0) {
+        return delegate.createQuery(arg0);
+    }
+
+    public Query createQuery(CriteriaUpdate arg0) {
+        return delegate.createQuery(arg0);
+    }
+
+    public Query createQuery(CriteriaDelete arg0) {
+        return delegate.createQuery(arg0);
+    }
+
+    public void detach(Object arg0) {
+        delegate.detach(arg0);
+    }
+
+    public <T> T find(Class<T> arg0, Object arg1, LockModeType arg2,
+                      Map<String, Object> arg3) {
+        return delegate.find(arg0, arg1, arg2, arg3);
+    }
+
+    public <T> T find(Class<T> arg0, Object arg1, LockModeType arg2) {
+        return delegate.find(arg0, arg1, arg2);
+    }
+
+    public <T> T find(Class<T> arg0, Object arg1, Map<String, Object> arg2)
{
+        return delegate.find(arg0, arg1, arg2);
+    }
+
+    public <T> T find(Class<T> arg0, Object arg1) {
+        return delegate.find(arg0, arg1);
+    }
+
+    public void flush() {
+        delegate.flush();
+    }
+
+    public CriteriaBuilder getCriteriaBuilder() {
+        return delegate.getCriteriaBuilder();
+    }
+
+    public Object getDelegate() {
+        return delegate.getDelegate();
+    }
+
+    public EntityManagerFactory getEntityManagerFactory() {
+        return delegate.getEntityManagerFactory();
+    }
+
+    public FlushModeType getFlushMode() {
+        return delegate.getFlushMode();
+    }
+
+    public LockModeType getLockMode(Object arg0) {
+        return delegate.getLockMode(arg0);
+    }
+
+    public Metamodel getMetamodel() {
+        return delegate.getMetamodel();
+    }
+
+    public Map<String, Object> getProperties() {
+        return delegate.getProperties();
+    }
+
+    public <T> T getReference(Class<T> arg0, Object arg1) {
+        return delegate.getReference(arg0, arg1);
+    }
+
+    public EntityTransaction getTransaction() {
+        return delegate.getTransaction();
+    }
+
+    public boolean isOpen() {
+        return delegate.isOpen();
+    }
+
+    public void joinTransaction() {
+        delegate.joinTransaction();
+    }
+
+    public boolean isJoinedToTransaction() {
+        return delegate.isJoinedToTransaction();
+    }
+
+    public void lock(Object arg0, LockModeType arg1, Map<String, Object> arg2) {
+        delegate.lock(arg0, arg1, arg2);
+    }
+
+    public void lock(Object arg0, LockModeType arg1) {
+        delegate.lock(arg0, arg1);
+    }
+
+    public <T> T merge(T arg0) {
+        return delegate.merge(arg0);
+    }
+
+    public void persist(Object arg0) {
+        delegate.persist(arg0);
+    }
+
+    public void refresh(Object arg0, LockModeType arg1, Map<String, Object> arg2) {
+        delegate.refresh(arg0, arg1, arg2);
+    }
+
+    public void refresh(Object arg0, LockModeType arg1) {
+        delegate.refresh(arg0, arg1);
+    }
+
+    public void refresh(Object arg0, Map<String, Object> arg1) {
+        delegate.refresh(arg0, arg1);
+    }
+
+    public void refresh(Object arg0) {
+        delegate.refresh(arg0);
+    }
+
+    public void remove(Object arg0) {
+        delegate.remove(arg0);
+    }
+
+    public void setFlushMode(FlushModeType arg0) {
+        delegate.setFlushMode(arg0);
+    }
+
+    public void setProperty(String arg0, Object arg1) {
+        delegate.setProperty(arg0, arg1);
+    }
+
+    public <T> T unwrap(Class<T> arg0) {
+        return delegate.unwrap(arg0);
+    }
+
+    public <T> EntityGraph<T> createEntityGraph(Class<T> arg0) {
+        return delegate.createEntityGraph(arg0);
+    }
+
+    public EntityGraph<?> createEntityGraph(String arg0) {
+        return delegate.createEntityGraph(arg0);
+    }
+
+    public EntityGraph<?> getEntityGraph(String arg0) {
+        return delegate.getEntityGraph(arg0);
+    }
+
+    public <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T>
arg0) {
+        return delegate.getEntityGraphs(arg0);
+    }
+
 }

Modified: aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
(original)
+++ aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
Thu Jul 24 13:55:49 2014
@@ -20,6 +20,8 @@
 package org.apache.aries.jpa.container.impl;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -485,7 +487,26 @@ public class PersistenceBundleManager im
     boolean maxExclusive = false;
     
     for(VersionRange range : versionRanges) {
-      int minComparison = minVersion.compareTo(range.getMinimumVersion());
+      int minComparison = 0;
+      try {
+        minComparison = minVersion.compareTo(range.getMinimumVersion());
+      } catch (Exception t) {
+        // this is to catch a NoSuchMethodException that occurs due to a building against
a newer version of OSGi than
+        // the one run with, need to call using Object version of method
+        try {
+          Method m = minVersion.getClass().getMethod("compareTo", Object.class);
+          Object ret = m.invoke(minVersion, range.getMinimumVersion());
+          minComparison = ((Integer) ret).intValue();
+        } catch (NoSuchMethodException e) {
+          throw new RuntimeException("PersistenceBundleManager.combineVersionRanges reflection
compareTo failed",e);
+        } catch (IllegalAccessException e) {
+          throw new RuntimeException("PersistenceBundleManager.combineVersionRanges reflection
compareTo failed",e);
+        } catch (IllegalArgumentException e) {
+          throw new RuntimeException("PersistenceBundleManager.combineVersionRanges reflection
compareTo failed",e);
+        } catch (InvocationTargetException e) {
+          throw new RuntimeException("PersistenceBundleManager.combineVersionRanges reflection
compareTo failed",e);
+        }
+      }
       //If minVersion is smaller then we have a new, larger, minimum
       if(minComparison < 0) {
         minVersion = range.getMinimumVersion();

Modified: aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/ManagedPersistenceUnitInfoFactoryImpl.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/ManagedPersistenceUnitInfoFactoryImpl.java?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/ManagedPersistenceUnitInfoFactoryImpl.java
(original)
+++ aries/branches/subsystemsR6/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/ManagedPersistenceUnitInfoFactoryImpl.java
Thu Jul 24 13:55:49 2014
@@ -57,7 +57,7 @@ public class ManagedPersistenceUnitInfoF
   public void destroyPersistenceBundle(BundleContext containerContext, Bundle bundle) {
     Collection<ManagedPersistenceUnitInfoImpl> mpus = persistenceUnits.remove(bundle);
     if(mpus == null)
-      throw new IllegalStateException(NLS.MESSAGES.getMessage("no.persistence.units.for.bundle",
bundle.getSymbolicName(), bundle.getVersion()));
+      return; // already destroyed
     for(ManagedPersistenceUnitInfoImpl impl : mpus) {
       impl.destroy();
     }

Modified: aries/branches/subsystemsR6/proxy/proxy-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-bundle/pom.xml?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-bundle/pom.xml (original)
+++ aries/branches/subsystemsR6/proxy/proxy-bundle/pom.xml Thu Jul 24 13:55:49 2014
@@ -73,13 +73,13 @@
         <dependency>
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.api</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
+            <version>1.0.2-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.impl</artifactId>
-            <version>1.0.3-SNAPSHOT</version>
+            <version>1.0.4-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml (original)
+++ aries/branches/subsystemsR6/proxy/proxy-itests/pom.xml Thu Jul 24 13:55:49 2014
@@ -69,13 +69,13 @@
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.api</artifactId>
             <scope>test</scope>
-            <version>1.0.1-SNAPSHOT</version>
+            <version>1.0.2-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.impl</artifactId>
             <scope>test</scope>
-            <version>1.0.3-SNAPSHOT</version>
+            <version>1.0.4-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries</groupId>

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java
(original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java
Thu Jul 24 13:55:49 2014
@@ -66,10 +66,16 @@ public class SubsystemResourceUninstalle
 	private void removeReferences() {
 		if (!isExplicit()) {
 			removeReference();
-			return;
 		}
-		for (Subsystem subsystem : ((BasicSubsystem)resource).getParents())
-			removeReference((BasicSubsystem)subsystem, (BasicSubsystem)resource);
+		else {
+			for (Subsystem subsystem : ((BasicSubsystem)resource).getParents())
+				removeReference((BasicSubsystem)subsystem, (BasicSubsystem)resource);
+			Subsystems subsystems = Activator.getInstance().getSubsystems();
+			// for explicit uninstall remove all references to subsystem.
+			for (BasicSubsystem s : subsystems.getSubsystemsReferencing(resource)) {
+				removeReference(s, resource);
+			}
+		}
 	}
 	
 	private void removeSubsystem() {

Modified: aries/branches/subsystemsR6/transaction/transaction-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/transaction/transaction-itests/pom.xml?rev=1613136&r1=1613135&r2=1613136&view=diff
==============================================================================
--- aries/branches/subsystemsR6/transaction/transaction-itests/pom.xml (original)
+++ aries/branches/subsystemsR6/transaction/transaction-itests/pom.xml Thu Jul 24 13:55:49
2014
@@ -60,7 +60,7 @@
             <groupId>org.apache.aries.proxy</groupId>
             <artifactId>org.apache.aries.proxy.impl</artifactId>
             <scope>test</scope>
-            <version>1.0.3-SNAPSHOT</version>
+            <version>1.0.3</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.transaction</groupId>



Mime
View raw message