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
  • Constructor Details

    • FreezableComponent

      protected FreezableComponent(ComponentId id)
    • FreezableComponent

      protected FreezableComponent()
  • Method Details

    • 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.
      Specified by:
      freeze in interface Freezable
    • isFrozen

      public final boolean isFrozen()
      Returns whether this is currently frozen
      Specified by:
      isFrozen in interface Freezable
      Returns:
      true if this instance is in an immutable state, false otherwise
    • 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 class AbstractComponent