Class AbstractRegistration
- java.lang.Object
-
- org.opendaylight.yangtools.concepts.AbstractRegistration
-
- All Implemented Interfaces:
AutoCloseable
,Registration
- Direct Known Subclasses:
AbstractObjectRegistration
public abstract class AbstractRegistration extends Object implements Registration
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 Constructor Description AbstractRegistration()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected MoreObjects.ToStringHelper
addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
void
close()
Unregisters the object.boolean
isClosed()
Query the state of this registration.boolean
notClosed()
Query the state of this registration.protected abstract void
removeRegistration()
Remove the state referenced by this registration.String
toString()
-
-
-
Method Detail
-
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
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
-
-