Java Doc for ProactiveHandler.java in  » 6.0-JDK-Modules » j2me » sim » toolkit » 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 » sim.toolkit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sim.toolkit.ViewHandler
      sim.toolkit.EditHandler
         sim.toolkit.ProactiveHandler

ProactiveHandler
final public class ProactiveHandler extends EditHandler (Code)
This class is the basic class for the definition of Proactive commands . Low level methods, as init(), appendTLV()... will be used to handle generic Proactive commands (standard or future definitions...). The ProactiveHandler class is a Temporary JCRE Entry Point Object. The Toolkit applets, which need to send Proactive commands, shall call the getTheHandler() static method to get the reference of this system instance.

Example of use:


 // constants definition
 private static final byte MY_COMMAND = (byte)0x33;
 private static final byte MY_TAG     = (byte)0x45;
 ProactiveHandler proHdlr;            // get the system instance
 proHdlr = ProactiveHandler.getTheHandler();
 // build and send a new Proactive 
 // command
 proHdlr.init(MY_COMMAND, (byte)0, DEV_ID_ME);
 proHdlr.appendTLV((byte)(MY_TAG | TAG_SET_CR),
 (byte)0);
 short len = proHdlr.getLength();     // length should be 14 !
 byte result = proHdlr.send();
 private byte[] text = new byte[12];  // byte array definition
 text[0] = (byte)'S';                 // text, in 8-bit format, is "SAT"
 text[1] = (byte)'A';
 text[2] = (byte)'T';
 // build and send a DisplayText command
 result = proHdlr.initDisplayText((byte)0x80, DCS_8_BIT_DATA, 
 text, (short)0, (short)3);
 result = proHdlr.send();
 

version:
   8.3.0
See Also:   ViewHandler
See Also:   EditHandler
See Also:   ProactiveResponseHandler
See Also:   ToolkitException




Method Summary
public static  ProactiveHandlergetTheHandler()
     Returns the single system instance of the ProactiveHandler class.
public  voidinit(byte type, byte qualifier, byte dstDevice)
     Initializes the next Proactive command with Command Details and Device Identities TLV. The source device is always the SIM card.
public  voidinitDisplayText(byte qualifier, byte dcs, byte[] buffer, short offset, short length)
     Builds a Display Text Proactive command without sending the command.
public  voidinitGetInkey(byte qualifier, byte dcs, byte[] buffer, short offset, short length)
     Builds a Get Inkey Proactive command without sending the command.
public  voidinitGetInput(byte qualifier, byte dcs, byte[] buffer, short offset, short length, short minRespLength, short maxRespLength)
     Initialize the building of a Get Input Proactive command.
public  bytesend()
     Sends the current Proactive command.



Method Detail
getTheHandler
public static ProactiveHandler getTheHandler() throws ToolkitException(Code)
Returns the single system instance of the ProactiveHandler class. The applet shall get the reference of the handler at its triggering, the beginning of the processToolkit method. reference of the system instance
exception:
  ToolkitException - with the following reason codes:
  • HANDLER_NOT_AVAILABLE if the handler is busy.



init
public void init(byte type, byte qualifier, byte dstDevice)(Code)
Initializes the next Proactive command with Command Details and Device Identities TLV. The source device is always the SIM card. The command number is generated by the method. The Comprehension Required flags are set. After the method invocation no TLV is selected.
Parameters:
  type - the command type
Parameters:
  qualifier - the command qualifier
Parameters:
  dstDevice - the destination device



initDisplayText
public void initDisplayText(byte qualifier, byte dcs, byte[] buffer, short offset, short length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)
Builds a Display Text Proactive command without sending the command. The Comprehension Required flags are all set to 1. After the method invocation no TLV is selected.

Notes:

  • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown and no proactive command is build.
  • If offset+length is greater than buffer.length, the length of the buffer array an ArrayIndexOutOfBoundsException exception is thrown and no proactive command is build.

Parameters:
  qualifier - Display Text command qualifier
Parameters:
  dcs - data coding scheme
Parameters:
  buffer - reference to the text string source buffer
Parameters:
  offset - offset of the text string in the source buffer
Parameters:
  length - length of the text string in the source buffer
exception:
  NullPointerException - if buffer is null
exception:
  ArrayIndexOutOfBoundsException - if initDisplayText would cause access of data outside array bounds
exception:
  ToolkitException - with the following reason codes:
  • HANDLER_OVERFLOW if the ProactiveHandler buffer is to small to put the requested data



initGetInkey
public void initGetInkey(byte qualifier, byte dcs, byte[] buffer, short offset, short length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)
Builds a Get Inkey Proactive command without sending the command. The Comprehension Required flags are all set to 1. After the method invocation no TLV is selected.

