jmri
Interface ProgrammerManager

All Known Implementing Classes:
DebugProgrammerManager, DefaultProgrammerManager, EasyDccProgrammerManager, LnProgrammerManager, NceProgrammerManager, SprogProgrammerManager, SRCPProgrammerManager, XNetProgrammerManager

public interface ProgrammerManager

Get access to available Programmer objects.

Programmers come in two types:

You get a Programmer object from a ProgrammerManager, which in turn can be located from the InstanceManager.

The ProgramerManager 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.

Author:
Bob Jacobsen Copyright (C) 2001
See Also:
Programmer

Method Summary
 Programmer getOpsModeProgrammer(boolean pLongAddress, int pAddress)
          Gain access to a Ops Mode Programmer without reservation.
 Programmer getServiceModeProgrammer()
          Gain access to the Service Mode Programmer without reservation.
 boolean isOpsModePossible()
          Convenience method to check whether you'll be able to get an Ops Mode programmer.
 boolean isServiceModePossible()
          Convenience method to check whether you'll be able to get a Service Mode programmer.
 void releaseOpsModeProgrammer(Programmer p)
          Return access to the Service Mode Programmer, so that it can be used elsewhere.
 void releaseServiceModeProgrammer(Programmer p)
          Return access to the Service Mode Programmer, so that it can be used elsewhere.
 Programmer reserveOpsModeProgrammer(boolean pLongAddress, int pAddress)
          Gain access to a (the) Ops Mode Programmer, in the process reserving it for yourself.
 Programmer reserveServiceModeProgrammer()
          Gain access to the Service Mode Programmer, in the process reserving it for yourself.
 

Method Detail

getServiceModeProgrammer

Programmer getServiceModeProgrammer()
Gain access to the Service Mode Programmer without reservation.

Returns:
null only if there isn't a Service Mode Programmer in the system

getOpsModeProgrammer

Programmer getOpsModeProgrammer(boolean pLongAddress,
                                int pAddress)
Gain access to a Ops Mode Programmer without reservation.

Parameters:
pLongAddress - true if this is a long (14 bit) address, else false
pAddress - Specific decoder address to use.
Returns:
null only if there isn't an Ops Mode Programmer in the system

reserveServiceModeProgrammer

Programmer reserveServiceModeProgrammer()
Gain access to the Service Mode Programmer, in the process reserving it for yourself.

Returns:
null if the existing Service Mode programmer is in use

releaseServiceModeProgrammer

void releaseServiceModeProgrammer(Programmer p)
Return access to the Service Mode Programmer, so that it can be used elsewhere.


reserveOpsModeProgrammer

Programmer reserveOpsModeProgrammer(boolean pLongAddress,
                                    int pAddress)
Gain access to a (the) Ops Mode Programmer, in the process reserving it for yourself.

Parameters:
pLongAddress - true if this is a long (14 bit) address, else false
pAddress - Specific decoder address to use.
Returns:
null if the address is in use by a reserved programmer

releaseOpsModeProgrammer

void releaseOpsModeProgrammer(Programmer p)
Return access to the Service Mode Programmer, so that it can be used elsewhere.


isOpsModePossible

boolean isOpsModePossible()
Convenience method to check whether you'll be able to get an Ops Mode programmer.

Returns:
false if there's no chance of getting one

isServiceModePossible

boolean isServiceModePossible()
Convenience method to check whether you'll be able to get a Service Mode programmer.

Returns:
false if there's no chance of getting one


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