Top Description Fields Constructors Methods
org.eclipse.jgit.internal.util

public final Class CleanupService

extends Object
Class Inheritance
Imports
org.eclipse.jgit.internal.JGitText, org.slf4j.Logger, .LoggerFactory

A class that is registered as an OSGi service via the manifest. If JGit runs in OSGi, OSGi will instantiate a singleton as soon as the bundle is activated since this class is an immediate OSGi component with no dependencies. OSGi will then call its start() method. If JGit is not running in OSGi, getInstance() will lazily create an instance.

An OSGi-created CleanupService will run the registered cleanup when the org.eclipse.jgit bundle is deactivated. A lazily created instance will register the cleanup as a JVM shutdown hook.

Field Summary

Modifier and TypeField and Description
private Runnable
private static CleanupService
private final boolean
private JGitText
private static final Object
private static final Logger

Constructor Summary

AccessConstructor and Description
public
CleanupService()

Public component constructor for OSGi DS.

private
CleanupService(boolean isOsgi)

Method Summary

Modifier and TypeMethod and Description
public static CleanupService

Returns:

the CleanupService singleton instance
getInstance
()

Obtains the singleton instance of the CleanupService that knows whether or not it is running on OSGi.

pack-priv void
register(Runnable cleanUp)

private static void
pack-priv void
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanupback to summary
private Runnable cleanup
INSTANCEback to summary
private static CleanupService INSTANCE
isOsgiback to summary
private final boolean isOsgi
jgitTextback to summary
private JGitText jgitText
LOCKback to summary
private static final Object LOCK
LOGback to summary
private static final Logger LOG

Constructor Detail

CleanupServiceback to summary
public CleanupService()

Public component constructor for OSGi DS. Do not call this explicitly! (Unfortunately this constructor must be public because of OSGi requirements.)

CleanupServiceback to summary
private CleanupService(boolean isOsgi)

Method Detail

getInstanceback to summary
public static CleanupService getInstance()

Obtains the singleton instance of the CleanupService that knows whether or not it is running on OSGi.

Returns:CleanupService

the CleanupService singleton instance

registerback to summary
pack-priv void register(Runnable cleanUp)
setInstanceback to summary
private static void setInstance(CleanupService service)
shutDownback to summary
pack-priv void shutDown()
startback to summary
pack-priv void start()