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.availableDAOs
queue. -
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.void
dispose()
Invoked indirectly by the garbage collector when theConcurrentAuthorityFactory
is disposed.Methods inherited from class java.lang.ref.PhantomReference
get
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
availableDAOs
private final Deque<ConcurrentAuthorityFactory.DataAccessRef<DAO extends GeodeticAuthorityFactory>> availableDAOsTheConcurrentAuthorityFactory.availableDAOs
queue.
-
-
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 theConcurrentAuthorityFactory
is disposed.- Specified by:
dispose
in interfaceDisposable
-
call
Invoked at JVM shutdown time, or when the container (OSGi or Servlet) uninstall the bundle containing SIS.- Specified by:
call
in interfaceCallable<DAO extends GeodeticAuthorityFactory>
- Throws:
Exception
-