|
jSyncManager | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jSyncManager.API.Transport.SLPTransportInterface | +--org.jSyncManager.API.Transport.SerialTransportInterface | +--org.jSyncManager.Transport.CommAPITransport
Sun Communications API Transport. This class provides a bridge between Sun Microsystem's Java Communications API and the SLP Protocol class.
Field Summary | |
---|---|
protected javax.swing.JComboBox |
comSelectBox
A combo box to hold the communications port names. |
protected java.io.DataInputStream |
dis
The port data input stream. |
protected java.io.DataOutputStream |
dos
The port data output stream. |
protected javax.comm.CommPortIdentifier |
port
A handle to hold the communications port identifier object. |
protected java.lang.String |
portName
The name of the port selected for I/O. |
protected javax.comm.SerialPort |
ser
A handle to hold the serial port object. |
protected javax.swing.JComboBox |
speedSelectBox
A combo box to hold the serial port speeds. |
Fields inherited from class org.jSyncManager.API.Transport.SerialTransportInterface |
---|
INITIAL_SERIAL_SPEED, serialSpeed |
Fields inherited from class org.jSyncManager.API.Transport.SLPTransportInterface |
---|
configPanel, connected |
Constructor Summary | |
---|---|
CommAPITransport()
Create a new instance of the Comm API Transport. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Method that is called whenever an action is performed. |
void |
close()
Closes the Java COMM API port. |
protected javax.swing.JPanel |
constructConfigPanel()
Constructs this transports configuration panel. |
protected void |
finalize()
This method overrides Object.finalize() in order to ensure that the underlying Java Comm API connection to the serial handler is properly shut down. |
void |
flush()
Flushes the input buffer of any remaining data. |
int |
getPreferredSyncSpeed()
A method to retreive the users preferred sync speed. |
java.lang.String |
getResourceBundleName()
Returns the fully-qualified classname for the resources package to use for this transport. |
java.lang.String |
getTransportDescription()
Returns the description for this Transport Interface. |
java.lang.String |
getTransportExceptionText(TransportException ex)
Retrieves error information for a given TransportException. |
java.lang.String |
getTransportName()
Returns the name of this Transport Interface. |
void |
initialize()
Initialize the port. |
void |
initialize(java.util.Properties properties,
int id)
Initialize the port. |
void |
open()
Opens a read/write connection to the implemented transport. |
byte |
readByte()
Read a single byte from the Java COMM API port. |
protected void |
setSpeed(int speed)
Sets the speed of the underlying Java COMM API port. |
java.lang.String |
toString()
Returns settings information on this transport as a String. |
void |
writeBytes(byte[] data)
Writes an array of bytes to the Java COMM API port. |
Methods inherited from class org.jSyncManager.API.Transport.SerialTransportInterface |
---|
switchSpeed |
Methods inherited from class org.jSyncManager.API.Transport.SLPTransportInterface |
---|
getConfigPanel, getResourceBundle, isConnected, loadResourceBundle, setConnected |
Methods inherited from class java.lang.Object |
---|
|
Field Detail |
protected transient javax.comm.CommPortIdentifier port
protected transient javax.comm.SerialPort ser
protected transient java.io.DataInputStream dis
protected transient java.io.DataOutputStream dos
protected transient javax.swing.JComboBox comSelectBox
protected transient javax.swing.JComboBox speedSelectBox
protected java.lang.String portName
Constructor Detail |
public CommAPITransport() throws TransportException
portName
- A string representing the Comm Port to be used.TransportException
- thrown if the Java Comm API cannot be found,
or if the Java Comm API can't find any serial ports on the users system.Method Detail |
public void close() throws TransportException
close
in class SLPTransportInterface
TransportException
- any exception encountered is rethrown.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- a Throwable as per Object.finalize().Object.finalize()
public void flush() throws TransportException
flush
in class SLPTransportInterface
TransportException
- thrown when a problem occurs with flushing the stream.public java.lang.String getTransportName()
getTransportName
in class SLPTransportInterface
public void open() throws TransportException
open
in class SLPTransportInterface
TransportException
- thrown when a problem occurs with flushing the stream.public byte readByte()
readByte
in class SLPTransportInterface
protected void setSpeed(int speed) throws TransportException
setSpeed
in class SerialTransportInterface
speed
- The speed to set the transport to.TransportException
- thrown when a problem occurs with flushing the stream.public void writeBytes(byte[] data)
writeBytes
in class SLPTransportInterface
data
- the bytes to be written to the serial port.protected javax.swing.JPanel constructConfigPanel()
constructConfigPanel
in class SLPTransportInterface
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
the
- action that was performed.public void initialize() throws TransportException
initialize
in class SLPTransportInterface
TransportException
- thrown if there isn't sufficient info to setup the transport,
or if another exception has occurred.public int getPreferredSyncSpeed()
getPreferredSyncSpeed
in class SerialTransportInterface
public void initialize(java.util.Properties properties, int id) throws TransportException
initialize
in class SLPTransportInterface
properties
- a reference to the properties file containing configuration information.id
- the transport ID number to load data for.TransportException
- if there is a problem initializing the transport.public java.lang.String getTransportExceptionText(TransportException ex)
getTransportExceptionText
in class SLPTransportInterface
ex
- the TransportException to be inspected.public java.lang.String getResourceBundleName()
getResourceBundleName
in class SLPTransportInterface
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getTransportDescription()
getTransportDescription
in class SLPTransportInterface
|
jSyncManager | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |