BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-19-2010, 02:21 PM   #1 (permalink)
New Member
 
Join Date: Nov 2009
Model: 8330
PIN: N/A
Carrier: Verizon
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default UncaughtExceptionHandler

Please Login to Remove!

Hello,

I was looking at implementing an UncaughtExceptionHandler, possible with all other versions of java with the code below, however after looking at RIM's stripped down version of the Thread class, the api doesn't appear to exist.

I was wondering if anyone has done it, or is aware of the fact whether it's possible or not.

The code would be analogous to what's below:

Code:
    private void setUncaughtExceptionHandler() {
        MyExceptionHandler meh = new MyExceptionHandler(Thread.currentThread().getUncaughtExceptionHandler());
        Thread.currentThread().setUncaughtExceptionHandler(meh);
    }


    private class MyExceptionHandler implements Thread.UncaughtExceptionHandler {

        private UncaughtExceptionHandler defaultHandler;
        
        public MyExceptionHandler(UncaughtExceptionHandler uncaughtExceptionHandler) {
            defaultHandler = uncaughtExceptionHandler;
        }

        public void uncaughtException(Thread thread, Throwable ex) {
            //log exception info here
            defaultHandler.uncaughtException(thread, ex);
        }
        
        public void unset() {
            Thread.currentThread().setUncaughtExceptionHandler(defaultHandler);
        }
        
    }
Thank you!
Offline  
Old 02-19-2010, 06:53 PM   #2 (permalink)
BlackBerry Mensa
 
tsac's Avatar
 
Join Date: Mar 2005
Location: Others run out when we run in
Model: Z10
OS: 10.010219
PIN: No Pin just a Tack
Carrier: at&t
Posts: 9,125
Post Thanks: 58
Thanked 710 Times in 688 Posts
Default

Search in the developers area or the Admin section
__________________
If someone helps, tell them by clicking the Thanks button


9810 on BES
Z10 on BIS
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Agilent VXI-C System E1421B Mainframe with E1406A Command Module & E1411B DMM
$280.0
Agilent VXI-C System E1421B Mainframe with E1406A Command Module & E1411B DMM pictureQTY.26 TELCO BOARDS IN 24FC19 14 MAINFRAME 2445-20 2430-02 2443-20 2412
$199.99
QTY.26 TELCO BOARDS IN 24FC19 14 MAINFRAME 2445-20 2430-02 2443-20 2412 pictureQTY.26 TELCO BOARDS IN 24FC19 I4 MAINFRAME 2445-20 2430-02 2443-20 2412 #4
$199.99
QTY.26 TELCO BOARDS IN 24FC19 I4 MAINFRAME 2445-20 2430-02 2443-20 2412 #4 pictureLINK SYSTEMS MDI BD SPECTRA 3 AQND 4 ADC DISC BD GP BOA 7 SLOT MAINFRAME
$179.99
LINK SYSTEMS MDI BD SPECTRA 3 AQND 4 ADC DISC BD GP BOA 7 SLOT MAINFRAME  pictureQTY.26 TELCO BOARDS IN 24FC19 I4 MAINFRAME 2445-20 2430-02 2443-20 2412
$199.99
QTY.26 TELCO BOARDS IN 24FC19 I4 MAINFRAME 2445-20 2430-02 2443-20 2412 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.