javax.comm
Interface CommPortOwnershipListener

All Superinterfaces:
java.util.EventListener

public interface CommPortOwnershipListener
extends java.util.EventListener

Propagates various communications port ownership events. When a port is opened, a CommPortOwnership event of type PORT_OWNED will be propagated. When a port is closed, a CommPortOwnership event of type PORT_UNOWNED will be propagated.

Multiple applications that are seeking ownership of a communications port can resolve their differences as follows:

Note: When a close is called from within a CommPortOwnership event callback, a new CommPortOwnership event will not be generated.

Version:
1.9, 21 Jan 1998
Author:
Jagane Sundar
See Also:
CommPort, CommPortIdentifier, EventListener

Field Summary
static int PORT_OWNED
          The port just went from unowned to owned state, when an application successfully called CommPortIdentifier.open.
static int PORT_OWNERSHIP_REQUESTED
          Ownership contention.
static int PORT_UNOWNED
          The port just went from owned to unowned state, when the port's owner called CommPort.close.
 
Method Summary
 void ownershipChange(int type)
          Propagates a CommPortOwnership event.
 

Field Detail

PORT_OWNED

public static final int PORT_OWNED
The port just went from unowned to owned state, when an application successfully called CommPortIdentifier.open.

See Also:
Constant Field Values

PORT_UNOWNED

public static final int PORT_UNOWNED
The port just went from owned to unowned state, when the port's owner called CommPort.close.

See Also:
Constant Field Values

PORT_OWNERSHIP_REQUESTED

public static final int PORT_OWNERSHIP_REQUESTED
Ownership contention. The port is owned by one application and another application wants ownership. If the owner of this port is listening to this event, it can call CommPort.close during the processing of this event and thereby give up ownership of the port.

See Also:
Constant Field Values
Method Detail

ownershipChange

public void ownershipChange(int type)
Propagates a CommPortOwnership event. This method will be called with the type set to one of the variables PORT_OWNED, PORT_UNOWNED, or PORT_OWNERSHIP_REQUESTED.