Package jmri.jmrix.internal
Class InternalSystemConnectionMemo
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.jmrix.DefaultSystemConnectionMemo
-
- jmri.jmrix.internal.InternalSystemConnectionMemo
-
- All Implemented Interfaces:
BeanInterface
,PropertyChangeFirer
,PropertyChangeProvider
,Disposable
,InstanceManagerAutoDefault
,SystemConnectionMemo
public class InternalSystemConnectionMemo extends DefaultSystemConnectionMemo implements InstanceManagerAutoDefault
Lightweight class to denote that a system is active, and provide general information.Things this needed to do:
- One of these must be automatically, transparently available - this is done by inheriting from jmri.InstanceManagerAutoDefault
- It must be possible to have more than one of these, so you can have multiple internal systems defined - each one keeps internal references to its objects
- It must make sure that its objects are available individually through the instance manager.
- But it also has to handle the ProxyManager special cases in the InstanceManager
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
configured
(package private) boolean
defaultInstanceType
-
Fields inherited from class jmri.jmrix.DefaultSystemConnectionMemo
classObjectMap
-
Fields inherited from class jmri.beans.Bean
propertyChangeSupport
-
Fields inherited from interface jmri.SystemConnectionMemo
DEREGISTER, DISABLED, INTERVAL, STORE, SYSTEM_PREFIX, USER_NAME
-
-
Constructor Summary
Constructors Constructor Description InternalSystemConnectionMemo()
InternalSystemConnectionMemo(boolean defaultInstanceType)
InternalSystemConnectionMemo(java.lang.String prefix, java.lang.String name)
InternalSystemConnectionMemo(java.lang.String prefix, java.lang.String name, boolean defaultInstanceType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureManagers()
Configure the common managers for Internal connections.void
dispose()
Dispose of System Connection.<T> T
get(java.lang.Class<T> type)
Get a manager for a specific type.protected java.util.ResourceBundle
getActionModelResourceBundle()
InternalConsistManager
getConsistManager()
Provide access to the ConsistManager for this particular connection.InternalLightManager
getLightManager()
InternalMeterManager
getMeterManager()
<B extends NamedBean>
java.util.Comparator<B>getNamedBeanComparator(java.lang.Class<B> type)
Get the Comparator to be used for two NamedBeans.DefaultPowerManager
getPowerManager()
DebugProgrammerManager
getProgrammerManager()
InternalReporterManager
getReporterManager()
InternalSensorManager
getSensorManager()
InternalStringIOManager
getStringIOManager()
DebugThrottleManager
getThrottleManager()
InternalTurnoutManager
getTurnoutManager()
boolean
provides(java.lang.Class<?> type)
Check if this connection provides a specific manager type.-
Methods inherited from class jmri.jmrix.DefaultSystemConnectionMemo
deregister, getActionFactory, getDefaultOutputInterval, getDisabled, getOutputInterval, getSystemPrefix, getUserName, isDirty, isRestartRequired, register, setConsistManager, setDisabled, setOutputInterval, setSystemPrefix, setUserName, store
-
Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
configured
boolean configured
-
defaultInstanceType
boolean defaultInstanceType
-
-
Constructor Detail
-
InternalSystemConnectionMemo
public InternalSystemConnectionMemo(java.lang.String prefix, java.lang.String name, boolean defaultInstanceType)
-
InternalSystemConnectionMemo
public InternalSystemConnectionMemo(java.lang.String prefix, java.lang.String name)
-
InternalSystemConnectionMemo
public InternalSystemConnectionMemo(boolean defaultInstanceType)
-
InternalSystemConnectionMemo
public InternalSystemConnectionMemo()
-
-
Method Detail
-
configureManagers
public void configureManagers()
Configure the common managers for Internal connections. This puts the common manager config in one place.Note: The Proxy system can cause some managers to be created early. We don't call configureManagers in that case, as it causes an infinite loop.
-
getSensorManager
public InternalSensorManager getSensorManager()
-
getLightManager
public InternalLightManager getLightManager()
-
getReporterManager
public InternalReporterManager getReporterManager()
-
getTurnoutManager
public InternalTurnoutManager getTurnoutManager()
-
getMeterManager
public InternalMeterManager getMeterManager()
-
getStringIOManager
public InternalStringIOManager getStringIOManager()
-
getPowerManager
public DefaultPowerManager getPowerManager()
-
getConsistManager
public InternalConsistManager getConsistManager()
Description copied from class:DefaultSystemConnectionMemo
Provide access to the ConsistManager for this particular connection.- Overrides:
getConsistManager
in classDefaultSystemConnectionMemo
- Returns:
- the provided ConsistManager or null if the connection does not provide a ConsistManager
-
getThrottleManager
public DebugThrottleManager getThrottleManager()
-
getProgrammerManager
public DebugProgrammerManager getProgrammerManager()
-
provides
public boolean provides(java.lang.Class<?> type)
Description copied from class:DefaultSystemConnectionMemo
Check if this connection provides a specific manager type. This method must return false if a manager for the specific type is not provided, and must return true if a manager for the specific type is provided.- Specified by:
provides
in interfaceSystemConnectionMemo
- Overrides:
provides
in classDefaultSystemConnectionMemo
- Parameters:
type
- The class type for the manager to be provided- Returns:
- true if the specified manager is provided
- See Also:
DefaultSystemConnectionMemo.get(java.lang.Class)
-
get
public <T> T get(java.lang.Class<T> type)
Description copied from class:DefaultSystemConnectionMemo
Get a manager for a specific type. This method must return a non-null value ifDefaultSystemConnectionMemo.provides(java.lang.Class)
is true for the type, and must return null if provides() is false for the type.- Specified by:
get
in interfaceSystemConnectionMemo
- Overrides:
get
in classDefaultSystemConnectionMemo
- Type Parameters:
T
- Type of manager to get- Parameters:
type
- Type of manager to get- Returns:
- The manager or null if provides() is false for T
- See Also:
DefaultSystemConnectionMemo.provides(java.lang.Class)
-
getActionModelResourceBundle
protected java.util.ResourceBundle getActionModelResourceBundle()
- Specified by:
getActionModelResourceBundle
in classDefaultSystemConnectionMemo
-
getNamedBeanComparator
public <B extends NamedBean> java.util.Comparator<B> getNamedBeanComparator(java.lang.Class<B> type)
Description copied from class:DefaultSystemConnectionMemo
Get the Comparator to be used for two NamedBeans. This is typically anNamedBeanComparator
, but may be any Comparator that works for this connection type.- Specified by:
getNamedBeanComparator
in interfaceSystemConnectionMemo
- Specified by:
getNamedBeanComparator
in classDefaultSystemConnectionMemo
- Type Parameters:
B
- the type of NamedBean- Parameters:
type
- the class of NamedBean- Returns:
- the Comparator
-
dispose
public void dispose()
Description copied from class:DefaultSystemConnectionMemo
Dispose of System Connection.Removes objects from classObjectMap after calling dispose if Disposable. Removes these objects from InstanceManager.
- Specified by:
dispose
in interfaceDisposable
- Specified by:
dispose
in interfaceSystemConnectionMemo
- Overrides:
dispose
in classDefaultSystemConnectionMemo
-
-