|
2009-01-09 1.2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.comm.CommPortIdentifier
public class CommPortIdentifier
| Field Summary | |
|---|---|
(package private) static CommDriver |
commDriver
|
(package private) CommPort |
commPort
|
(package private) boolean |
currentlyOwned
|
(package private) java.lang.String |
currentOwner
|
(package private) static java.util.Hashtable |
identifiers
|
(package private) static boolean |
initialized
|
(package private) java.lang.String |
name
|
static int |
pollingTime
Define polling time value. |
static int |
PORT_PARALLEL
Define port parallel value. |
static int |
PORT_SERIAL
Define port serial value. |
(package private) int |
type
|
| Method Summary | |
|---|---|
static void |
addPortName(java.lang.String portName,
int portType,
CommDriver commDriver)
Adds portName to the list of ports. |
void |
addPortOwnershipListener(CommPortOwnershipListener listener)
Registers an interested application so that it can receive notification of changes in port ownership. |
void |
closePort()
Non-Api method. |
(package private) void |
fireOwnershipEvent(int eventType)
This method needs to be called when ownership of the port changes. |
java.lang.String |
getCurrentOwner()
Returns the owner of the port. |
java.lang.String |
getName()
Returns the name of the port. |
static CommPortIdentifier |
getPortIdentifier(CommPort port)
Obtains the CommPortIdentifier object corresponding to a port that has already been opened by the application. |
static CommPortIdentifier |
getPortIdentifier(java.lang.String portName)
Obtains a CommPortIdentifier object by using a port name. |
static java.util.Enumeration |
getPortIdentifiers()
Obtains an enumeration object that contains a CommPortIdentifier object for each port in the system. |
int |
getPortType()
Returns the port type. |
(package private) void |
internalClosePort()
Non-Api method. |
boolean |
isCurrentlyOwned()
Checks whether the port is owned. |
CommPort |
open(java.io.FileDescriptor fileDescriptor)
Opens the communications port using a FileDescriptor object on platforms that support this technique. |
CommPort |
open(java.lang.String appName,
int timeout)
|
void |
removePortOwnershipListener(CommPortOwnershipListener listener)
Deregisters a CommPortOwnershipListener registered using addPortOwnershipListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int pollingTime
public static final int PORT_SERIAL
public static final int PORT_PARALLEL
static CommDriver commDriver
static boolean initialized
static java.util.Hashtable identifiers
java.lang.String name
java.lang.String currentOwner
boolean currentlyOwned
CommPort commPort
int type
| Method Detail |
|---|
public static void addPortName(java.lang.String portName,
int portType,
CommDriver commDriver)
portName to the list of ports.
portName - The name of the port being addedportType - The type of the port being addedcommDriver - The driver representing the port being addedCommDriver
public static CommPortIdentifier getPortIdentifier(CommPort port)
throws NoSuchPortException
CommPortIdentifier object corresponding to a port that has already been opened by the application.
port - a CommPort object obtained from a previous open
NoSuchPortException - if the port object is invalid
public static CommPortIdentifier getPortIdentifier(java.lang.String portName)
throws NoSuchPortException
CommPortIdentifier object by using a port name. The port name may have been stored in persistent storage by the application.
portName - name of the port to open
CommPortIdentifier object
NoSuchPortException - if the port does not existpublic static java.util.Enumeration getPortIdentifiers()
CommPortIdentifier object for each port in the system.
Enumeration object that can be used to enumerate all the ports known to the systemEnumerationpublic void addPortOwnershipListener(CommPortOwnershipListener listener)
PORT_OWNED: Port became owned
PORT_UNOWNED: Port became unowned
PORT_OWNERSHIP_REQUESTED: If the application owns this port and is willing to give up ownership, then it should call close now.
ownershipChange method of the listener registered using addPortOwnershipListener will be called with one of the above events.
listener - a CommPortOwnershipListener callback objectpublic void closePort()
void fireOwnershipEvent(int eventType)
public java.lang.String getCurrentOwner()
public java.lang.String getName()
public int getPortType()
void internalClosePort()
public boolean isCurrentlyOwned()
true if the port is owned by some application, false if the port is not owned.
public CommPort open(java.io.FileDescriptor fileDescriptor)
throws UnsupportedCommOperationException
FileDescriptor object on platforms that support this technique.
fileDescriptor - The FileDescriptor object used to build a CommPort.
CommPort object.
UnsupportedCommOperationException - is thrown on platforms which do not support this functionality.
public CommPort open(java.lang.String appName,
int timeout)
throws PortInUseException
appName - timeout -
PortInUseExceptionpublic void removePortOwnershipListener(CommPortOwnershipListener listener)
CommPortOwnershipListener registered using addPortOwnershipListener
listener - The CommPortOwnershipListener object that was previously registered using addPortOwnershipListener
|
2009-01-09 1.2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||