Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Guida alla Risoluzione dei Problemi Pagina 152

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 286
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 151
152
BlackBerry Java Development Environment Development Guide
Replace a runtime object. 1. Invoke replace().
RuntimeStore store = RuntimeStore.getRuntimeStore();
String newmsg = "Some new text";
2. Create a try-catch block to manage the ControlledAccessException that replace()
throws if the runtime object with the specified ID does not exist.
try {
Object obj = store.replace( 0x60ac754bc0867248L, newmsg);
} catch(ControlledAccessException e) {
// Handle exception - insufficient permissions.
} not exist.
Retrieve a registered runtime object. 1. Invoke RuntimeStore.get() and provide as a parameter the runtime object ID.
RuntimeStore store = RuntimeStore.getRuntimeStore();
2. Create a try-catch block to manage the ControlledAccessException that get()
throws if the application does not have read access to the specified runtime object.
try {
// get() returns the objectm with the specified ID if it exists; null
// otherwise.
Object obj = store.get(0x60ac754bc0867248L);
} catch(ControlledAccessException e) {
// Handle exception.
}
Retrieve an unregistered runtime object. 1. Invoke RuntimeStore.waitFor() to wait for registration of a runtime object to complete.
If the runtime object with the specified ID does not exist, waitFor() blocks for a maximum of
MAX_WAIT_MILLIS.
RuntimeStore store = RuntimeStore.getRuntimeStore();
2. Create code for handling exceptions.
try {
Object obj = store.waitFor(0x60ac754bc0867248L);
} catch(ControlledAccessException e) {
// Handle exception - insufficient permissions.
} catch(RuntimeException e) {
// Handle exception - time out.
}
Task Steps
Vedere la pagina 151
1 2 ... 147 148 149 150 151 152 153 154 155 156 157 ... 285 286

Commenti su questo manuale

Nessun commento