Class AbstractBaseManager<E extends NamedBean>

Type Parameters:
E - the type of NamedBean supported by this manager
All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, EventListener, PropertyChangeFirer, PropertyChangeProvider, SilenceablePropertyChangeProvider, VetoableChangeFirer, VetoableChangeProvider, BaseManager<E>, Manager<E>
Direct Known Subclasses:
DefaultAnalogActionManager, DefaultAnalogExpressionManager, DefaultDigitalActionManager, DefaultDigitalBooleanActionManager, DefaultDigitalExpressionManager, DefaultStringActionManager, DefaultStringExpressionManager

public abstract class AbstractBaseManager<E extends NamedBean> extends AbstractManager<E> implements BaseManager<E>
Abstract partial implementation for the LogixNG action and expression managers.
  • Field Details

  • Constructor Details

  • Method Details

    • fireVetoableChange

      Inform all registered listeners of a vetoable change.If the propertyName is "CanDelete" ALL listeners with an interest in the bean will throw an exception, which is recorded returned back to the invoking method, so that it can be presented back to the user.However if a listener decides that the bean can not be deleted then it should throw an exception with a property name of "DoNotDelete", this is thrown back up to the user and the delete process should be aborted.
      Parameters:
      p - The programmatic name of the property that is to be changed. "CanDelete" will inquire with all listeners if the item can be deleted. "DoDelete" tells the listener to delete the item.
      old - The old value of the property.
      Throws:
      PropertyVetoException - If the recipients wishes the delete to be aborted (see above)
    • castBean

      protected abstract E castBean(MaleSocket maleSocket)
      Cast the maleSocket to E This method is needed since SpotBugs @SuppressWarnings("unchecked") does not work for the cast: (E)socket.
      Parameters:
      maleSocket - the maleSocket to cast
      Returns:
      the maleSocket as E
    • deleteBean

      public final void deleteBean(@Nonnull E n, @Nonnull String property) throws PropertyVetoException
      Method for a UI to delete a bean.

      The UI should first request a "CanDelete", this will return a list of locations (and descriptions) where the bean is in use via throwing a VetoException, then if that comes back clear, or the user agrees with the actions, then a "DoDelete" can be called which inform the listeners to delete the bean, then it will be deregistered and disposed of.

      If a property name of "DoNotDelete" is thrown back in the VetoException then the delete process should be aborted.

      Specified by:
      deleteBean in interface Manager<E extends NamedBean>
      Overrides:
      deleteBean in class AbstractManager<E extends NamedBean>
      Parameters:
      n - The NamedBean to be deleted
      property - The programmatic name of the request. "CanDelete" will enquire with all listeners if the item can be deleted. "DoDelete" tells the listener to delete the item
      Throws:
      PropertyVetoException - If the recipients wishes the delete to be aborted (see above)
    • deleteBean

      Method for a UI to delete a bean.

      The UI should first request a "CanDelete", this will return a list of locations (and descriptions) where the bean is in use via throwing a VetoException, then if that comes back clear, or the user agrees with the actions, then a "DoDelete" can be called which inform the listeners to delete the bean, then it will be deregistered and disposed of.

      If a property name of "DoNotDelete" is thrown back in the VetoException then the delete process should be aborted.

      Specified by:
      deleteBean in interface BaseManager<E extends NamedBean>
      Parameters:
      socket - The MaleSocket to be deleted
      property - The programmatic name of the request. "CanDelete" will enquire with all listeners if the item can be deleted. "DoDelete" tells the listener to delete the item
      Throws:
      PropertyVetoException - If the recipients wishes the delete to be aborted (see above)
    • deregister

      Forget a NamedBean Object created outside the manager.

      The non-system-specific RouteManager uses this method.

      Specified by:
      deregister in interface Manager<E extends NamedBean>
      Overrides:
      deregister in class AbstractManager<E extends NamedBean>
      Parameters:
      s - the bean
    • validSystemNameFormat

      Test if parameter is a properly formatted system name.
      Specified by:
      validSystemNameFormat in interface Manager<E extends NamedBean>
      Overrides:
      validSystemNameFormat in class AbstractManager<E extends NamedBean>
      Parameters:
      systemName - the system name
      Returns:
      enum indicating current validity, which might be just as a prefix
    • register

      public void register(@Nonnull E s)
      Description copied from class: AbstractManager
      Remember a NamedBean Object created outside the manager.

      The non-system-specific SignalHeadManagers use this method extensively.

      Specified by:
      register in interface Manager<E extends NamedBean>
      Overrides:
      register in class AbstractManager<E extends NamedBean>
      Parameters:
      s - the bean
    • registerBean

      public E registerBean(@Nonnull E s)
      Description copied from interface: BaseManager
      Remember a NamedBean Object created outside the manager.

      The non-system-specific SignalHeadManagers use this method extensively.

      Specified by:
      registerBean in interface BaseManager<E extends NamedBean>
      Parameters:
      s - the bean
      Returns:
      the registered bean with attached male sockets
    • registerMaleSocketFactory

      Description copied from interface: BaseManager
      Register a male socket factory.
      Specified by:
      registerMaleSocketFactory in interface BaseManager<E extends NamedBean>
      Parameters:
      factory - the factory
    • getOuterBean

      protected E getOuterBean(E bean)
      Get the outer bean of an encapsulated bean. Some managers encapsulates the beans and those managers needs to override this method.
      Overrides:
      getOuterBean in class AbstractManager<E extends NamedBean>
      Parameters:
      bean - the bean
      Returns:
      the most outer bean or the bean itself if there is no outer bean