Getting SAXParser to stop what it's doing

I have a simple question: I'm creating a thread that uses a SAXParser to parse through a very large file. The full parse takes about ten hours. I'm doing this from within a Swing application. When the user hits the "cancel" button, I would like to be able to stop SAXParser from doing its parsing. I can't find anything in the API that looks like it would let me send a message to the parser telling it to quit.
There must be a way to do this. SAXParser is what you use when you're parsing a file which is too big to fit in memory, so it will often be used in processing very large files.
Any suggestions?
Thanks

i'd try
class MyContentHandler extends DefaultHandler
        Object lock;
        boolean stop = false;
        public void stopMe()
               synchronized(lock)
                     stop = true;
        public void startElement(String ns, String ln, String qn, Attributes a)
                synchronized(lock)
                         if (stop)
                                  throw new SAXParserException("User Interrupted");
                ..... //whatever you did before
      // other contenthandler methods as before
}

Similar Messages

  • I keep getting this message: Mail can't connect to the account: "Sbcglobal". Enter the password... So I do and it opens up, but later it will happen again. It's not earth-shattering, but I have to stop what I'm doing to get rid of the bouncing Mail icon.

    I keep getting this message: Mail can't connect to the account: "Sbcglobal". Enter the password... So I do and it opens up, but later it will happen again. It's not earth-shattering, but I keep having to stop what I'm doing to get rid of the annoying bouncing Mail icon.

    If your password is accepted, and Mail connects to the account, but you're prompted for the password repeatedly, take each of the following steps that you haven't already tried. Note: these steps don't apply if the server rejects the password. That's a different problem.
    Step 1
    When prompted for the password, check the box marked Remember this password in my keychain.
    Step 2
    Check that the keychain is working.
    Step 3
    Check that the default keychain is unlocked.

  • My iPhone 3GS on iOS 5.1 will randomly stop what I'm doing show a black screen then the spinning icon and then it shows my lockscreen. It takes about a minute to do this and it does it about 30 times a day. How do I fix this?

    My iPhone 3GS on iOS 5.1 will randomly stop what I'm doing show a black screen then the spinning icon and then it shows my lockscreen. It takes about a minute to do this and it does it about 30 times a day. How do I fix this? It is EXTREMELY ANNOYING!

    No, sounds like when you dropped it an cracked the screen it may have also damaged the logic board or the repair person damaged a cable.

  • I have a late 2008 MacBook I would like to watch movies on my tv from.  I bought the HDMI cables and the one to use for audio also but I still don't get any sound.  What am I doing wrong?

    I have a late 2008 MacBook I cant get to send sound to my TV when I try to watch movies.  I have bought the HDMI cable and audio connectors but still no sound.  What am I doing wrong?

    Hi Maryan,
    Open System Preferences > Displays > select the window for you external monitor > click on the Arrangement tab and check the box next to Mirror Displays. It may be slightly different in Lion, but the idea is the same.

  • Can,t open word,PDF or excel attachments that get sent to me what am I doing wrong?

    Can't open attachments like Word,excel or PDF files I get sent what am I doing wrong?

    What have you tried?  Ifmyou just tought the attachment, it will open in sort of a quick view mode.  For all of the file types you mentioned.  If you touch and hold, a small window will open and suggest other apps, if you have any loaded, that will also work with those file types.
    So what happens when you tap an attachment?

  • [SOLVED] Can't get GDM to run - what am I doing wrong?

    Alright, I'm running a fresh, up to date install of Arch in a virtual machine, and I'm consistently unable to get GDM to work properly. I pretty much followed the beginners' guide, and tried reinstalling from scratch several times. I've installed gdm, gnome, gnome-extra, dbus, and anything else the wiki recommends, like virtualbox-archlinux-additions. I edited /etc/inittab and /etc/rc.conf accordingly.
    Relevant lines in /etc/inittab:
    #Boot to X11
    id:5:initdefault:
    x:5:respawn:/usr/sbin/gdm -nodaemon
    Relevant lines in /etc/rc.conf:
    MODULES=(vboxguest vboxsf vboxvideo)
    DAEMONS=(syslog-ng dbus network crond)
    When I start the virtual machine, it displays the CLI login interface along with a bunch of warnings:
    Arch Linux 3.4.4-2-ARCH (tty1)
    vbox login: gdm-binary[388]: WARNING: GdmDisplay: display lasted 0.271335 seconds
    gdm-binary[388]: WARNING: GdmDisplay: display lasted 0.011053 seconds
    gdm-binary[388]: WARNING: GdmDisplay: display lasted 0.011250 seconds
    gdm-binary[388]: WARNING: GdmDisplay: display lasted 0.010699 seconds
    gdm-binary[388]: WARNING: GdmDisplay: display lasted 0.010361 seconds
    gdm-binary[388]: WARNING: GdmDisplay: display lasted 0.010921 seconds
    gdm-binary[388]: WARNING: GdmDisplay: GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors
    After that, I can still log in just fine, though I obviously never get into any desktop environment because of it. I have no idea where to find the X server log. I skimmed through /var/log, but couldn't find any log file with remotely helpful contents besides 'gdm'. The contents of the 'gdm' file:
    ** (gdm-binary:519): WARNING **: Failed to acquire org.gnome.DisplayManager
    ** (gdm-binary:519): WARNING **: Could not acquire name; bailing out
    I've been bashing my head against this problem for several days now, but been unable to actually fix it. Anyone feel like pointing out what I'm doing wrong or how to proceed?
    Last edited by Caelum (2012-07-11 19:44:04)

    Aaaand figured it out thanks to that one. I skipped starting it manually in this VM; got it to work when started manually on a previous install, and hence assumed it'd be fine.
    Turns out, I was doing the installations of the base packages - # pacman -S xorg-server xorg-xinit xorg-server-utils - wrong somehow. I think I must've missed that step or something; installing xorg-server and xorg-server-utils through Pacman just now solved my problem.
    Thanks for the help. Much appreciated.
    EDIT: Wonder, you ninja you.
    Last edited by Caelum (2012-07-11 19:45:28)

  • When trying to connect my ipod to my 2011 nissan al I get is reading files.What am I doing wrong

    When connecting my ipod to my 2011 nissan radio system all that shows up on the radio is reading files. What am I doing wrong and how do I correct the problem?

    You can try the standard fixes:
    - Reset. Nothing will be lost
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory defaults/new iPOd.
    However, some accessorie,s like car systems, stopped working after iOS 5.  Have you contacted the manufacturer of the car sytem?

  • I have downloaded Adobe Content Viewer to my iPad. When I try to sign in with my Adobe ID, I keep getting Authentication Failed. What am I doing wrong?

    I have downloaded and istalled Adobe Content Viewer to my iPad. When I try to sign in with my Adobe ID, I keep getting Authentication Failure, what am I doing wrong?

    Thanks for the quick reply.
    Do you have any examples of system extensions or accessibility features that might be the culprit?  I have actually never heard of those terms before.

  • I download firefox4 onto my Toshiba R500 Portage notbook running ubuntu 10.10 but i cannot seem to get it to install what am i doing wrong?

    I try to download firefox4 to my Toshiba R500 portage running ubuntu10.10 but it does not seem to install. I have downloaded it to my pc running windows 7 with a few glitches sorted out works great what am I doing wrong? or what is happening

    Sorry, Mac OSX 10.1.3 is too old (from 2002) for any version of Firefox made in the last 5 or 6 years.
    Are you sure that isn't 10.3.1? If so, Firefox 2.0.0.20 is the last version of Firefox that will work.

  • Have tried to purchase an album today but cannot get it to download. what am I doing wrong

    Have tried to purchase an Ed Sheeran Cd today and thought My payment had gone through but cannot download the album to my Desktop.  What am I doing wrong (in simple terms)
    Lorraine

    Does it show on your account's purchase history : See your purchase history in the iTunes Store ? If not then you are sure that the purchase went through, it's not just a temporary store holding charge on your credit card : iTunes Store & Mac App Store: About payment card authorization holds.
    If it does show then try the Store > Check For Available Downloads menu option on your computer's iTunes and see if that downloads it, or go to the Purchased link under Quick Links on the right-hand side of the iTunes store homepage  and see if it shows there for downloading.

  • Just since the last update I can't open attachments. No matter which opener I choose, all I get is gabble. What am I doing wrong?

    I can't open text attachments. Even when I use the 'free document viewer' program all I get is a pattern of letters, not clear text. I've tried every program in the choices list, which doesn't include Adobe or Word, both of which are on my computer.
    I believe this problem started after the last Mozilla update, but I'm not sure. I receive messages in my Mail.com account on a cycle towards the end of the month, and this cropped up since the end of last month.

    You need iTunes version 11 for iOS 7.
    iTunes version 11 requires OS X 10.6.8 or later...
    Click on the Apple icon.. Top left in Finder...
     > About this Mac > Version...what does it say?

  • I have disabled email notifications (alerts) from my iPhone and yet I keep getting them anyways. What am I doing wrong?

    Hello, I went in the notification center and disabled all alerts and sounds from my 2 mailboxes. It worked for my work mail account, but not for my private account. I keep getting incoming email alerts on my screen. I have turned my phone off and back on hoping it would register the change, but it hasn't. Any ideas on what might be wrong or what I forgot to do? Thanks a lot!

    Something doesn't seem right here. If she has to use her email address as her contact address in order to message with you, that suggest to me that she either doesn't meet the requirements to use her iPhone number as the contact address (iOS 6 or later with an iPhone number linked to her Apple ID) or there is an issue with the way the phone number is being entered.

  • HT1222 I must be really silly can't get iTunes to download what am I doing wrong

    Apparently I need itunes to be download, so that I can update my iphone 4 to be able to get imessages free and install ebay iphone app etc, can you help me to do this?
    Thanks

    You download/install iTunes on your computer:
    Windows:
    http://www.apple.com/itunes/download/
    OS X:
    http://support.apple.com/kb/DL1614

  • HELP ME,I keep getting firefox popups and I can't get rid of them, what am I doing wrong?

    They won't go away!!!!!!!!!!!!!

    Have you tried disabling that '''SearchToolbar/1.2''' add-on you have installed?
    Have you read this? <br />
    http://kb.mozillazine.org/Popups_not_blocked

  • I can't get into my iTunes.  What am I doing wrong?

    I can't get into iTunes. What am I doing wrong?

    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 &amp; above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    netsh winsock reset
    Hit "ENTER" key
    Restart your computer.
    If you do get a prompt after restart windows to remap LSP, just click NO.
    Now launch your iTunes and see if it is working now.
    If you are still having these type of problems after trying the winsock reset, refer to this article to identify which software in your system is inserting LSP:
    iTunes 10.5 for Windows: May see performance issues and blank iTunes Store
    http://support.apple.com/kb/TS4123?viewlocale=en_US

