Java Doc for ToolkitRegistry.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.ToolkitRegistry

ToolkitRegistry
final public class ToolkitRegistry (Code)
The ToolkitRegistry class offers basic services and methods to allow any Toolkit applet to register its configuration (supported events) during the install phase and possibly to change it during all the applet life time. Each toolkit applet will get a reference to its registry entry with the static method getEntry. The initial state of all the events is cleared.

Note: the constants related to the events are defined in the ToolkitConstants interface.

Example of use:


 public class MyToolkitApplet extends Applet implements 
 ToolkitInterface, ToolkitConstants {
 // data fields
 private ToolkitRegistry reg;
 private byte[] menuEntry = { ... };
 private byte menuId;
 //
 // Constructor of applet
 //
 public MyToolkitApplet() {
 // get the reference of the applet ToolkitRegistry object ...
 reg = ToolkitRegistry.getEntry();
 // ...and initialize it according to the applet characteristics
 menuId = reg.initMenuEntry(menuEntry, (short)0, 
 (short)menuEntry.length,
 PRO_CMD_SET_UP_CALL, false, 0, 0);
 reg.disableMenuEntry(menuId);
 reg.setEvent(EVENT_FORMATTED_SMS_PP_ENV);
 reg.setEvent(EVENT_CALL_CONTROL_BY_SIM);
 }
 //
 // Install method
 // *param bArray the array containing installation parameters
 // *param bOffset the starting offset in bArray
 // *param bLength the length in bytes of the parameter data in bArray
 //
 public static void install(byte bArray[], short bOffset, byte bLength) 
 throws ISOException {
 // create and register applet
 MyToolkitApplet applet = new MyToolkitApplet();
 applet.register();
 }
 //
 // Process toolkit events
 // *param event the type of event to be processed
 // *exception ToolkitException
 //
 public void processToolkit(byte event) throws ToolkitException {
 if (event == EVENT_FORMATTED_SMS_PP_ENV) {
 reg.enableMenuEntry(menuId);
 } else if (event == EVENT_MENU_SELECTION) {
 //...
 }
 }
 }
 

version:
   8.3.0
See Also:   ToolkitInterface
See Also:   ToolkitException
See Also:   ToolkitConstants




Method Summary
public  byteallocateTimer()
     Asks the Toolkit framework to allocate a Timer that the applet can manage.
public  voidchangeMenuEntry(byte id, byte[] menuEntry, short offset, short length, byte nextAction, boolean helpSupported, byte iconQualifier, short iconIdentifier)
     Changes the value of a menu entry.
public  voidclearEvent(byte event)
     Clears an event in the Toolkit Registry entry of the applet.
public  voiddisableMenuEntry(byte id)
     Disables a menu entry. This method doesn't modify the registration state to the EVENT_MENU_SELECTION and EVENT_MENU_SELECTION_HELP_REQUEST.
public  voidenableMenuEntry(byte id)
     Enables a menu entry. This method doesn't modify the registration state to the EVENT_MENU_SELECTION and EVENT_MENU_SELECTION_HELP_REQUEST.
public static  ToolkitRegistrygetEntry()
     This method is used by the Toolkit applet to get a reference to its Toolkit Registry entry, so that it can handle its registration state to the toolkit events.
public  shortgetPollInterval()
     Returns the number of seconds of the adjusted duration for the calling toolkit applet.
public  byteinitMenuEntry(byte[] menuEntry, short offset, short length, byte nextAction, boolean helpSupported, byte iconQualifier, short iconIdentifier)
     Initialises the next menu entry allocated at loading.
public  booleanisEventSet(byte event)
     Allows to know if an event is set in the Toolkit Registry entry of the applet.
public  voidreleaseTimer(byte timerIdentifier)
     Release a Timer that has been allocated to the calling applet.
public  voidrequestPollInterval(short duration)
     Requests a duration for the EVENT_STATUS_COMMAND event of the registering toolkit applet.
public  voidsetEvent(byte event)
     Sets an event in the Toolkit Registry entry of the applet. No exception shall be thrown if the applet registers more than once to the same event.
public  voidsetEventList(byte[] eventList, short offset, short length)
     Sets an event list in the Toolkit Registry entry of the applet. In case of any exception the state of the registry is undefined.



Method Detail
allocateTimer
public byte allocateTimer() throws ToolkitException(Code)
Asks the Toolkit framework to allocate a Timer that the applet can manage. By calling this method the applet is registered to the EVENT_TIMER_EXPIRATION of the allocated timer. The timer is allocated by the applet until it explicitly releases it. So it can then issue the Timer Management proactive command to start, stop or get the value of its allocated timer. the identifier of the Timer allocated to the applet
exception:
  ToolkitException - with the following reason codes:
  • NO_TIMER_AVAILABLE if all the timers are allocated or the maximum number of timers have been allocated to this applet



