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
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity -
Field Summary
FieldsFields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, memo, silenceableProperties, silencedPropertiesFields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupportFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupportFields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, PROPERTY_BEANS, PROPERTY_CAN_DELETE, PROPERTY_DISPLAY_LIST_NAME, PROPERTY_DO_DELETE, PROPERTY_DO_NOT_DELETE, PROPERTY_LENGTH, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EcastBean(MaleSocket maleSocket) Cast the maleSocket to E This method is needed since SpotBugs @SuppressWarnings("unchecked") does not work for the cast: (E)socket.final voiddeleteBean(E n, String property) Method for a UI to delete a bean.voiddeleteBean(MaleSocket socket, String property) Method for a UI to delete a bean.voidderegister(E s) Forget a NamedBean Object created outside the manager.voidfireVetoableChange(String p, Object old) 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.protected EgetOuterBean(E bean) Get the outer bean of an encapsulated bean.voidRemember a NamedBean Object created outside the manager.registerBean(E s) Remember a NamedBean Object created outside the manager.voidregisterMaleSocketFactory(MaleSocketFactory<E> factory) Register a male socket factory.final Manager.NameValidityvalidSystemNameFormat(String systemName) Test if parameter is a properly formatted system name.Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, updateAutoNumber, vetoableChangeMethods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListenerMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrit.logixng.BaseManager
getLastRegisteredMaleSocket, getMaleSocketClassMethods inherited from interface jmri.Manager
addDataListener, dispose, getBeanTypeHandled, getBeanTypeHandled, getBySystemName, getByUserName, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanClass, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, getXMLOrder, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, removeDataListener, setDataListenerMute, typeLetter, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormatMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilencedMethods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Field Details
-
_maleSocketFactories
-
-
Constructor Details
-
AbstractBaseManager
public AbstractBaseManager()
-
-
Method Details
-
fireVetoableChange
@OverridingMethodsMustInvokeSuper public void fireVetoableChange(String p, Object old) throws 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:
PropertyVetoException- If the recipients wishes the delete to be aborted (see above)
-
castBean
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
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:
deleteBeanin interfaceManager<E extends NamedBean>- Overrides:
deleteBeanin classAbstractManager<E extends NamedBean>- Parameters:
n- The NamedBean to be deletedproperty- 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
@OverridingMethodsMustInvokeSuper public void deleteBean(@Nonnull MaleSocket socket, @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:
deleteBeanin interfaceBaseManager<E extends NamedBean>- Parameters:
socket- The MaleSocket to be deletedproperty- 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:
deregisterin interfaceManager<E extends NamedBean>- Overrides:
deregisterin classAbstractManager<E extends NamedBean>- Parameters:
s- the bean
-
validSystemNameFormat
Test if parameter is a properly formatted system name.- Specified by:
validSystemNameFormatin interfaceManager<E extends NamedBean>- Overrides:
validSystemNameFormatin classAbstractManager<E extends NamedBean>- Parameters:
systemName- the system name- Returns:
- enum indicating current validity, which might be just as a prefix
-
register
Description copied from class:AbstractManagerRemember a NamedBean Object created outside the manager.The non-system-specific SignalHeadManagers use this method extensively.
-
registerBean
Description copied from interface:BaseManagerRemember a NamedBean Object created outside the manager.The non-system-specific SignalHeadManagers use this method extensively.
- Specified by:
registerBeanin interfaceBaseManager<E extends NamedBean>- Parameters:
s- the bean- Returns:
- the registered bean with attached male sockets
-
registerMaleSocketFactory
Description copied from interface:BaseManagerRegister a male socket factory.- Specified by:
registerMaleSocketFactoryin interfaceBaseManager<E extends NamedBean>- Parameters:
factory- the factory
-
getOuterBean
Get the outer bean of an encapsulated bean. Some managers encapsulates the beans and those managers needs to override this method.- Overrides:
getOuterBeanin classAbstractManager<E extends NamedBean>- Parameters:
bean- the bean- Returns:
- the most outer bean or the bean itself if there is no outer bean
-