Class ConcurrentAuthorityFactory.ShutdownHook<DAO extends GeodeticAuthorityFactory>
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.PhantomReference<ConcurrentAuthorityFactory<DAO>>
org.apache.sis.referencing.factory.ConcurrentAuthorityFactory.ShutdownHook<DAO>
- All Implemented Interfaces:
Callable<Object>,Disposable
- Enclosing class:
- ConcurrentAuthorityFactory<DAO extends GeodeticAuthorityFactory>
private static final class ConcurrentAuthorityFactory.ShutdownHook<DAO extends GeodeticAuthorityFactory>
extends PhantomReference<ConcurrentAuthorityFactory<DAO>>
implements Disposable, Callable<Object>
A hook to be executed either when the
ConcurrentAuthorityFactory is collected by the garbage collector,
when the Java Virtual Machine is shutdown, or when the module is uninstalled by the OSGi or Servlet container.
Do not keep reference to the enclosing factory - in particular, this class must not be static - otherwise the factory would never been garbage collected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Deque<ConcurrentAuthorityFactory.DataAccessRef<DAO>>TheConcurrentAuthorityFactory.availableDAOsqueue. -
Constructor Summary
ConstructorsConstructorDescriptionShutdownHook(ConcurrentAuthorityFactory<DAO> factory) Creates a new shutdown hook for the given factory. -
Method Summary
Modifier and TypeMethodDescriptioncall()Invoked at JVM shutdown time, or when the container (OSGi or Servlet) uninstall the bundle containing SIS.voiddispose()Invoked indirectly by the garbage collector when theConcurrentAuthorityFactoryis disposed.Methods inherited from class java.lang.ref.PhantomReference
getMethods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
-
Field Details
-
availableDAOs
private final Deque<ConcurrentAuthorityFactory.DataAccessRef<DAO extends GeodeticAuthorityFactory>> availableDAOsTheConcurrentAuthorityFactory.availableDAOsqueue.
-
-
Constructor Details
-
ShutdownHook
ShutdownHook(ConcurrentAuthorityFactory<DAO> factory) Creates a new shutdown hook for the given factory.
-
-
Method Details
-
dispose
public void dispose()Invoked indirectly by the garbage collector when theConcurrentAuthorityFactoryis disposed.- Specified by:
disposein interfaceDisposable
-
call
Invoked at JVM shutdown time, or when the container (OSGi or Servlet) uninstall the bundle containing SIS.- Specified by:
callin interfaceCallable<DAO extends GeodeticAuthorityFactory>- Throws:
Exception
-