changeMenuEntry
public void changeMenuEntry(byte id, byte[] menuEntry, short offset, short length, byte nextAction, boolean helpSupported, byte iconQualifier, short iconIdentifier) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)
Changes the value of a menu entry. The default state of the changed menu entry is 'enabled'. The value of the helpSupported boolean parameter defines the registration status of the EVENT_MENU_SELECTION_HELP_REQUEST event. The icon identifier provided will be added to the icon identifier list of the item icon identifier list Simple TLV if all the applets registered to the EVENT_MENU_SELECTION provide it. The Icon list qualifier transmitted to the ME will be 'icon is not self explanatory' if one of the applet registered prefers this qualifier. After the invocation of this method, during the current card session, the SIM Toolkit Framework shall dynamically update the menu stored in the ME.

Notes:

  • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown and no menu entry is changed.
  • If offset+length is greater than menuEntry.length, the length of the menuEntry array an ArrayIndexOutOfBoundsException exception is thrown and no menu entry is changed.

Parameters:
  id - the menu entry identifier supplied by the initMenuEntry() method
Parameters:
  menuEntry - a reference on a byte array, containing the menu entry string
Parameters:
  offset - the position of the menu entry string in the buffer
Parameters:
  length - the length of the menu entry string
Parameters:
  nextAction - a byte coding the next action indicator for the menu entry (or 0)
Parameters:
  helpSupported - equals true if help is available for the menu entry
Parameters:
  iconQualifier - the preferred value for the icon list qualifier
Parameters:
  iconIdentifier - the icon identifier for the menu entry (0 means no icon)
exception:
  NullPointerException - if menuEntry is null
exception:
  ArrayIndexOutOfBoundsException - if changeMenuEntry would cause access of data outside array bounds.
exception:
  ToolkitException - with the following reason codes:
  • MENU_ENTRY_NOT_FOUND if the menu entry does not exist for this applet
  • ALLOWED_LENGTH_EXCEEDED if the menu entry string is bigger than the alloacted space



clearEvent
public void clearEvent(byte event) throws ToolkitException(Code)
Clears an event in the Toolkit Registry entry of the applet.
Parameters:
  event - the value of the event to unregister (between -128 and 127)
exception:
  ToolkitException - with the following reason codes:
  • EVENT_NOT_ALLOWED if event is EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND



disableMenuEntry
public void disableMenuEntry(byte id) throws ToolkitException(Code)
Disables a menu entry. This method doesn't modify the registration state to the EVENT_MENU_SELECTION and EVENT_MENU_SELECTION_HELP_REQUEST. After invocation of this method, during the current card session, the SIM Toolkit Framework shall dynamically update the menu stored in the ME.
Parameters:
  id - the menu entry identifier supplied by the initMenuEntry() method
exception:
  ToolkitException - with the following reason codes:
  • MENU_ENTRY_NOT_FOUND if the menu entry does not exist for this applet



enableMenuEntry
public void enableMenuEntry(byte id) throws ToolkitException(Code)
Enables a menu entry. This method doesn't modify the registration state to the EVENT_MENU_SELECTION and EVENT_MENU_SELECTION_HELP_REQUEST. After invocation of this method, during the current card session, the SIM Toolkit Framework shall dynamically update the menu stored in the ME.
Parameters:
  id - the menu entry identifier supplied by the initMenuEntry() method
exception:
  ToolkitException - with the following reason codes:
  • MENU_ENTRY_NOT_FOUND if the menu entry does not exist for this applet



getEntry
public static ToolkitRegistry getEntry() throws ToolkitException(Code)
This method is used by the Toolkit applet to get a reference to its Toolkit Registry entry, so that it can handle its registration state to the toolkit events. reference to the applet ToolkitRegistry object
exception:
  ToolkitException - with the following reason codes:
  • REGISTRY_ERROR in case of register error



getPollInterval
public short getPollInterval()(Code)
Returns the number of seconds of the adjusted duration for the calling toolkit applet. If the returned duration is equal to POLL_NO_DURATION, the toolkit applet is not registered to EVENT_STATUS_COMMAND event. The returned duration may : - be a multiple of the real adjusted poll interval time at the ME. - differ from the requested duration due to request of other toolkit applets or due to restrictions of the current ME. - be changed during the card session due requests from other toolkit applets. - be wrong due to direct generation of the proactive command POLL INTERVAL or POLLING OFF. - not correspond to the ellasped time due to additional STATUS commands send by the ME. the number of seconds of the adjusted duration for the applet



initMenuEntry
public byte initMenuEntry(byte[] menuEntry, short offset, short length, byte nextAction, boolean helpSupported, byte iconQualifier, short iconIdentifier) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)
Initialises the next menu entry allocated at loading. The default state of the menu entry is 'enabled'. The value of the helpSupported boolean parameter defines the registration status of the applet to the event EVENT_MENU_SELECTION_HELP_REQUEST. The applet is registered to the EVENT_MENU_SELECTION. The icon identifier provided will be added to the icon identifier list of the item icon identifier list Simple TLV if all the applets registered to the EVENT_MENU_SELECTION provide it. The Icon list qualifier transmitted to the ME will be 'icon is not self explanatory' if one of the applet registered prefers this qualifier. This method shall be called by the applet in the same order than the order of the item parameters defined at the applet loading if the applet has several menu entries. The applet shall initialise all its loaded menu entries during its installation.

