Package jmri.jmrix.loconet.locormi
Class LnMessageClient
- java.lang.Object
-
- jmri.jmrix.loconet.LnTrafficController
-
- jmri.jmrix.loconet.LnTrafficRouter
-
- jmri.jmrix.loconet.locormi.LnMessageClient
-
- All Implemented Interfaces:
java.util.EventListener
,LocoNetInterface
,LocoNetListener
public class LnMessageClient extends LnTrafficRouter
Client for the RMI LocoNet server.The main() in this class is for test purposes only.
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.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LocoNetSystemConnectionMemo
clientMemo
(package private) LnMessageBufferInterface
lnMessageBuffer
(package private) LnMessageServerInterface
lnServer
(package private) LnMessageClientPollThread
pollThread
(package private) int
pollTimeout
(package private) java.lang.String
serverName
-
Fields inherited from class jmri.jmrix.loconet.LnTrafficController
listeners, receivedByteCount, receivedMsgCount, transmittedMsgCount
-
Fields inherited from interface jmri.jmrix.loconet.LocoNetInterface
ALL, POWER, PROGRAMMING, SENSORS, SLOTINFO, TURNOUTS
-
-
Constructor Summary
Constructors Constructor Description LnMessageClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureLocalServices()
Set up all of the other objects to operate with a server connected to this application.void
configureRemoteConnection(java.lang.String remoteHostName, int timeoutSec)
Start the connection to the server.SystemConnectionMemo
getAdapterMemo()
void
sendLocoNetMessage(LocoNetMessage m)
Forward messages to the server.-
Methods inherited from class jmri.jmrix.loconet.LnTrafficRouter
connect, disconnectPort, isXmtBusy, message, status
-
Methods inherited from class jmri.jmrix.loconet.LnTrafficController
addLocoNetListener, dispose, getReceivedByteCount, getReceivedMsgCount, getSystemConnectionMemo, getTransmittedMsgCount, notify, removeLocoNetListener, resetStatistics, setSystemConnectionMemo
-
-
-
-
Field Detail
-
serverName
java.lang.String serverName
-
pollTimeout
int pollTimeout
-
lnServer
LnMessageServerInterface lnServer
-
lnMessageBuffer
LnMessageBufferInterface lnMessageBuffer
-
pollThread
LnMessageClientPollThread pollThread
-
clientMemo
LocoNetSystemConnectionMemo clientMemo
-
-
Constructor Detail
-
LnMessageClient
public LnMessageClient()
-
-
Method Detail
-
sendLocoNetMessage
public void sendLocoNetMessage(LocoNetMessage m)
Forward messages to the server.- Specified by:
sendLocoNetMessage
in interfaceLocoNetInterface
- Overrides:
sendLocoNetMessage
in classLnTrafficRouter
- Parameters:
m
- Message to send; will be updated with CRC
-
configureRemoteConnection
public void configureRemoteConnection(java.lang.String remoteHostName, int timeoutSec) throws LocoNetException
Start the connection to the server. This is invoked once.- Parameters:
remoteHostName
- remote host name.timeoutSec
- timeout, value in seconds, not ms.- Throws:
LocoNetException
- if failed to connect to server.
-
configureLocalServices
public void configureLocalServices()
Set up all of the other objects to operate with a server connected to this application.
-
getAdapterMemo
public SystemConnectionMemo getAdapterMemo()
-
-