Package jmri.jmrix
Class AbstractStreamPortController
java.lang.Object
jmri.jmrix.AbstractPortController
jmri.jmrix.AbstractStreamPortController
- All Implemented Interfaces:
PortAdapter
- Direct Known Subclasses:
DCCppStreamPortController,LnStreamPortController,RfidStreamPortController,SprogCSStreamPortController,XNetStreamPortController
Provide an abstract implementation of a *StreamPortController for stream
based ports.
Implementing classes need to implement status and configure from the portAdapter interface, along with any system specific requirements.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController
AbstractPortController.Option -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected DataInputStreamprotected DataOutputStreamFields inherited from class jmri.jmrix.AbstractPortController
allowConnectionRecovery, manufacturerName, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, reconnectMaxAttempts, reconnectMaxInterval -
Constructor Summary
ConstructorsConstructorDescriptionAbstractStreamPortController(SystemConnectionMemo connectionMemo) AbstractStreamPortController(SystemConnectionMemo connectionMemo, DataInputStream in, DataOutputStream out, String pname) -
Method Summary
Methods inherited from class jmri.jmrix.AbstractPortController
closeConnection, configureOption1, configureOption2, configureOption3, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, getReconnectMaxAttempts, getReconnectMaxInterval, getSystemConnectionMemo, getSystemPrefix, getUserName, isDirty, isOptionAdvanced, isOptionTypePassword, isOptionTypeText, isRestartRequired, purgeStream, reconnect, reconnectFromLoop, resetupConnection, safeSleep, setClosed, setDisabled, setManufacturer, setOpened, setOptionState, setReconnectMaxAttempts, setReconnectMaxInterval, setSystemConnectionMemo, setSystemPrefix, setUserName, statusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrix.PortAdapter
configure
-
Field Details
-
_name
-
input
-
output
-
-
Constructor Details
-
AbstractStreamPortController
public AbstractStreamPortController(SystemConnectionMemo connectionMemo, DataInputStream in, DataOutputStream out, String pname) -
AbstractStreamPortController
-
-
Method Details
-
getInputStream
Description copied from class:AbstractPortControllerGet the InputStream from the port.- Specified by:
getInputStreamin interfacePortAdapter- Specified by:
getInputStreamin classAbstractPortController- Returns:
- the InputStream from the port
-
getOutputStream
Description copied from class:AbstractPortControllerGet the outputStream to the port.- Specified by:
getOutputStreamin interfacePortAdapter- Specified by:
getOutputStreamin classAbstractPortController- Returns:
- the outputStream to the port
-
getCurrentPortName
- Specified by:
getCurrentPortNamein interfacePortAdapter- Specified by:
getCurrentPortNamein classAbstractPortController
-
recover
Description copied from class:AbstractPortControllerThis is called when a connection is initially lost. After checking the allowConnectionRecovery flag, closes the connection, resets the open flag and attempts a reconnection.- Specified by:
recoverin interfacePortAdapter- Overrides:
recoverin classAbstractPortController
-
connect
Description copied from interface:PortAdapterOpen the connection. -
connect
-
dispose
Description copied from class:AbstractPortControllerClean up before removal. Overriding methods must callsuper.dispose()or document why they are not calling the overridden implementation. In most cases, failure to call the overridden implementation will cause user-visible error.- Specified by:
disposein interfacePortAdapter- Overrides:
disposein classAbstractPortController
-