|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.managers.AbstractProxyManager
public abstract class AbstractProxyManager
Implementation of a Manager that can serves as a proxy for multiple system-specific implementations.
Automatically includes an Internal system, which need not be separately added any more.
Encapsulates access to the "Primary" manager, used by default.
Internally, this is done by using a list of all non-Internal managers, plus a separate reference to the internal manager.
| Field Summary |
|---|
| Fields inherited from interface jmri.Manager |
|---|
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS |
| Constructor Summary | |
|---|---|
AbstractProxyManager()
|
|
| Method Summary | |
|---|---|
void |
addManager(Manager m)
|
void |
addPropertyChangeListener(PropertyChangeListener l)
At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify. |
void |
deregister(NamedBean s)
Forget a NamedBean Object created outside the manager. |
void |
dispose()
Free resources when no longer used. |
NamedBean |
getBeanBySystemName(String systemName)
Locate an instance based on a system name. |
protected NamedBean |
getBeanByUserName(String userName)
|
List<Manager> |
getManagerList()
Returns a list of all managers, including the internal manager. |
protected AbstractManager |
getMgr(int index)
|
protected NamedBean |
getNamedBean(String name)
Locate via user name, then system name if needed. |
String[] |
getSystemNameArray()
|
List<String> |
getSystemNameList()
Get a list of all system names. |
String |
getSystemPrefix()
Provides access to the system prefix string. |
protected abstract NamedBean |
makeBean(int index,
String systemName,
String userName)
Defer creation of the proper type to the subclass |
protected abstract AbstractManager |
makeInternalManager()
|
String |
makeSystemName(String s)
|
protected int |
match(String systemname)
Find the index of a matching manager. |
protected int |
matchTentative(String systemname)
Find the index of a matching manager. |
NamedBean |
newNamedBean(String systemName,
String userName)
Return an instance with the specified system and user names. |
protected int |
nMgrs()
Number of managers available through getManager(i) and getManagerList(), including the Internal manager |
protected NamedBean |
provideNamedBean(String name)
Locate via user name, then system name if needed. |
void |
register(NamedBean s)
Remember a NamedBean Object created outside the manager. |
void |
removePropertyChangeListener(PropertyChangeListener l)
At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify. |
char |
systemLetter()
Deprecated. |
char |
typeLetter()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.Manager |
|---|
getXMLOrder |
| Constructor Detail |
|---|
public AbstractProxyManager()
| Method Detail |
|---|
protected int nMgrs()
protected AbstractManager getMgr(int index)
public List<Manager> getManagerList()
public void addManager(Manager m)
protected abstract AbstractManager makeInternalManager()
protected NamedBean getNamedBean(String name)
name -
protected NamedBean provideNamedBean(String name)
name -
protected abstract NamedBean makeBean(int index,
String systemName,
String userName)
index - Which manager to invokepublic NamedBean getBeanBySystemName(String systemName)
Manager
getBeanBySystemName in interface ManagersystemName - System Name of the required NamedBean
protected NamedBean getBeanByUserName(String userName)
public NamedBean newNamedBean(String systemName,
String userName)
This will always return a valid object reference for a valid request; a new object will be created if necessary. In that case:
public void dispose()
Manager
dispose in interface Managerprotected int matchTentative(String systemname)
protected int match(String systemname)
public void register(NamedBean s)
Forwards the register request to the matching system
register in interface Managerpublic void deregister(NamedBean s)
Forwards the deregister request to the matching system
deregister in interface Managerpublic void addPropertyChangeListener(PropertyChangeListener l)
Manager
addPropertyChangeListener in interface Managerpublic void removePropertyChangeListener(PropertyChangeListener l)
Manager
removePropertyChangeListener in interface Managerpublic String getSystemPrefix()
Manager
getSystemPrefix in interface Manager@Deprecated public char systemLetter()
systemLetter in interface Managerpublic char typeLetter()
typeLetter in interface Managerpublic String makeSystemName(String s)
makeSystemName in interface Managerpublic String[] getSystemNameArray()
getSystemNameArray in interface Managerpublic List<String> getSystemNameList()
getSystemNameList in interface Manager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||