📄 pushregistry.html
字号:
<DL>
<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/io/PushRegistry.html#getFilter(java.lang.String)">getFilter</A></B>(<A HREF="../../../java/lang/String.html">String</A> connection)</CODE>
<BR>
Retrieve the registered filter for a requested connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/io/PushRegistry.html#getMIDlet(java.lang.String)">getMIDlet</A></B>(<A HREF="../../../java/lang/String.html">String</A> connection)</CODE>
<BR>
Retrieve the registered <code>MIDlet</code> for a requested connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../java/lang/String.html">String</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/io/PushRegistry.html#listConnections(boolean)">listConnections</A></B>(boolean available)</CODE>
<BR>
Return a list of registered connections for the current <code>MIDlet</code> suite.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/io/PushRegistry.html#registerAlarm(java.lang.String, long)">registerAlarm</A></B>(<A HREF="../../../java/lang/String.html">String</A> midlet, long time)</CODE>
<BR>
Register a time to launch the specified application.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/io/PushRegistry.html#registerConnection(java.lang.String, java.lang.String, java.lang.String)">registerConnection</A></B>(<A HREF="../../../java/lang/String.html">String</A> connection, <A HREF="../../../java/lang/String.html">String</A> midlet, <A HREF="../../../java/lang/String.html">String</A> filter)</CODE>
<BR>
Register a dynamic connection with the application management software.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/io/PushRegistry.html#unregisterConnection(java.lang.String)">unregisterConnection</A></B>(<A HREF="../../../java/lang/String.html">String</A> connection)</CODE>
<BR>
Remove a dynamic connection registration.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="registerConnection(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
registerConnection</H3>
<PRE>
public static void <B>registerConnection</B>(<A HREF="../../../java/lang/String.html">String</A> connection, <A HREF="../../../java/lang/String.html">String</A> midlet, <A HREF="../../../java/lang/String.html">String</A> filter) throws <A HREF="../../../java/lang/ClassNotFoundException.html">ClassNotFoundException</A>, <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Register a dynamic connection with the application management software. Once registered, the dynamic connection acts just like a connection preallocated from the descriptor file. <P> The arguments for the dynamic connection registration are the same as the <A HREF="#PushAttr">Push Registration Attribute</A> used for static registrations. </P> <P> If the <code>connection</code> or <code>filter</code> arguments are <code>null</code>, then an <code>IllegalArgumentException</code> will be thrown. If the <code>midlet</code> argument is <code>null</code> a <code>ClassNotFoundException</code> will be thrown. </P><DD><DL>
<DT><B>Parameters:</B><DD><CODE>connection</CODE> - generic connection <em>protocol</em>, <em>host</em> and <em>port number</em> (optional parameters may be included separated with semi-colons (;))<DD><CODE>midlet</CODE> - class name of the <code>MIDlet</code> to be launched, when new external data is available. The named <code>MIDlet</code> MUST be registered in the descriptor file or the jar file manifest with a MIDlet-<n> record. This parameter has the same semantics as the MIDletClassName in the Push registration attribute defined above in the class description.<DD><CODE>filter</CODE> - a connection URL string indicating which senders are allowed to cause the <code>MIDlet</code> to be launched<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the connection string is not valid, or if the filter string is not valid<DD><CODE><A HREF="../../../javax/microedition/io/ConnectionNotFoundException.html">ConnectionNotFoundException</A></CODE> - if the runtime system does not support push delivery for the requested connection protocol<DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if the connection is already registered or if there are insufficient resources to handle the registration request<DD><CODE><A HREF="../../../java/lang/ClassNotFoundException.html">ClassNotFoundException</A></CODE> - if the <code>MIDlet</code> class name can not be found in the current <code>MIDlet</code> suite or if this class is not included in any of the MIDlet-<n> records in the descriptor file or the jar file manifest<DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the <code>MIDlet</code> does not have permission to register a connection<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/PushRegistry.html#unregisterConnection(java.lang.String)"><CODE>unregisterConnection(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="unregisterConnection(java.lang.String)"><!-- --></A><H3>
unregisterConnection</H3>
<PRE>
public static boolean <B>unregisterConnection</B>(<A HREF="../../../java/lang/String.html">String</A> connection)</PRE>
<DL>
<DD>Remove a dynamic connection registration.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>connection</CODE> - generic connection <em>protocol</em>, <em>host</em> and <em>port number</em><DT><B>Returns:</B><DD><code>true</code> if the unregistration was successful, <code>false</code> if the connection was not registered or if the connection argument was <code>null</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the connection was registered by another <code>MIDlet</code> suite<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/PushRegistry.html#registerConnection(java.lang.String, java.lang.String, java.lang.String)"><CODE>registerConnection(java.lang.String, java.lang.String, java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="listConnections(boolean)"><!-- --></A><H3>
listConnections</H3>
<PRE>
public static <A HREF="../../../java/lang/String.html">String</A>[] <B>listConnections</B>(boolean available)</PRE>
<DL>
<DD>Return a list of registered connections for the current <code>MIDlet</code> suite.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>available</CODE> - if <code>true</code>, only return the list of connections with input available, otherwise return the complete list of registered connections for the current <code>MIDlet</code> suite<DT><B>Returns:</B><DD>array of registered connection strings, where each connection is represented by the generic connection <em>protocol</em>, <em>host</em> and <em>port number</em> identification</DL>
</DD>
</DL>
<HR>
<A NAME="getMIDlet(java.lang.String)"><!-- --></A><H3>
getMIDlet</H3>
<PRE>
public static <A HREF="../../../java/lang/String.html">String</A> <B>getMIDlet</B>(<A HREF="../../../java/lang/String.html">String</A> connection)</PRE>
<DL>
<DD>Retrieve the registered <code>MIDlet</code> for a requested connection.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>connection</CODE> - generic connection <em>protocol</em>, <em>host</em> and <em>port number</em> (optional parameters may be included separated with semi-colons (;))<DT><B>Returns:</B><DD>class name of the <code>MIDlet</code> to be launched, when new external data is available, or <code>null</code> if the connection was not registered by the current <code>MIDlet</code> suite or if the connection argument was <code>null</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/PushRegistry.html#registerConnection(java.lang.String, java.lang.String, java.lang.String)"><CODE>registerConnection(java.lang.String, java.lang.String, java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getFilter(java.lang.String)"><!-- --></A><H3>
getFilter</H3>
<PRE>
public static <A HREF="../../../java/lang/String.html">String</A> <B>getFilter</B>(<A HREF="../../../java/lang/String.html">String</A> connection)</PRE>
<DL>
<DD>Retrieve the registered filter for a requested connection.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>connection</CODE> - generic connection <em>protocol</em>, <em>host</em> and <em>port number</em> (optional parameters may be included separated with semi-colons (;))<DT><B>Returns:</B><DD>a filter string indicating which senders are allowed to cause the <code>MIDlet</code> to be launched or <code>null</code>, if the connection was not registered by the current <code>MIDlet</code> suite or if the connection argument was <code>null</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/io/PushRegistry.html#registerConnection(java.lang.String, java.lang.String, java.lang.String)"><CODE>registerConnection(java.lang.String, java.lang.String, java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="registerAlarm(java.lang.String, long)"><!-- --></A><H3>
registerAlarm</H3>
<PRE>
public static long <B>registerAlarm</B>(<A HREF="../../../java/lang/String.html">String</A> midlet, long time) throws <A HREF="../../../java/lang/ClassNotFoundException.html">ClassNotFoundException</A>, <A HREF="../../../javax/microedition/io/ConnectionNotFoundException.html">ConnectionNotFoundException</A></PRE>
<DL>
<DD>Register a time to launch the specified application. The <code>PushRegistry</code> supports one outstanding wake up time per <code>MIDlet</code> in the current suite. An application is expected to use a <code>TimerTask</code> for notification of time based events while the application is running. <P>If a wakeup time is already registered, the previous value will be returned, otherwise a zero is returned the first time the alarm is registered. </P><DD><DL>
<DT><B>Parameters:</B><DD><CODE>midlet</CODE> - class name of the <code>MIDlet</code> within the current running <code>MIDlet</code> suite to be launched, when the alarm time has been reached. The named <code>MIDlet</code> MUST be registered in the descriptor file or the jar file manifest with a MIDlet-<n> record. This parameter has the same semantics as the MIDletClassName in the Push registration attribute defined above in the class description.<DD><CODE>time</CODE> - time at which the <code>MIDlet</code> is to be executed in the format returned by <code>Date.getTime()</code><DT><B>Returns:</B><DD>the time at which the most recent execution of this <code>MIDlet</code> was scheduled to occur, in the format returned by <code>Date.getTime()</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/microedition/io/ConnectionNotFoundException.html">ConnectionNotFoundException</A></CODE> - if the runtime system does not support alarm based application launch<DD><CODE><A HREF="../../../java/lang/ClassNotFoundException.html">ClassNotFoundException</A></CODE> - if the <code>MIDlet</code> class name can not be found in the current <code>MIDlet</code> suite or if this class is not included in any of the MIDlet-<n> records in the descriptor file or the jar file manifest or if the <code>midlet</code> argument is <code>null</code><DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the <code>MIDlet</code> does not have permission to register an alarm<DT><B>See Also: </B><DD><A HREF="../../../java/util/Date.html#getTime()"><CODE>Date.getTime()</CODE></A>,
<A HREF="../../../java/util/Timer.html"><CODE>Timer</CODE></A>,
<A HREF="../../../java/util/TimerTask.html"><CODE>TimerTask</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PushRegistry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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">
<A HREF="../../../javax/microedition/io/Connector.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="PushRegistry.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -