public Object designateSuccessor() { List<Object> released = releaseFactories(); // Note that we do this outside of the sync block above. // This is only possible because we do additional locking outside of // this class to ensure no other threads are trying to manipulate the // list of registered factories. See Framework class the following methods: // Framework.installURLStreamHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.installContentHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.uninstallURLStreamHandlerFactory // Framework.uninstallContentHandlerFactory() if (released == null || released.isEmpty()) return getParentFactory(); Object successor = released.remove(0); try { Class<?> clazz = successor.getClass(); Method register = clazz.getMethod("register", new Class[] {Object.class}); //$NON-NLS-1$ for (Object r : released) { register.invoke(successor, new Object[] {r}); } } catch (Exception e) { container.getLogServices().log(MultiplexingFactory.class.getName(), FrameworkLogEntry.ERROR, "designateSuccessor", e); //$NON-NLS-1$ throw new RuntimeException(e.getMessage(), e); } closePackageAdminTracker(); // close tracker return successor; }
public Object designateSuccessor() { List<Object> released = releaseFactories(); // Note that we do this outside of the sync block above. // This is only possible because we do additional locking outside of // this class to ensure no other threads are trying to manipulate the // list of registered factories. See Framework class the following methods: // Framework.installURLStreamHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.installContentHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.uninstallURLStreamHandlerFactory // Framework.uninstallContentHandlerFactory() if (released == null || released.isEmpty()) return getParentFactory(); Object successor = released.remove(0); try { Class<?> clazz = successor.getClass(); Method register = clazz.getMethod("register", new Class[] {Object.class}); //$NON-NLS-1$ for (Object r : released) { register.invoke(successor, new Object[] {r}); } } catch (Exception e) { container.getLogServices().log(MultiplexingFactory.class.getName(), FrameworkLogEntry.ERROR, "designateSuccessor", e); //$NON-NLS-1$ throw new RuntimeException(e.getMessage(), e); } closePackageAdminTracker(); // close tracker return successor; }
public Object designateSuccessor() { List<Object> released = releaseFactories(); // Note that we do this outside of the sync block above. // This is only possible because we do additional locking outside of // this class to ensure no other threads are trying to manipulate the // list of registered factories. See Framework class the following methods: // Framework.installURLStreamHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.installContentHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.uninstallURLStreamHandlerFactory // Framework.uninstallContentHandlerFactory() if (released == null || released.isEmpty()) return getParentFactory(); Object successor = released.remove(0); try { Class<?> clazz = successor.getClass(); Method register = clazz.getMethod("register", new Class[] {Object.class}); //$NON-NLS-1$ for (Object r : released) { register.invoke(successor, new Object[] {r}); } } catch (Exception e) { container.getLogServices().log(MultiplexingFactory.class.getName(), FrameworkLogEntry.ERROR, "designateSuccessor", e); //$NON-NLS-1$ throw new RuntimeException(e.getMessage(), e); } closePackageAdminTracker(); // close tracker return successor; }
public Object designateSuccessor() { List<Object> released = releaseFactories(); // Note that we do this outside of the sync block above. // This is only possible because we do additional locking outside of // this class to ensure no other threads are trying to manipulate the // list of registered factories. See Framework class the following methods: // Framework.installURLStreamHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.installContentHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.uninstallURLStreamHandlerFactory // Framework.uninstallContentHandlerFactory() if (released == null || released.isEmpty()) return getParentFactory(); Object successor = released.remove(0); try { Class<?> clazz = successor.getClass(); Method register = clazz.getMethod("register", new Class[] {Object.class}); //$NON-NLS-1$ for (Object r : released) { register.invoke(successor, new Object[] {r}); } } catch (Exception e) { container.getLogServices().log(MultiplexingFactory.class.getName(), FrameworkLogEntry.ERROR, "designateSuccessor", e); //$NON-NLS-1$ throw new RuntimeException(e.getMessage(), e); } closePackageAdminTracker(); // close tracker return successor; }
public Object designateSuccessor() { List<Object> released = releaseFactories(); // Note that we do this outside of the sync block above. // This is only possible because we do additional locking outside of // this class to ensure no other threads are trying to manipulate the // list of registered factories. See Framework class the following methods: // Framework.installURLStreamHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.installContentHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.uninstallURLStreamHandlerFactory // Framework.uninstallContentHandlerFactory() if (released == null || released.isEmpty()) return getParentFactory(); Object successor = released.remove(0); try { Class<?> clazz = successor.getClass(); Method register = clazz.getMethod("register", new Class[] {Object.class}); //$NON-NLS-1$ for (Object r : released) { register.invoke(successor, new Object[] {r}); } } catch (Exception e) { container.getLogServices().log(MultiplexingFactory.class.getName(), FrameworkLogEntry.ERROR, "designateSuccessor", e); //$NON-NLS-1$ throw new RuntimeException(e.getMessage(), e); } closePackageAdminTracker(); // close tracker return successor; }
public Object designateSuccessor() { List<Object> released = releaseFactories(); // Note that we do this outside of the sync block above. // This is only possible because we do additional locking outside of // this class to ensure no other threads are trying to manipulate the // list of registered factories. See Framework class the following methods: // Framework.installURLStreamHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.installContentHandlerFactory(BundleContext, FrameworkAdaptor) // Framework.uninstallURLStreamHandlerFactory // Framework.uninstallContentHandlerFactory() if (released == null || released.isEmpty()) return getParentFactory(); Object successor = released.remove(0); try { Class<?> clazz = successor.getClass(); Method register = clazz.getMethod("register", new Class[] {Object.class}); //$NON-NLS-1$ for (Object r : released) { register.invoke(successor, new Object[] {r}); } } catch (Exception e) { container.getLogServices().log(MultiplexingFactory.class.getName(), FrameworkLogEntry.ERROR, "designateSuccessor", e); //$NON-NLS-1$ throw new RuntimeException(e.getMessage(), e); } closePackageAdminTracker(); // close tracker return successor; }