Class AbstractRegistration
java.lang.Object
org.opendaylight.yangtools.concepts.AbstractRegistration
- All Implemented Interfaces:
AutoCloseable
,Registration
- Direct Known Subclasses:
AbstractObjectRegistration
Utility registration handle. It is a convenience for register-style method which can return an AutoCloseable realized
by a subclass of this class. Invoking the close() method triggers unregistration of the state the method installed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
addToStringAttributes
(MoreObjects.ToStringHelper toStringHelper) final void
close()
Unregisters the object.final boolean
isClosed()
Query the state of this registration.final boolean
Query the state of this registration.protected abstract void
Remove the state referenced by this registration.final String
toString()
-
Constructor Details
-
AbstractRegistration
public AbstractRegistration()
-
-
Method Details
-
removeRegistration
protected abstract void removeRegistration()Remove the state referenced by this registration. This method is guaranteed to be called at most once. Referenced state must be retained until this method is invoked. -
isClosed
public final boolean isClosed()Query the state of this registration. Returns true if it was closed. Equivalent of!notClosed()
.- Returns:
- true if the registration was closed, false otherwise.
-
notClosed
public final boolean notClosed()Query the state of this registration. Returns false if it was closed. Equivalent of!isClosed()
.- Returns:
- false if the registration was closed, true otherwise.
-
close
public final void close()Description copied from interface:Registration
Unregisters the object. This operation is required not to invoke blocking operations. Implementations which require interaction with outside world must provide guarantees that any work is done behind the scenes and the unregistration process looks as if it has already succeeded once this method returns.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRegistration
-
toString
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
-