Package jmri

Class NamedBeanHandleManager

All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, EventListener, PropertyChangeFirer, PropertyChangeProvider, SilenceablePropertyChangeProvider, VetoableChangeFirer, VetoableChangeProvider, InstanceManagerAutoDefault, Manager<NamedBean>

public class NamedBeanHandleManager
extends AbstractManager<NamedBean>
implements InstanceManagerAutoDefault
Instance for controlling the issuing of NamedBeanHandles.
The NamedBeanHandleManager, deals with controlling and updating NamedBean objects across JMRI. When a piece of code requires persistent access to a bean, it should use a NamedBeanHandle. The NamedBeanHandle stores not only the bean that has been requested but also the named that was used to request it (either User or System Name).

This Manager will only issue out one NamedBeanHandle per Bean/Name request. The Manager also deals with updates and changes to the names of NamedBean objects, along with moving usernames between different beans.

If a beans username is changed by the user, then the name will be updated in the NamedBeanHandle. If a username is moved from one bean to another, then the bean reference will be updated and the propertyChangeListener attached to that bean will also be moved, so long as the correct method of adding the listener has been used.

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.

See Also:
NamedBean, NamedBeanHandle