| java.lang.Object com.sun.midp.content.InvocationImpl
InvocationImpl | final public class InvocationImpl (Code) | | Implementation of Invocation class.
This class MUST NOT have any public methods that are not also
public in Invocation (the superclass). The sensistive methods
of the class MUST be package private.
|
Constructor Summary | |
| InvocationImpl() Create a fresh InvocationImpl. | public | InvocationImpl(Invocation invocation) Create a fresh InvocationImpl that is being delegated to byte
an Invocation instance created by an application. |
Method Summary | |
public String | findType() Finds the type of the content in this Invocation. | boolean | finish(int status) Finish this Invocation and set the status for the response.
Parameters: status - the new status of the Invocation. | public String | getAction() Gets the action to be performed on the content. | public String[] | getArgs() Gets the argument list as an array of Strings. | public byte[] | getData() Gets the data for the Invocation. | public String | getID() Gets the content handler ID for this Invocation. | public String | getInvokingAppName() Get the user-friendly name of the application that invoked
the content handler. | public String | getInvokingAuthority() Gets the authority, if any, used to authenticate the
application that invoked this request.
This value MUST be null unless the device has been
able to authenticate this application.
If non-null , it is the string identifiying the
authority. | public String | getInvokingID() Gets the ID of the application that invoked the content
handler. | public InvocationImpl | getPrevious() Returns the previous Invocation linked to this
Invocation by this application's previous call to
Registry.invoke(Invocation invocInvocation previous) . | public boolean | getResponseRequired() Gets the responseRequired mode for
this Invocation.
If true , then the invoking application requires a
response to the Invocation.
the current value of the responseRequired mode. | public int | getStatus() Returns the status of this Invocation, which can be
INIT , WAITING , HOLD ,
ACTIVE , OK ,
CANCELLED , or ERROR . | public String | getType() Gets the content type for the Invocation. | public String | getURL() Gets the URL for the invocation. | boolean | invoke(InvocationImpl previous, ContentHandlerImpl handler) Checks this Invocation and uses the ID, type, URL, and action
find a matching ContentHandler and queue this request to it. | static void | invokeNext() Execute the User Environment Policy to select the next
application to run. | public Connection | open(boolean timeouts) Creates and opens a Connection to the content accessable by
using the URL. | public void | setAction(String action) Sets the action to be performed on the content. | public void | setArgs(String[] args) Sets the argument list to a new array of Strings. | public void | setCredentials(String username, char[] password) Provide the credentials needed to access the content. | public void | setData(byte[] data) Sets the data used for the Invocation. | public void | setID(String ID) Sets the ID of the content handler for this Invocation. | public void | setResponseRequired(boolean responseRequired) Sets the responseRequired mode for
this Invocation. | void | setStatus(int status) Set the status of this InvocationImpl. | public void | setType(String type) Sets the type for the Invocation. | public void | setURL(String url) Sets the URL for the invocation. | public String | toString() Return a printable form of InvocationImpl. |
DISPOSE | final static int DISPOSE(Code) | | The DISPOSE status is used with
InvocationImpl.setStatus setStatus to discard the native Invocation. It must not overlap with
Status values defined in the Invocation class and must match
STATUS_DISPOSE defined in invocStore.c.
|
action | String action(Code) | | The action to perform on the content; may be null
|
argsLen | int argsLen(Code) | | The length (returned by get0) of the argument array.
|
arguments | String[] arguments(Code) | | The array of arguments; may be null
|
classname | String classname(Code) | | The classname of the MIDlet to deliver to.
|
data | byte[] data(Code) | | The data array; may be null .
|
dataLen | int dataLen(Code) | | The length (returned by get0) needed for the data array.
|
invocation | public Invocation invocation(Code) | | The Invocation delegating to this instance.
This field is public to Invocation can set it.
This allows the implementation to pass a InvocationImpl to
back to the Invocation class and it can wrap it in an Invocation
before passing it to the application.
|
invokingAppName | String invokingAppName(Code) | | The application name of the invoking MIDlet suite.
|
invokingAuthority | String invokingAuthority(Code) | | The authority that authenticated this Invocation.
|
invokingClassname | String invokingClassname(Code) | | The classname in the invoking MIDlet suite for the response.
|
invokingID | String invokingID(Code) | | The ID that authenticated this Invocation.
|
invokingSuiteId | int invokingSuiteId(Code) | | The MIDlet suite of the invoking application.
|
password | String password(Code) | | The password in case it is needed for authentication.
|
previousTid | int previousTid(Code) | | The tid of the previous Invocation, if any.
|
responseRequired | boolean responseRequired(Code) | | Set to true if the invoker must be notified of
completion.
|
suiteId | int suiteId(Code) | | The MIDlet suite that should handle this Invocation.
|
tid | int tid(Code) | | Transaction Identifier.
|
url | String url(Code) | | The URL of the content; may be null .
URLs of up to and including 256 characters in length MUST be
supported. A URL with a length of zero is treated as
null and is ignored..
|
username | String username(Code) | | The username in case it is needed for authentication.
|
InvocationImpl | InvocationImpl()(Code) | | Create a fresh InvocationImpl.
|
InvocationImpl | public InvocationImpl(Invocation invocation)(Code) | | Create a fresh InvocationImpl that is being delegated to byte
an Invocation instance created by an application.
Parameters: invocation - the Invocation delegating to this implementation |
findType | public String findType() throws IOException, ContentHandlerException(Code) | | Finds the type of the content in this Invocation.
If the getType method return value is
non-null , then the type is returned.
If the type is null and the URL is non-null ,
then the content type will be found by accessing the content
through the URL.
When found, the type is set as if the setType method
was called; subsequent calls to
InvocationImpl.getType getType and
InvocationImpl.findType findType will return the type.
If an exception is thrown, the getType method will
return null .
The calling thread blocks while the type is being determined.
If a network access is needed there may be an associated delay.
the non-null content type exception: IOException - if access to the content fails exception: ContentHandlerException - is thrown with a reason ofContentHandlerException.TYPE_UNKNOWNif the type is null and cannot be found from thecontent either because the URL is null or the type isnot available from the content exception: IllegalArgumentException - if the content is accessed viathe URL and the URL is invalid exception: SecurityException - is thrown if access to the contentis required and is not permitted |
finish | boolean finish(int status)(Code) | | Finish this Invocation and set the status for the response.
Parameters: status - the new status of the Invocation. This MUST be eitherOK or CANCELLED . true if the MIDlet suite MUSTvoluntarily exit before the response can be returned to theinvoking application exception: IllegalArgumentException - if the newstatus of the Invocationis not OK or CANCELLED |
getArgs | public String[] getArgs()(Code) | | Gets the argument list as an array of Strings. These values
are passed to the content handler and are returned from
the content handler.
The array is not copied; modifications to array elements
will be visible.
the arguments array, which MUST NOT be null See Also: InvocationImpl.setArgs |
getData | public byte[] getData()(Code) | | Gets the data for the Invocation. The data
is passed to the content handler.
The content handler may modify and return the data
if it returns a response.
The array is not copied; modifications to array elements
will be visible.
the data array, which MUST NOT be null See Also: InvocationImpl.setData |
getInvokingAppName | public String getInvokingAppName()(Code) | | Get the user-friendly name of the application that invoked
the content handler. This information is available only if the status is
ACTIVE or HOLD .
This information has been authenticated only if
getInvokingAuthority is non-null.
the application's name if status is ACTIVE or HOLD ; null otherwise See Also: ContentHandler.getID |
getInvokingAuthority | public String getInvokingAuthority()(Code) | | Gets the authority, if any, used to authenticate the
application that invoked this request.
This value MUST be null unless the device has been
able to authenticate this application.
If non-null , it is the string identifiying the
authority. For example,
if the application was a signed MIDlet, then this is the
"subject" of the certificate used to sign the application.
The format of the authority for X.509 certificates is defined
by the MIDP Printable Representation of X.509 Distinguished
Names as defined in class
javax.microedition.pki.Certificate .
the authority used to authenticate this applicationor null otherwise exception: IllegalStateException - if the current status is notACTIVE or HOLD See Also: ContentHandler.getAuthority |
getInvokingID | public String getInvokingID()(Code) | | Gets the ID of the application that invoked the content
handler. This information is available only if the status is
ACTIVE or HOLD .
This information has been authenticated only if
getInvokingAuthority is non-null.
the application's ID if status is ACTIVE or HOLD ; null otherwise exception: IllegalStateException - if the current status is notACTIVE or HOLD See Also: ContentHandler.getID |
getResponseRequired | public boolean getResponseRequired()(Code) | | Gets the responseRequired mode for
this Invocation.
If true , then the invoking application requires a
response to the Invocation.
the current value of the responseRequired mode. Iftrue , then a response must be returned to theinvoking application. See Also: InvocationImpl.setResponseRequired |
getStatus | public int getStatus()(Code) | | Returns the status of this Invocation, which can be
INIT , WAITING , HOLD ,
ACTIVE , OK ,
CANCELLED , or ERROR .
The application uses the status to determine how
to process an Invocation returned from
getInvocation .
See Also: javax.microedition.content.Registry.invoke the current status of this Invocation |
invoke | boolean invoke(InvocationImpl previous, ContentHandlerImpl handler) throws IllegalArgumentException, IOException, ContentHandlerException(Code) | | Checks this Invocation and uses the ID, type, URL, and action
find a matching ContentHandler and queue this request to it.
The actual launching of the application is done in the Registry.
If the previous Invocation is null then
a new transaction is created; otherwise, this
Invocation will use the same transaction as the
previous Invocation.
The status of this Invocation must be INIT .
If there is a previous Invocation, that Invocation must
have a status of ACTIVE .
Candidate content handlers are found as described in
Registry.findHandler Registry.findHandler .
If any handlers are
found, one is arbitrarily selected for this Invocation.
The status of this Invocation is set to WAITING .
If there is a non-null previous Invocation,
its status is set to HOLD .
A copy of the Invocation is made, the status is set to
ACTIVE and then queued to the
target content handler.
If the invoked content handler is not running, it must be started
as described in Invocation Processing.
The calling thread blocks while the content handler is being determined.
If a network access is needed there may be an associated delay.
Parameters: previous - a previous Invocation for this Invocation;may be null Parameters: handler - the ContentHandlerImpl that is the target true if the application MUST firstvoluntarily exit before the content handler can be started;false otherwise exception: IllegalArgumentException - is thrown if: - the
classname does not implement thelifecycle required by the Java runtime, or - the ID, type, and URL are all
null , or - the argument array contains any
null references
exception: IOException - is thrown if the URL to be accessed isnot available exception: ContentHandlerException - is thrown with a reason of:TYPE_UNKNOWN if the typeis not set and cannot be determined from the URL, orNO_REGISTERED_HANDLER ifthere is no registered content handler for the type orID
exception: IllegalStateException - is thrown if the status of thisInvocation is not INIT or if the status of the previousInvocation, if any, is not ACTIVE exception: SecurityException - if an invoke operation is not permitted |
invokeNext | static void invokeNext()(Code) | | Execute the User Environment Policy to select the next
application to run.
Check for and select the next MIDlet suite to run
based on the contents of the Invocation queue.
From the most recently queued Invocation that is an Invocation
in INIT.
If none, find the most recently queued Invocation that is
a response.
|
open | public Connection open(boolean timeouts) throws IOException(Code) | | Creates and opens a Connection to the content accessable by
using the URL. This method is
equivalent to
javax.microedition.io.Connector.open Connector.open with the URL provided.
The application should use this method to access the
content of the URL
so that any type or content information cached by the
implementation can be fully utilized. The content is opened
in read only mode.
Parameters: timeouts - a flag to indicate that the callerwants timeout exceptions a Connection object exception: ConnectionNotFoundException - is thrown if:- there is no URL, or
- the target URL cannot be found, or
- the requested protocol type is not supported
exception: IOException - if some other kind of I/O error occurs exception: SecurityException - may be thrown if access to theprotocol handler is prohibited |
setAction | public void setAction(String action)(Code) | | Sets the action to be performed on the content.
Parameters: action - the action to be performed on the content;may be null See Also: InvocationImpl.getAction |
setArgs | public void setArgs(String[] args)(Code) | | Sets the argument list to a new array of Strings. The arguments
are used by the application to communicate to the content
handler and return results from the content handler.
The values of the arguments are not checked when they are set.
Instead, they are checked during
Registry.invoke Registry.invoke to
check that none of the values are null .
Parameters: args - the String array; may be null .A null argument is treated the same as a zero-length array See Also: InvocationImpl.getArgs |
setCredentials | public void setCredentials(String username, char[] password)(Code) | | Provide the credentials needed to access the content.
Parameters: username - the username; may be null Parameters: password - the password for the username;may be null |
setData | public void setData(byte[] data)(Code) | | Sets the data used for the Invocation. The data
is used by the application to communicate to the content
handler and return data from the content handler.
Parameters: data - the byte data array; may be null .A null is treated the same as a zero-length array See Also: InvocationImpl.getData |
setID | public void setID(String ID)(Code) | | Sets the ID of the content handler for this Invocation.
Parameters: ID - of the content handler; may be null See Also: InvocationImpl.getID |
setResponseRequired | public void setResponseRequired(boolean responseRequired)(Code) | | Sets the responseRequired mode for
this Invocation.
If true , then the invoking application requires a
response to the Invocation.
The value in the request can be changed only if the status is
INIT .
Parameters: responseRequired - true to require a response,false otherwise exception: IllegalStateException - is thrown if the status is notINIT See Also: InvocationImpl.getResponseRequired |
setStatus | void setStatus(int status)(Code) | | Set the status of this InvocationImpl.
If the invocation is still active in the native code
set the status in native also.
Parameters: status - the new status |
setType | public void setType(String type)(Code) | | Sets the type for the Invocation.
Parameters: type - the type to be set for the content; may be null See Also: InvocationImpl.getType |
toString | public String toString()(Code) | | Return a printable form of InvocationImpl.
Disabled if not logging
a String containing a printable form |
|
|