Maybe you are looking for

  • Family Sharing Calendar not "sharing" events among family members

    Hi, I'm hoping someone has a similar issue and can shed some light. I've setup a Family with myself as the organizer. We have 2 iMacs, 1 MacBook Pro, 3 iPhones, and 3 iPads used by my three family members. The "Family" calendar now shows up on all de

  • Acrobat 7.0: Standard vs Pro versions comparison chart?

    Can anyone provide a link to the old chart of a side-by-side comparison of features offered by Acrobat b 7.0 Standard vs. Professional? My company has licenses for both; I need to see what features only Pro offers in order to justify my getting upgra

  • Is it Possible to change Maintenance view Structure SALV

    Hi,   In Maintenance View is it possible to change  POP UP field display. In maintenance view we have 'Position'  button ,when clicked on that  the key fields of the Table used in the maintenance view is displayed ,is there any possibilities to resti

  • Receipts for mail messages

    To get receipts for my mail messages, I need to tweak one of the settings in terminal mode. What is the command?

  • How to associate pdf files to aR 2.0 on HTC touch WM 6.x

    Hi all, I used to open pdf files with Adobe reader LE on HTC Touch with WM 6.1. I've installed successfully adobe reader on HTC touch with windows mobile 6.1 but cannot open files using the reader. If I click on pdf file, it won't open. Impossible to