jmri
Interface Manager

All Known Subinterfaces:
ConditionalManager, LightManager, LogixManager, MemoryManager, ReporterManager, RouteManager, SensorManager, SignalHeadManager, TurnoutManager
All Known Implementing Classes:
AbstractLightManager, AbstractManager, AbstractMemoryManager, AbstractProxyManager, AbstractReporterManager, AbstractSensorManager, AbstractSignalHeadManager, AbstractTurnoutManager, AcelaLightManager, AcelaSensorManager, AcelaTurnoutManager, BlockManager, CbusSensorManager, CbusTurnoutManager, DefaultConditionalManager, DefaultLogixManager, DefaultMemoryManager, DefaultRouteManager, EasyDccTurnoutManager, EliteXNetTurnoutManager, InternalSensorManager, InternalTurnoutManager, LayoutBlockManager, LnLightManager, LnReporterManager, LnSensorManager, LnTurnoutManager, NceSensorManager, NceTurnoutManager, ProxyLightManager, ProxyReporterManager, ProxySensorManager, ProxyTurnoutManager, RpsReporterManager, RpsSensorManager, SerialLightManager, SerialLightManager, SerialLightManager, SerialLightManager, SerialLightManager, SerialLightManager, SerialSensorManager, SerialSensorManager, SerialSensorManager, SerialSensorManager, SerialSensorManager, SerialSensorManager, SerialTurnoutManager, SerialTurnoutManager, SerialTurnoutManager, SerialTurnoutManager, SerialTurnoutManager, SerialTurnoutManager, SerialTurnoutManager, SpecificLightManager, SpecificLightManager, SprogTurnoutManager, SRCPTurnoutManager, XNetLightManager, XNetSensorManager, XNetTurnoutManager, XpaTurnoutManager

public interface Manager

Basic interface for access to named, managed objects.

NamedBean objects represent various real elements, and have a "system name" and perhaps "user name". A specific Manager object provides access to them by name, and serves as a factory for new objects.

Right now, this interface just contains the members needed by InstanceManager to handle managers for more than one system.

Although they are not defined here because their return type differs, any specific Manager subclass provides "get" methods to locate specific objects, and a "new" method to create a new one via the Factory pattern. The "get" methods will return an existing object or null, and will never create a new object. The "new" method will log a warning if an object already exists with that system name.

add/remove PropertyChangeListener methods are provided. At a minimum, subclasses must notify of changes to the list of available NamedBeans; they may have other properties that will also notify.


This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Author:
Bob Jacobsen Copyright (C) 2003

Method Summary
 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 n)
          Forget a NamedBean Object created outside the manager.
 void dispose()
          Free resources when no longer used.
 List getSystemNameList()
           
 String makeSystemName(String s)
           
 void register(NamedBean n)
          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()
           
 char typeLetter()
           
 

Method Detail

systemLetter

char systemLetter()
Returns:
The system-specific prefix letter for a specific implementation

typeLetter

char typeLetter()
Returns:
The type letter for a specific implementation

makeSystemName

String makeSystemName(String s)
Returns:
A system name from a user input, typically a number.

dispose

void dispose()
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.


getSystemNameList

List getSystemNameList()

addPropertyChangeListener

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.


removePropertyChangeListener

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.


register

void register(NamedBean n)
Remember a NamedBean Object created outside the manager.

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


deregister

void deregister(NamedBean n)
Forget a NamedBean Object created outside the manager.

The non-system-specific RouteManager uses this method.



Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo