Java Reference
In-Depth Information
2.7 Using the Push Registry
The Push Registry API is encapsulated in the javax.microedition.
io.PushRegistry class. It maintains a list of inbound connections
that have been previously registered by installed MIDlets. A MIDlet
registers an incoming connection with the push registry either statically at
installation via an entry in the JAD file or dynamically (programmatically)
via the registerConnection() method.
When a MIDlet is running, it handles all the incoming connections
(whether registered with the push registry or not). When the MIDlet is
not running, the AMS launches the MIDlet in response to an incoming
connection previously registered by it, by invoking the startApp()
method. The AMS then hands off the connection to the MIDlet which
is responsible for opening the appropriate connection and handling the
communication. In the case of static registration, the MIDlet registers
its interest in incoming connections in the JAD file, in the following
format:
MIDlet-Push-<n>: <ConnectionURL>, <MIDletClassName>, <AllowedSender>
field specifies the protocol and port for the
connection end point in the same URI syntax used by the argument
to the Connector.open() method that
The
< ConnectionURL >
is used by the MIDlet
to
process the incoming connection. Examples of
< ConnectionURL >
entries might be:
sms://:1234
socket://:1234
field contains the package-qualified
name of the class that extends javax.microedition.midlet.MID-
let . This would be the name of the MIDlet class as listed in the
application descriptor or manifest file under the MIDlet- < n >
The
< MIDletClassName >
entry.
The
field acts as a filter indicating that the AMS
should only respond to incoming connections from a specific sender.
For the SMS protocol,
< AllowedSender >
entry is the phone
number of the required sender. For a server socket connection end-
point, the
the
< AllowedSender >
entry would be an IP address (in both
cases, note that the sender port number is not included in the filter). The
< AllowedSender >
< AllowedSender >
syntax supports two wildcard characters: * matches
any string including an empty string and ? matches any character. Hence
the following would be valid entries for the
< AllowedSender >
field:
Search WWH ::




Custom Search