use of org.apache.openejb.assembler.classic.PersistenceUnitReferenceInfo in project aries by apache.
the class RunningApplication method removedService.
public void removedService(ServiceReference reference, Object service) {
Map<Context, PersistenceUnitReferenceInfo> pUnitRefs = unitRegistrations.get(reference.getProperty(PersistenceUnitConstants.OSGI_UNIT_NAME));
Map<Context, PersistenceContextReferenceInfo> pCtxRefs = contextRegistrations.get(reference.getProperty(PersistenceUnitConstants.OSGI_UNIT_NAME));
if (pUnitRefs == null) {
pUnitRefs = new HashMap<Context, PersistenceUnitReferenceInfo>();
}
if (pCtxRefs == null) {
pCtxRefs = new HashMap<Context, PersistenceContextReferenceInfo>();
}
if (pUnitRefs.size() > 0 || pCtxRefs.size() > 0) {
for (Entry<Context, PersistenceUnitReferenceInfo> e : pUnitRefs.entrySet()) {
try {
e.getKey().unbind(e.getValue().referenceName);
} catch (NamingException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}
}
for (Entry<Context, PersistenceContextReferenceInfo> e : pCtxRefs.entrySet()) {
PersistenceContextReferenceInfo pci = e.getValue();
try {
e.getKey().unbind(pci.referenceName);
} catch (NamingException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}
}
}
}
Aggregations