Package com.yahoo.component.provider
Class FreezableComponent
- java.lang.Object
-
- com.yahoo.component.AbstractComponent
-
- com.yahoo.component.provider.FreezableComponent
-
- All Implemented Interfaces:
Component
,Deconstructable
,Freezable
,Comparable<Component>
public class FreezableComponent extends AbstractComponent implements Freezable
Superclass for freezable components- Author:
- bratseth
-
-
Field Summary
-
Fields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FreezableComponent()
protected
FreezableComponent(ComponentId id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FreezableComponent
clone()
Clones this.protected void
ensureNotFrozen()
Throws an IllegalStateException if this is frozenvoid
freeze()
Freezes this component to prevent further changes.boolean
isFrozen()
Returns whether this is currently frozen-
Methods inherited from class com.yahoo.component.AbstractComponent
compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
-
-
-
Constructor Detail
-
FreezableComponent
protected FreezableComponent(ComponentId id)
-
FreezableComponent
protected FreezableComponent()
-
-
Method Detail
-
freeze
public void freeze()
Freezes this component to prevent further changes. Override this to freeze internal data structures and dependent objects. Overrides must call super. Calling freeze on an already frozen registry must have no effect.
-
isFrozen
public final boolean isFrozen()
Returns whether this is currently frozen
-
ensureNotFrozen
protected void ensureNotFrozen()
Throws an IllegalStateException if this is frozen
-
clone
public FreezableComponent clone()
Clones this. The clone will not be frozen- Overrides:
clone
in classAbstractComponent
-
-