Notes:

  • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown and no proactive command is build.
  • If offset+length is greater than buffer.length, the length of the buffer array an ArrayIndexOutOfBoundsException exception is thrown and no proactive command is build.

Parameters:
  qualifier - Get Inkey command qualifier
Parameters:
  dcs - data coding scheme
Parameters:
  buffer - reference to the displayed text string source buffer
Parameters:
  offset - offset of the displayed text string in the source buffer
Parameters:
  length - length of the displayed text string in the source buffer
exception:
  NullPointerException - if buffer is null
exception:
  ArrayIndexOutOfBoundsException - if initGetInkey would cause access of data outside array bounds.
exception:
  ToolkitException - with the following reason codes:
  • HANDLER_OVERFLOW if the ProactiveHandler bufferis to small to put the requested data



initGetInput
public void initGetInput(byte qualifier, byte dcs, byte[] buffer, short offset, short length, short minRespLength, short maxRespLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)
Initialize the building of a Get Input Proactive command. The Comprehension Required flags are all set to 1. The following command parameters (i.e. TLVs) may be appended to the command before sending it: Default Text. After the method invocation no TLV is selected.

Notes:

  • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown and no proactive command is build.
  • If offset+lengthis greater than buffer.length, the length of the buffer array an ArrayIndexOutOfBoundsException exception is thrown and no proactive command is build.

Parameters:
  qualifier - Get Input command qualifier
Parameters:
  dcs - data coding scheme
Parameters:
  buffer - reference to the displayed text string source buffer
Parameters:
  offset - offset of the displayed text string in the source buffer
Parameters:
  length - length of the displayed text string in the source buffer
Parameters:
  minRespLength - minimal length of the response text string
Parameters:
  maxRespLength - maximal length of the response text string
exception:
  NullPointerException - if buffer is null
exception:
  ArrayIndexOutOfBoundsException - if initGetInput would cause access of data outside array bounds.
exception:
  ToolkitException - with the following reason codes:
  • HANDLER_OVERFLOW if the ProactiveHandler bufferis to small to put the requested data



send
public byte send() throws ToolkitException(Code)
Sends the current Proactive command. general result of the command (first byte of Result TLV in Terminal Response)
exception:
  ToolkitException - with the following reason codes:
  • UNAVAILABLE_ELEMENT if the Result Simple TLV is missing.
  • OUT_OF_TLV_BOUNDARIES if the general result byte is missing in the Result Simple TLV.



Methods inherited from sim.toolkit.EditHandler
public void appendArray(byte[] buffer, short offset, short length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public void appendTLV(byte tag, byte[] value, short valueOffset, short valueLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public void appendTLV(byte tag, byte value) throws ToolkitException(Code)(Java Doc)
public void appendTLV(byte tag, byte value1, byte value2) throws ToolkitException(Code)(Java Doc)
public void appendTLV(byte tag, byte value1, byte[] value2, short value2Offset, short value2Length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public void clear() throws ToolkitException(Code)(Java Doc)

Fields inherited from sim.toolkit.ViewHandler
final protected static byte BER_TLV_TAG_OFFSET(Code)(Java Doc)
final protected static byte OFFSET_LC(Code)(Java Doc)
public static AccessSAT SATAccessor(Code)(Java Doc)
final protected static byte TPUD_OFFSET(Code)(Java Doc)
public static ToolkitInterface currentTI(Code)(Java Doc)
short currentTLVOffset(Code)(Java Doc)
short firstTLVOffset(Code)(Java Doc)

Methods inherited from sim.toolkit.ViewHandler
public byte compareValue(short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public short copy(byte[] dstBuffer, short dstOffset, short dstLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public short copyValue(short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public byte findAndCompareValue(byte tag, byte[] compareBuffer, short compareOffset) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public byte findAndCompareValue(byte tag, byte occurrence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public short findAndCopyValue(byte tag, byte[] dstBuffer, short dstOffset) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public short findAndCopyValue(byte tag, byte occurrence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc)
public byte findTLV(byte tag, byte occurrence) throws ToolkitException(Code)(Java Doc)
public static byte[] getAPDUBuffer(byte[] buffer)(Code)(Java Doc)
public static byte[] getAPDUBuffer()(Code)(Java Doc)
protected short getLastTLVOffset(byte[] buffer, short Lc)(Code)(Java Doc)
public short getLength() throws ToolkitException(Code)(Java Doc)
protected short getTLVOffset(byte[] buffer, byte tag, short Lc, short occurrence)(Code)(Java Doc)
public byte getValueByte(short valueOffset) throws ToolkitException(Code)(Java Doc)
public short getValueLength() throws ToolkitException(Code)(Java Doc)
public static void setAPDUBuffer(byte[] buffer, short length)(Code)(Java Doc)
public static void setAPDUBuffer(short length)(Code)(Java Doc)
public static void setOutBufferData(short length)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.