/** * Manually deregister a factory * * <p>Used to facilitate integration with other plug-in systems, such as OSGi or Spring, that * block CLASSPATH visibility of {@link ServiceLoader} implementation registration. * * @param factory */ public void deregisterFactory(final Object factory) { registry.deregisterInstance(factory); }
/** * Manually deregister a factory * * <p>Used to facilitate integration with other plug-in systems, such as OSGi or Spring, that * block CLASSPATH visibility of {@link ServiceLoader} implementation registration. * * @param factory * @param category * @return */ public <T> boolean deregisterFactory(final T factory, final Class<T> category) { ensureArgumentNonNull("factory", factory); ensureArgumentNonNull("category", category); if (!category.isAssignableFrom(factory.getClass())) { throw new ClassCastException(); } return registry.deregisterInstance(factory, category); }