Interface GlobalProgrammerManager
-
- All Superinterfaces:
PropertyChangeProvider
- All Known Implementing Classes:
BiDiBProgrammerManager
,CbusDccProgrammerManager
,Dcc4PcProgrammerManager
,DCCppProgrammerManager
,DebugProgrammerManager
,DefaultProgrammerManager
,DeferringProgrammerManager
,EasyDccProgrammerManager
,EcosProgrammerManager
,LnProgrammerManager
,MrcProgrammerManager
,Mx1ProgrammerManager
,NceProgrammerManager
,OlcbProgrammerManager
,SprogProgrammerManager
,SRCPProgrammerManager
,TamsProgrammerManager
,UhlenbrockProgrammerManager
,XNetProgrammerManager
,Z21XNetProgrammerManager
public interface GlobalProgrammerManager extends PropertyChangeProvider
Get access to availableProgrammer
objects.Programmers come in two types:
- Global, previously "Service Mode" or on a programming track. Request these from an instance of this interface.
- Addressed, previously "Ops Mode" also known as "programming on the main". Request
these from an instance of
AddressedProgrammerManager
.
This interface also provides a reserve/release system for tools that want to pretend they have exclusive use of a Programmer. This is a cooperative reservation; both tools (first and second reserver) must be using the reserve/release interface.
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.
- Since:
- 3.9.6
- See Also:
Programmer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Programmer
getGlobalProgrammer()
Gain access to the Global Mode Programmer without reservation.java.lang.String
getUserName()
Provides the human-readable representation for including ProgrammerManagers directly in user interface components, so it should return a user-provided name for this particular one.boolean
isGlobalProgrammerAvailable()
Convenience method to check whether you'll be able to get a Global Mode programmer.void
releaseGlobalProgrammer(Programmer p)
Return access to the Global Mode Programmer, so that it can be used elsewhere.Programmer
reserveGlobalProgrammer()
Gain access to the Global Mode Programmer, in the process reserving it for yourself.java.lang.String
toString()
toString() provides the human-readable representation for including ProgrammerManagers directly in user interface components, so it should return a user-provided name for this particular one.-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
getGlobalProgrammer
@CheckForNull Programmer getGlobalProgrammer()
Gain access to the Global Mode Programmer without reservation.- Returns:
- null only if there isn't a Global Mode Programmer available via this Manager.
-
reserveGlobalProgrammer
@CheckForNull Programmer reserveGlobalProgrammer()
Gain access to the Global Mode Programmer, in the process reserving it for yourself.- Returns:
- null if the existing Global Mode programmer is in use
-
releaseGlobalProgrammer
void releaseGlobalProgrammer(@Nonnull Programmer p)
Return access to the Global Mode Programmer, so that it can be used elsewhere.- Parameters:
p
- the Programmer to release
-
isGlobalProgrammerAvailable
boolean isGlobalProgrammerAvailable()
Convenience method to check whether you'll be able to get a Global Mode programmer.- Returns:
- false if there's no chance of getting one
-
getUserName
@Nonnull java.lang.String getUserName()
Provides the human-readable representation for including ProgrammerManagers directly in user interface components, so it should return a user-provided name for this particular one.- Returns:
- user name of the GlobalProgrammerManager
-
toString
@Nonnull java.lang.String toString()
toString() provides the human-readable representation for including ProgrammerManagers directly in user interface components, so it should return a user-provided name for this particular one.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of the GlobalProgrammerManager
-
-