Package gnu.io.factory
Class DefaultSerialPortFactory
- java.lang.Object
-
- gnu.io.factory.DefaultSerialPortFactory
-
- All Implemented Interfaces:
SerialPortFactory
public class DefaultSerialPortFactory extends java.lang.Object implements SerialPortFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultSerialPortFactory()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SerialPortcreateSerialPort(java.lang.String portName)Creates aSerialPortinstance out of the givenportName.<T extends SerialPort>
TcreateSerialPort(java.lang.String portName, java.lang.Class<T> expectedClass)Creates aSerialPortinstance out of the givenportName.SerialPortRegistrygetPortRegistry()Gets theSerialPortRegistryto register/unregisterSerialPortCreators.
-
-
-
Method Detail
-
createSerialPort
public <T extends SerialPort> T createSerialPort(java.lang.String portName, java.lang.Class<T> expectedClass) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
Description copied from interface:SerialPortFactoryCreates aSerialPortinstance out of the givenportName.- Specified by:
createSerialPortin interfaceSerialPortFactory- Parameters:
portName- The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.expectedClass- TheSerialPortclass that is expected to return.- Returns:
- The newly created and opened SerialPort.
- Throws:
PortInUseExceptionNoSuchPortExceptionUnsupportedCommOperationException
-
createSerialPort
public SerialPort createSerialPort(java.lang.String portName) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException
Description copied from interface:SerialPortFactoryCreates aSerialPortinstance out of the givenportName.- Specified by:
createSerialPortin interfaceSerialPortFactory- Parameters:
portName- The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.- Returns:
- The newly created and opened SerialPort.
- Throws:
PortInUseExceptionNoSuchPortExceptionUnsupportedCommOperationException
-
getPortRegistry
public SerialPortRegistry getPortRegistry()
Gets theSerialPortRegistryto register/unregisterSerialPortCreators.- Returns:
-
-