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

📄 pushregistry.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Sep 24 14:57:49 PDT 2003 -->
<TITLE>
MID Profile: Class  PushRegistry
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/PushRegistry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/io/Connector.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="PushRegistry.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.io</FONT>
<BR>
Class  PushRegistry</H2>
<PRE>
<A HREF="../../../java/lang/Object.html">java.lang.Object</A>
  |
  +--<B>javax.microedition.io.PushRegistry</B>
</PRE>
<HR>
<DL>
<DT>public class <B>PushRegistry</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A></DL>

<P>
The <code>PushRegistry</code> maintains a list of inbound connections. An application can register the inbound connections with an entry in the application descriptor file or dynamically by calling the <code>registerConnection</code> method. <P> While an application is running, it is responsible for all I/O operations associated with the inbound connection. When the application is not running, the application management software(AMS) listens for inbound notification requests. When a notification arrives for a registered <code>MIDlet</code>, the AMS will start the <code>MIDlet</code> via the normal invocation of <code>MIDlet.startApp</code> method.</P> <H3> Installation Handling of Declared Connections </H3> <P> To avoid collisions on inbound generic connections, the application descriptor file MUST include information about static connections that are needed by the <code>MIDlet</code> suite. If all the static Push declarations in the application descriptor can not be fulfilled during the installation, the user MUST be notified that there are conflicts and the MIDlet suite MUST NOT be installed. (See <em>Over The Air User Initiated Provisioning Specification</em> section for errors reported in the event of conflicts.) Conditions when the declarations can not be fulfilled include: syntax errors in the Push attributes, declaration for a connection end point (e.g. port number) that is already reserved in the device, declaration for a protocol that is not supported for Push in the device, and declaration referencing a <code>MIDlet</code> class that is not listed in the <code>MIDlet-&lt;n&gt;</code> attributes of the same application descriptor. If the <code>MIDlet</code> suite can function meaningfully even if a Push registration can't be fulfilled, it MUST register the Push connections using the dynamic registration methods in the <code>PushRegistry</code>. </P> <P> A conflict-free installation reserves each requested connection for the exclusive use of the <code>MIDlets</code> in the suite. While the suite is installed, any attempt by other applications to open one of the reserved connections will fail with an <code>IOException</code>. A call from a <code>MIDlet</code> to <code>Connector.open()</code> on a connection reserved for its suite will always succeed, assuming the suite does not already have the connection open. </P> <P> If two <code>MIDlet</code> suites have a static push connection in common, they cannot be installed together and both function correctly. The end user would typically have to uninstall one before being able to successfully install the other. </P> <H3> <A NAME="PushAttr"></A>Push Registration Attribute </H3> <P> Each push registration entry contains the following information : <CODE><BLOCKQUOTE> <strong>MIDlet-Push-</strong>&lt;n&gt;: &lt;ConnectionURL&gt;,      &lt;MIDletClassName&gt;, &lt;AllowedSender&gt; </BLOCKQUOTE> </CODE>  where : <UL> <LI> <code>MIDlet-Push-&lt;n&gt;</code> =    the Push registration attribute name. Multiple push    registrations can be provided in a <code>MIDlet</code>    suite. The numeric value for &lt;n&gt; starts from 1 and    MUST use consecutive ordinal numbers for additional entries.    The first missing entry terminates the list. Any    additional entries are ignored. </LI> <LI><code>ConnectionURL</code> =    the connection string used in <code>Connector.open()</code></LI> <LI><code>MIDletClassName</code> =   the <code>MIDlet</code> that is responsible for the connection.   The named <code>MIDlet</code> MUST be registered in the   descriptor file or the jar file manifest with a   <code>MIDlet-&lt;n&gt;</code> record.   (This information is needed when displaying messages to   the user about the application when push connections are detected,   or when the user grants/revokes priveleges for the application.)   If the named <code>MIDlet</code> appears more than once in the   suite, the first matching entry is used.  </LI> <LI> <code>AllowedSender</code> = a designated filter that restricts which senders are valid for launching the requested <code>MIDlet</code>. The syntax and semantics of the <code>AllowedSender</code> field depend on the addressing format used for the protocol. However, every syntax for this field MUST support using the wildcard characters "*" and "?". The semantics of those wildcard are: <UL>   <LI> "*" matches any string, including an empty string </LI>   <LI> "?" matches any single character </LI> </UL> When the value of this field is just the wildcard character "*", connections will be accepted from any originating source. For Push attributes using the <CODE>datagram</CODE> and <CODE>socket</CODE> URLs (if supported by the platform), this field contains a numeric IP address in the same format for IPv4 and IPv6 as used in the respective URLs (IPv6 address including the square brackets as in the URL). It is possible to use the wildcards also in these IP addresses, e.g. "129.70.40.*" would allow subnet resolution.  Note that the port number is not part of the filter for <CODE>datagram</CODE> and <CODE>socket</CODE> connections. </LI> </UL> <P> The MIDP 2.0 specification defines the syntax for <code>datagram</code> and <code>socket</code> inbound connections. When other specifications define push semantics for additional connection types, they must define the expected syntax for the filter field, as well as the expected format for the connection URL string. </P> <H4> Example Descriptor File Declarative Notation </H4> <P> The following is a sample descriptor file entry that would reserve a stream socket at port 79 and a datagram connection at port 50000. (Port numbers are maintained by IANA and cover well-known, user-registered and dynamic port numbers) [See <a href="http://www.iana.org/numbers.html#P"> IANA Port Number Registry</a>] </P> <CODE> <PRE>  MIDlet-Push-1: socket://:79, com.sun.example.SampleChat, *  MIDlet-Push-2: datagram://:50000, com.sun.example.SampleChat, * </PRE> </CODE> <H3> Buffered Messages </H3> <P> The requirements for buffering of messages are specific to each protocol used for Push and are defined separately for each protocol. There is no general requirement related to buffering that would apply to all protocols. If the implementation buffers messages, these messages MUST be provided to the <code>MIDlet</code> when the <code>MIDlet</code> is started and it opens the related <code>Connection</code> that it has registered for Push. </P> <P> When datagram connections are supported with Push, the implementation MUST guarantee that when a <code>MIDlet</code> registered for datagram Push is started in response to an incoming datagram, at least the datagram that caused the startup of the <code>MIDlet</code> is buffered by the implementation and will be available to the <code>MIDlet</code> when the <code>MIDlet</code> opens the <code>UDPDatagramConnection</code> after startup. </P> <P> When socket connections are supported with Push, the implementation MUST guarantee that when a <code>MIDlet</code> registered for socket Push is started in response to an incoming socket connection, this connection can be accepted by the <code>MIDlet</code> by opening the <code>ServerSocketConnection</code> after startup, provided that the connection hasn't timed out meanwhile. </P> <H3> Connection vs Push Registration Support </H3> <P> Not all generic connections will be appropriate for use as push application transport. Even if a protocol is supported on the device as an inbound connection type, it is not required to be enabled as a valid push mechanism. e.g. a platform might support server socket connections in a <code>MIDlet</code>, but might not support inbound socket connections for push launch capability. A <code>ConnectionNotFoundException</code> is thrown from the <code>registerConnection</code> and from the <code>registerAlarm</code> methods, when the platform does not support that optional capability. </P> <H3> AMS Connection Handoff </H3> <P> Responsibility for registered push connections is shared between the AMS and the <code>MIDlet</code> that handles the I/O operations on the inbound connection. To prevent any data from being lost, an application is responsible for all I/O operations on the connection from the time it calls <code>Connector.open()</code> until it calls <code>Connection.close()</code>. </P> <P> The AMS listens for inbound connection notifications. This MAY be handled via a native callback or polling mechanism looking for new inbound data. The AMS is responsible for enforcing the <A HREF="package-summary.html#push">Security of PushRegistry</A> and presenting notifications (if any) to the user before invoking the MIDlet suite.</P> <P> The AMS is responsible for the shutdown of any running applications (if necessary) prior to the invocation of the push <code>MIDlet</code> method. </P> <P> After the AMS has started the push application, the <code>MIDlet</code> is responsible for opening the connections and for all subsequent I/O operations. An application that needs to perform blocking I/O operations SHOULD use a separate thread to allow for interactive user operations. Once the application has been started and the connection has been opened, the AMS is no longer responsible for listening for push notifications for that connection. The application is responsible for reading all inbound data. </P> <P> If an application has finished with all inbound data it MAY <code>close()</code> the connection. If the connection is closed, then neither the AMS nor the application will be listening for push notifications. Inbound data could be lost, if the application closes the connection before all data has been received. </P> <P> When the application is destroyed, the AMS resumes its responsiblity to watch for inbound connections. </P> <P> A push application SHOULD behave in a predictable manner when handling asynchronous data via the push mechanism. A well behaved application SHOULD inform the user that

⌨️ 快捷键说明

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