Java Doc for InvocationImpl.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » content » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.content 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.



Field Summary
final static  intDISPOSE
     The DISPOSE status is used with InvocationImpl.setStatus setStatus to discard the native Invocation.
 StringID
    
 Stringaction
    
 intargsLen
     The length (returned by get0) of the argument array.
 String[]arguments
    
 Stringclassname
     The classname of the MIDlet to deliver to.
 byte[]data
     The data array; may be null.
 intdataLen
     The length (returned by get0) needed for the data array.
public  Invocationinvocation
     The Invocation delegating to this instance.
 StringinvokingAppName
     The application name of the invoking MIDlet suite.
 StringinvokingAuthority
     The authority that authenticated this Invocation.
 StringinvokingClassname
     The classname in the invoking MIDlet suite for the response.
 StringinvokingID
     The ID that authenticated this Invocation.
 intinvokingSuiteId
     The MIDlet suite of the invoking application.
 Stringpassword
     The password in case it is needed for authentication.
 InvocationImplprevious
     The previous invocation, if any.
 intpreviousTid
     The tid of the previous Invocation, if any.
 booleanresponseRequired
     Set to true if the invoker must be notified of completion.
 intstatus
     The status of the request; one of Invocation.ACTIVE , Invocation.WAITING , Invocation.ERROR , Invocation.OK , or Invocation.CANCELLED .
 intsuiteId
     The MIDlet suite that should handle this Invocation.
 inttid
     Transaction Identifier.
 Stringtype
     The content type; may be null.
 Stringurl
     The URL of the content; may be null. URLs of up to and including 256 characters in length MUST be supported.
 Stringusername
     The username in case it is needed for authentication.

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  StringfindType()
     Finds the type of the content in this Invocation.
 booleanfinish(int status)
     Finish this Invocation and set the status for the response.
Parameters:
  status - the new status of the Invocation.
public  StringgetAction()
     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  StringgetID()
     Gets the content handler ID for this Invocation.
public  StringgetInvokingAppName()
     Get the user-friendly name of the application that invoked the content handler.
public  StringgetInvokingAuthority()
     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  StringgetInvokingID()
     Gets the ID of the application that invoked the content handler.
public  InvocationImplgetPrevious()
     Returns the previous Invocation linked to this Invocation by this application's previous call to Registry.invoke(Invocation invocInvocation previous) .
public  booleangetResponseRequired()
     Gets the responseRequired mode for this Invocation. If true, then the invoking application requires a response to the Invocation. the current value of the responseRequiredmode.
public  intgetStatus()
     Returns the status of this Invocation, which can be INIT, WAITING, HOLD, ACTIVE, OK, CANCELLED, or ERROR.
public  StringgetType()
     Gets the content type for the Invocation.
public  StringgetURL()
     Gets the URL for the invocation.
 booleaninvoke(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  voidinvokeNext()
     Execute the User Environment Policy to select the next application to run.
public  Connectionopen(boolean timeouts)
     Creates and opens a Connection to the content accessable by using the URL.
public  voidsetAction(String action)
     Sets the action to be performed on the content.
public  voidsetArgs(String[] args)
     Sets the argument list to a new array of Strings.
public  voidsetCredentials(String username, char[] password)
     Provide the credentials needed to access the content.
public  voidsetData(byte[] data)
     Sets the data used for the Invocation.
public  voidsetID(String ID)
     Sets the ID of the content handler for this Invocation.
public  voidsetResponseRequired(boolean responseRequired)
     Sets the responseRequired mode for this Invocation.
 voidsetStatus(int status)
     Set the status of this InvocationImpl.
public  voidsetType(String type)
     Sets the type for the Invocation.
public  voidsetURL(String url)
     Sets the URL for the invocation.
public  StringtoString()
     Return a printable form of InvocationImpl.

Field Detail
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.



ID
String ID(Code)
The content handler ID; may be null



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.



previous
InvocationImpl previous(Code)
The previous invocation, if any.



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.



status
int status(Code)
The status of the request; one of Invocation.ACTIVE , Invocation.WAITING , Invocation.ERROR , Invocation.OK , or Invocation.CANCELLED .



suiteId
int suiteId(Code)
The MIDlet suite that should handle this Invocation.



tid
int tid(Code)
Transaction Identifier.



type
String type(Code)
The content type; may be null.



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.




Constructor Detail
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




Method Detail
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



getAction
public String getAction()(Code)
Gets the action to be performed on the content. the content action or null if it has not been set
See Also:   InvocationImpl.setAction



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



getID
public String getID()(Code)
Gets the content handler ID for this Invocation.
See Also:   Registry.forID the ID of the ContentHandler; may benull
See Also:   InvocationImpl.setID



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 ACTIVEor 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 ACTIVEor HOLD; null otherwise
exception:
  IllegalStateException - if the current status is notACTIVE or HOLD
See Also:   ContentHandler.getID



getPrevious
public InvocationImpl getPrevious()(Code)
Returns the previous Invocation linked to this Invocation by this application's previous call to Registry.invoke(Invocation invocInvocation previous) . the previous Invocation, if any, set when thisInvocation was invoked;null is returned if the Invocation was notinvoked with a previous Invocation.



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 responseRequiredmode. 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



getType
public String getType()(Code)
Gets the content type for the Invocation. the content type or null if it has not been set
See Also:   InvocationImpl.setType
See Also:   InvocationImpl.findType



getURL
public String getURL()(Code)
Gets the URL for the invocation. The URL must be equal to the value set with InvocationImpl.setURL setURL . the URL or null if it has not been set
See Also:   InvocationImpl.setURL



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 nullreferences

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, or
  • NO_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 nullargument 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



setURL
public void setURL(String url)(Code)
Sets the URL for the invocation.
Parameters:
  url - the URL to be set; may be null
See Also:   InvocationImpl.getURL



toString
public String toString()(Code)
Return a printable form of InvocationImpl. Disabled if not logging a String containing a printable form



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.