Class AbstractBaseManager<E extends NamedBean>

    • Method Detail

      • fireVetoableChange

        @OverridingMethodsMustInvokeSuper
        public void fireVetoableChange​(java.lang.String p,
                                       java.lang.Object old)
                                throws java.beans.PropertyVetoException
        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:
        java.beans.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
                                     java.lang.String property)
                              throws java.beans.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:
        java.beans.PropertyVetoException - If the recipients wishes the delete to be aborted (see above)
      • deleteBean

        @OverridingMethodsMustInvokeSuper
        public void deleteBean​(@Nonnull
                               MaleSocket socket,
                               @Nonnull
                               java.lang.String property)
                        throws java.beans.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 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:
        java.beans.PropertyVetoException - If the recipients wishes the delete to be aborted (see above)
      • 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
      • 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