protected synchronized ClassLoader getClassLoader(final Bundle clientBundle, Collection<Class<?>> classes) { if (clientBundle != null && clientBundle.getState() == Bundle.UNINSTALLED) { throw new IllegalStateException(NLS.MESSAGES.getMessage("bundle.uninstalled", clientBundle.getSymbolicName(), clientBundle.getVersion(), clientBundle.getBundleId())); } ClassLoader cl = null; if (classes.size() == 1) cl = classes.iterator().next().getClassLoader(); if (cl == null) { // First of all see if the AriesFrameworkUtil can get the classloader, if it can we go with that. cl = AriesFrameworkUtil.getClassLoaderForced(clientBundle); } return cl; }