Package jmri.jmrix.roco.z21.simulator
Class Z21SimulatorAdapter
- java.lang.Object
-
- jmri.jmrix.AbstractPortController
-
- jmri.jmrix.AbstractNetworkPortController
-
- jmri.jmrix.roco.z21.Z21Adapter
-
- jmri.jmrix.roco.z21.simulator.Z21SimulatorAdapter
-
- All Implemented Interfaces:
java.lang.Runnable
,NetworkPortAdapter
,PortAdapter
public class Z21SimulatorAdapter extends Z21Adapter implements java.lang.Runnable
Provide access to a simulated z21 system.Currently, the z21Simulator reacts to commands sent from the user interface with messages an appropriate reply message.
NOTE: Some material in this file was modified from other portions of the support infrastructure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Z21SimulatorAdapter.LogoffException
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.net.DatagramSocket
socket
(package private) boolean
threadStopRequest
-
Fields inherited from class jmri.jmrix.roco.z21.Z21Adapter
COMMUNICATION_UDP_PORT, DEFAULT_IP_ADDRESS, rb
-
Fields inherited from class jmri.jmrix.AbstractNetworkPortController
connTimeout, m_HostName, m_port, socketConn
-
Fields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval
-
-
Constructor Summary
Constructors Constructor Description Z21SimulatorAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure()
Set up all of the other objects to operate with a z21Simulator connected to this port.void
connect()
Open the connection.void
run()
void
terminateThread()
Terminate service thread-
Methods inherited from class jmri.jmrix.roco.z21.Z21Adapter
dispose, getSocket, getSystemConnectionMemo, resetupConnection, status
-
Methods inherited from class jmri.jmrix.AbstractNetworkPortController
autoConfigure, closeConnection, connect, getAdvertisementName, getConnectionTimeout, getCurrentPortName, getHostAddress, getHostName, getInputStream, getMdnsConfigure, getOutputStream, getPort, getServiceType, reconnectFromLoop, setAdvertisementName, setConnectionTimeout, setHostAddress, setHostName, setMdnsConfigure, setPort, setPort, setServiceType
-
Methods inherited from class jmri.jmrix.AbstractPortController
configureOption1, configureOption2, configureOption3, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, recover, safeSleep, setClosed, setDisabled, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.PortAdapter
configureOption1, configureOption2, configureOption3, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, recover, setDisabled, setManufacturer, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName
-
-
-
-
Field Detail
-
threadStopRequest
volatile boolean threadStopRequest
-
socket
volatile java.net.DatagramSocket socket
-
-
Constructor Detail
-
Z21SimulatorAdapter
public Z21SimulatorAdapter()
-
-
Method Detail
-
configure
public void configure()
Set up all of the other objects to operate with a z21Simulator connected to this port.- Specified by:
configure
in interfaceNetworkPortAdapter
- Specified by:
configure
in interfacePortAdapter
- Overrides:
configure
in classZ21Adapter
-
connect
public void connect() throws java.io.IOException
Open the connection.- Specified by:
connect
in interfacePortAdapter
- Overrides:
connect
in classZ21Adapter
- Throws:
java.io.IOException
- if unable to connect
-
terminateThread
public void terminateThread()
Terminate service threadThis is intended to be used only by testing subclasses.
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
-