Notes:

  • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown and no menu entry is initialised.
  • If offset+length is greater than menuEntry.length, the length of the menuEntry array a ArrayIndexOutOfBoundsException exception is thrown and no menu entry is initialised.

Parameters:
  menuEntry - a reference on a byte array, containing the menu entry string
Parameters:
  offset - offset of the menu entry string in the buffer
Parameters:
  length - length of the menu entry string
Parameters:
  nextAction - a byte coding the next action indicator for the menu entry (or 0)
Parameters:
  helpSupported - equals true if help is available for the menu entry
Parameters:
  iconQualifier - the preferred value for the icon list qualifier
Parameters:
  iconIdentifier - the icon identifier for the menu entry (0 means no icon) the identifier attached to the initialised menu entry
exception:
  NullPointerException - if menuEntry is null
exception:
  ArrayIndexOutOfBoundsException - if initMenuEntry would cause access of data outside array bounds.
exception:
  ToolkitException - with the following reason codes:
  • REGISTRY_ERROR if the menu entry cannot be initialised (eg no more item data in applet loading parameter)
  • ALLOWED_LENGTH_EXCEEDED if the menu entry string is bigger than the alloacted space



isEventSet
public boolean isEventSet(byte event)(Code)
Allows to know if an event is set in the Toolkit Registry entry of the applet.
Parameters:
  event - the value of the event (between -128 and 127) true if the event is set in the Toolkit Registry entry of the applet, false otherwise



releaseTimer
public void releaseTimer(byte timerIdentifier) throws ToolkitException(Code)
Release a Timer that has been allocated to the calling applet. The applet is deregistered of the EVENT_TIMER_EXPIRATION for the indicated Timer Identifier.
Parameters:
  timerIdentifier - the identifier of the Timer to be released
exception:
  ToolkitException - with the following reason codes:
  • INVALID_TIMER_ID if the timerIdentifierd is not allocated to this applet.



requestPollInterval
public void requestPollInterval(short duration) throws ToolkitException(Code)
Requests a duration for the EVENT_STATUS_COMMAND event of the registering toolkit applet. Due to different duration requested by other toolkit applets or due to restriction of the ME, the SIM Toolkit Framework may adjust another duration. This method can be used at every time to request a new duration.
Parameters:
  duration - specifies the number of seconds requested for proactive polling.The maximum value of duration is 15300 (255 minutes).If duration is equal to POLL_NO_DURATION, the calling applet deregisters from EVENT_STATUS_COMMAND, and the SIM Toolkit Framework may issue the POLLING OFF proactive command.If duration is equal to POLL_SYSTEM_DURATION, the calling applet registers to the EVENT_STATUS_COMMAND and letthe SIM Toolkit Framework define the duration.
exception:
  ToolkitException - with the following reason codes:
  • REGISTRY_ERROR if duration is greater than the maximum value.



setEvent
public void setEvent(byte event) throws ToolkitException(Code)
Sets an event in the Toolkit Registry entry of the applet. No exception shall be thrown if the applet registers more than once to the same event.
Parameters:
  event - value of the new event to register (between -128 and 127)
exception:
  ToolkitException - with the following reason codes:
  • EVENT_NOT_SUPPORTED if the event is not supported
  • EVENT_ALREADY_REGISTERED if the event has already been registered (for limited event like Call Control)
  • EVENT_NOT_ALLOWED if event is EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND



setEventList
public void setEventList(byte[] eventList, short offset, short length) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)
Sets an event list in the Toolkit Registry entry of the applet. In case of any exception the state of the registry is undefined. The toolkit applet has to include this call within a transaction if necessary.

Notes:

  • If offset or length parameter is negative an ArrayIndexOutOfBoundsException exception is thrown and no event list is set.
  • If offset+length is greater than eventList.length, the length of the eventList array an ArrayIndexOutOfBoundsException exception is thrown and no event list is set.

Parameters:
  eventList - buffer containing the list of the new events to register
Parameters:
  offset - offset in the eventlist buffer for event registration
Parameters:
  length - length in the eventlist buffer for event registration
exception:
  NullPointerException - if eventlist is null
exception:
  ArrayIndexOutOfBoundsException - if setEventList would cause access of data outside array bounds.
exception:
  ToolkitException - with the following reason codes:
  • EVENT_NOT_SUPPORTED if one event is not supported
  • EVENT_ALREADY_REGISTERED if one event has already been registered(for limited event like Call Control)
  • EVENT_NOT_ALLOWED if eventList contains EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND



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.