⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 javax.comm.commportownershiplistener.html

📁 java串口通讯api
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sun Nov 15 16:06:15 PST 1998 -->
<title>
  Interface javax.comm.CommPortOwnershipListener
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-javax.comm.html">This Package</a>  <a href="javax.comm.CommDriver.html#_top_">Previous</a>  <a href="javax.comm.ParallelPortEventListener.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface javax.comm.CommPortOwnershipListener
</h1>
<dl>
  <dt> public interface <b>CommPortOwnershipListener</b>
  <dt> extends EventListener
</dl>
Propagates various communications port ownership events. When a port is opened, a <CODE>CommPortOwnership</CODE> event of type <CODE>PORT_OWNED</CODE> will be propagated. When a port is closed, a <CODE>CommPortOwnership</CODE> event of type <CODE>PORT_UNOWNED</CODE> will be propagated. <P> Multiple applications that are seeking ownership of a communications port can resolve their differences as follows: <UL> <LI> ABCapp calls <CODE>open</CODE> and takes ownership of port. <LI> XYZapp calls <CODE>open</CODE> sometime later. <LI> While processing XYZapp's <CODE>open</CODE>, <CODE>CommPortIdentifier</CODE> will propagate a <CODE>CommPortOwnership</CODE> event with the event type <CODE>PORT_OWNERSHIP_REQUESTED</CODE>. <LI> If ABCapp is registered to listen to these events and if it is willing to give up ownership, it calls <CODE>close</CODE> from within the event callback. <LI> After the event has been fired, <CODE>CommPortIdentifier</CODE> checks to see if ownership was given up, and if so, turns over ownership of the port to XYZapp by returning success from <CODE>open</CODE>. </UL> Note: When a <CODE>close</CODE> is called from within a <CODE>CommPortOwnership</CODE> event callback, a new <CODE>CommPortOwnership</CODE> event will <I>not</I> be generated.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="javax.comm.CommPort.html#_top_">CommPort</a>, <a href="javax.comm.CommPortIdentifier.html#_top_">CommPortIdentifier</a>, EventListener
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PORT_OWNED"><b>PORT_OWNED</b></a>
  <dd>  The port just went from unowned to owned state, when an application successfully called <CODE>CommPortIdentifier.open</CODE>.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PORT_OWNERSHIP_REQUESTED"><b>PORT_OWNERSHIP_REQUESTED</b></a>
  <dd>  Ownership contention.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PORT_UNOWNED"><b>PORT_UNOWNED</b></a>
  <dd>  The port just went from owned to unowned state, when the port's owner called <CODE>CommPort.close</CODE>.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#ownershipChange(int)"><b>ownershipChange</b></a>(int)
  <dd>  Propagates a <CODE>CommPortOwnership</CODE> event.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="PORT_OWNED"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>PORT_OWNED</b>
<pre>
 public static final int PORT_OWNED
</pre>
<dl>
  <dd> The port just went from unowned to owned state, when an application successfully called <CODE>CommPortIdentifier.open</CODE>.<p>
</dl>
<a name="PORT_UNOWNED"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>PORT_UNOWNED</b>
<pre>
 public static final int PORT_UNOWNED
</pre>
<dl>
  <dd> The port just went from owned to unowned state, when the port's owner called <CODE>CommPort.close</CODE>.<p>
</dl>
<a name="PORT_OWNERSHIP_REQUESTED"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>PORT_OWNERSHIP_REQUESTED</b>
<pre>
 public static final int PORT_OWNERSHIP_REQUESTED
</pre>
<dl>
  <dd> 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 <CODE>CommPort.close</CODE> during the processing of this event and thereby give up ownership of the port.<p>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="ownershipChange(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="ownershipChange"><b>ownershipChange</b></a>
<pre>
 public abstract void ownershipChange(int type)
</pre>
<dl>
  <dd> Propagates a <CODE>CommPortOwnership</CODE> event. This method will be called with the type set to one of the variables <CODE>PORT_OWNED</CODE>, <CODE>PORT_UNOWNED</CODE>, or <CODE>PORT_OWNERSHIP_REQUESTED</CODE>.
<p>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-javax.comm.html">This Package</a>  <a href="javax.comm.CommDriver.html#_top_">Previous</a>  <a href="javax.comm.ParallelPortEventListener.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -