Prevent from being blocked.

Hello everyone,
When invoking a third party function (which I can not modify its behavior), my application will be blocked when something error occurs and the block dues to the thid party function, which will be blocked when something error occurs.
I am wondering how can I make my application not be blocked by the third party function. I want the function call to the third party function return in some fixed time (for example, 5 seconds) or less than that period, whether or not something error occurs. I am just focusing on not be blocked and will never wait for results if its processing time is more than some fixed time (for example, 5 seconds).
Thanks in advance,
George

Here's a small example:public class Test {
    public static void main (String[] parameters) {
        long ctm = System.currentTimeMillis ();
        Invoker invoker = new Invoker ();
        Thread thread = new Thread (invoker);
        thread.start ();
        synchronized (invoker) {
            try {
                invoker.wait (5000);
            } catch (InterruptedException exception) {}
        if (thread.isAlive ()) {
            thread.interrupt ();
        System.out.println ("Test has waited " + (System.currentTimeMillis () - ctm) + " ms");
    private static class Invoker implements Runnable {
        public void run () {
            boolean notify = true;
            try {
                int ms = (int) (Math.random () * 9000) + 1000;
                System.out.println ("Invoker will sleep " + ms + " ms");
                Thread.sleep (ms);
            } catch (InterruptedException exception) {
                // don't notify
                notify = false;
            if (notify) {
                synchronized (this) {
                    notify ();
}I'm not claiming it's the best possible way - it shows the flow that the other posters suggested.
Kind regards,
  Levi

Similar Messages

  • What is the best way to filter an IP from being blocked?

    What is the best way to filter an IP from being blocked by a false positive? Event Action Filter?

    I'll assume you really mean "blocked" as opposed to "denied". You can either create an event action filter and subtract the blocked action, or you can add the address to the "never block" addresses.

  • HT2905 How can I prevent from being billed twice?

    My download was interrupted. When it resumed, it resulted in a double download. How can I prevent from being billed twice?

    If your phone is locked with a passode, photos & videos, in your camera roll, cannot be imported to a computer, unless that computer was previously used with the phone, while the passcode was in effect.

  • Airport how to prevent from being cut off by Netcut

    Im using an aiport router connected to my pc, my brother on the other hand is using a program called NetCut which disconnects me from the internet when he feels that i am lagging him. It makes the status connected but no internet connection, is there a way i can prevent this from happening?
    is there a way to protect myself from this? also how can i disconnect people off my network wireless and ethernet?

    you could place a frame with horizontal elasticity set to shrink around your author's field. make that field fill 90% of the page width and place the date-column beside it.
    If you have small number of authors the field should shrink and take the date fied with it.
    If you have a very large number of authors the list would occupy 90% of the pagewidth, spread over more than one row, the dat field would be places at the right end of the page at the top.
    hope this helps.

  • How do I stop a pop up from being blocked? I am attempting to fill out a job application and a portion of the site is being "blocked by my browser".

    I can't finish a job application because "my browser is blocking a pop up section of the form where they are asking for additional info. The site is using Taleo.

    See: [https://support.mozilla.com/en-US/kb/Options%20window%20-%20Content%20panel?as=u#w_content-settings Content Settings]
    Remove the checkmark from Block Popup windows.

  • Any way to Restore Last Manual Sort Order or Prevent from being Overwritten accidentally?

         Help!
         I'm constantly accidentally overwriting painstakingly created manual sort ordering (sometimes hours but more often months of accumulated work) in folders with files numbering up to 1,000, when i, however breifly, switch to another sort ordering (size, date modified etc) to check something, immediately forget that i'm in another sort order, and, unthinkingly (actually i guess i'm thinking of a lot of other things) drag a file to another position, this immediately destroys any past manual sorting i've established, overwriting it with this new inadvertent manual ordering.
         I've tried CommandZ (edit undo) but that only undoes my last rating or labeling, i've rushed to force quit Bridge through the activity montior hoping i will catch it before its overwritten, but obviously i am not as fast as a computer, and i don't think this has ever worked.
    Is there any way or any script someone has written to formally save a manual sort order? Is there anything i've missed to attempt restoring it? Has anyone, repeatedly foiled by this, written something that would give a warning and require confirmation say for instance, if i tried to drag or move a file while in another sort ordering (this seems like something that should have existed the minute the opportunity was given to create manual organization). Would anyone be willing to?
         Seriously, me forgetting almost every time isn't going to change and, more vexingly, it's even happened when i didn't mean to move anything but fumbled momentarily while in another sort order. I think most people might forget because (in the context of computing) we are conditioned to expect a warning if something we have just created is about to be written over or discarded, and since there is no option to formally save a manual ordering we have just created.
         Also, if this was in the real world, moving a single file would not reshuffle everything on your desk. If i had the option to formally save a manual organization i would NOT forget to do this and would use it, as i've wished for one every time spent a while rearranging files. Knowing how easily all the hours (much less months and years of cumulative work) of organizational work can be accidentally lost makes working within Bridge unpleasantly anxious.
          I'm literally willing to do anything including installing some sketchy 3rd-part scripts (though honestly i have no idea what that means or how to do it). I extentively use and rely heavily upon this function so this is a fairly serious Achille's heel. It's like watching your incredibly important meticulously constructed house of cards collapse with a careless but innocent sigh, or like having the equivelent of a not even charming cat dance across your keyboard during a live concert, etc etc....
         Also it is not usually appropriate, given the context, to batch rename everything to preserve a manual ordering w sequence numbers, etc. Often the filenames are considerably (but necessarily, to connote important differences) long already, and when i have to rearrange things in the future would have to do that each time, etc, etc, making for even more unwieldly filenames that didn't have any substantive information at the beginning. I'm looking for a way to make this function (manual sort ordering), well, more functional, secure and stable, the workarounds i've considered cause too many additonal problems.
         Thank you in advance for any help you may be able to offer, and as this is my first attempt to use the forums as i live on a boat with no regular net access, would appreciate any forum etiquette corrections, and advance apologies for any misspellings, dyslexic and spellcheck does not seem to work in this interface. next time will edit in external wordprocessing program beforehand,
              li'l mc szpf
         PS i'm on a 27" mac w CS4 Design Premium, w up to the minute OS (10.6.8) and Adobe software updates installed recently (i do not often move the monster but this week was housesitting w net access, so she has had all recommended shots and vaccinations....)
         PPS I know most of y'all might be running the newest and the latest of everything, but, i'm fairly certain this is still a problem in recent versions as this has happened to me at school where all the macs are running cs5. Though if it's been addressed somehow in cs6 would update entire suite just to fix this one problem in Bridge. I've tried many searches and found nothing relevant or wouldn't bother the considerable expertise and resources of an official forum, was extremely hesitant to ask (feared getting snapped at for unwittingly broaching forum etiquette) but it is truly the bane of my considerable Bridge existence, so was willing to risk the imaginary censure and opprobrium....
    Message was edited by: PECourtejoie

    That is a good question, to do this requires two functions and a restart of Bridge all done automagically
    Copy and paste the script into ExtendScript Toolkit
    This gets installed with Photoshop and can be found:-
    PC: C:\Program Files\Adobe\Adobe Utilities
    MAC: <hard drive>/Applications/Utilities/Adobe Utilities
    Start Bridge
    PC: Edit - Preferences - Startup Scripts
    Mac: Adobe Bridge menu - Preferences - Startup Scripts
    At the bottom click the "Reveal Button" this will open the folder where the script should be saved.
    Close and restart Bridge.
    Accept the new script.
    To use:
    Tools - Backup Manual Sort
    This will backup the hidden manual sort file .BridgeSort to .BridgeSortSave
    Tools - Restore Manual Sort
    This will copy the .BridgeSortSave back to .BridgeSort and will close and restart Bridge so that the manual sort is restored.
    if( BridgeTalk.appName == "bridge" ) { 
    var backUpManSort = new MenuElement( "command","Backup Manual Sort", "at the end of Tools" , "backupms" );
    var RestoreManSort = new MenuElement( "command","Restore Manual Sort", "at the end of Tools" , "restorems" );
    backUpManSort.onSelect = function () {
    var fileSort = new File(app.document.presentationPath +"/.BridgeSort");
    var fileSave = new File(app.document.presentationPath +"/.BridgeSortSave");
    if(fileSave.exists) fileSave.remove();
    fileSort.copy(fileSave);
    fileSave.hidden=true;
    RestoreManSort.onSelect = function () {
    var fileSort = new File(app.document.presentationPath +"/.BridgeSort");
    var fileSave = new File(app.document.presentationPath +"/.BridgeSortSave");
    if(!fileSave.exists){
    alert("No backup file exists");
    return;
    app.document.sorts = [{ type:"string",name:"document-kind", reverse:false }];
    if(fileSort.exists) fileSort.remove();
    fileSave.copy(fileSort);
    fileSort.hidden=true;
    app.document.chooseMenuItem("mondo/command/new");
    app.documents[0].close();
    app.document.sorts = [{ name:"user",type:"date", reverse:false }];
    Hope this works for you.

  • OX MAVERICK -Can a list of TOP SITES thumbnails visited on Safari be prevented from being displayed when open up Safari

    Since upgrading my Mac's OS X Mountain Lion to 'Maverick', each time I start up Safari it provides thumbnails of sites previously visited under heading: 'TOP SITES'.
    Can this be pevented so just the search engine is displayed upon start up of Safari eg. AOL or GOOGLE?

    I have solved it thanks -
    Click on SAFARI (screen's top left corner)  >  PRIVATE BROWSING

  • Apparently, my company email that I have on my ipad prevents me from manually backing up to icloud. Does this mean that icloud is being blocked entirely from my ipad?

    If my company email on my ipad blocks me from manually backing up to icloud, does this mean that icloud is being blocked from my ipad completely?

    I'm not sure if they can completely block iCloud if you have your own Apple ID. I assume that they just don't want their data backed up to Apple's cloud.
    But the more important point in this whole discussion is would the company be honked off at you for doing something on the iPad that they do not approve of.

  • Is there a way to prevent a PDF file from being forwarded?

    is there a way to prevent a PDF file from being forwarded? For example, im a personal trainer and if i send a client a plan via PDF file, i want to make sure that they cannot send it to anyone else. I read about how you can secure a file by creating an ID and then having the recipient create an ID as well, but i would like to make the orocess as easy as possible for my clients and not have to have them create an ID and then send it to me. is there a better way to block the recipient from resending the PDF?

    Hi Kiana,
    As such there is no option to prevent the recipients from forwarding the pdf. However you can refer to this blog How do I prevent someone from forwarding a PDF?, it might be of some help.
    Regards,
    Aadesh

  • Does anyone know of a VI or how to go about writing one that will prevent the computers time/date from being disabled while an application is running.

    Does anyone know of a VI or how to go about writing one that will prevent the computers clock/time from being disabled while an application is running. The time and date can normally be reset while an application is running by clicking on the time/date in the lower right-hand corner of the computer screen. I have an application that runs over several days and it is critical that the time and date of the computer not be changed. Is there an easy way to lock this out from the user? Note that I am what I consider an advanced beginner in LV.
    Thank you,
    Chuck
    Solved!
    Go to Solution.

    That is not something you can do from LabVIEW, as it is an operating system operation, and it will depend on the operating system that you're using. On Windows you can use a group policy to control this. Please Google on "prevent time and date change in windows".
    Also, please try to refrain from stuffing your entire message in the subject block. Keep the subject short, but descriptive enough so it can be understood what you are basically asking. Thanks.

  • Preventing expired batch from being sold

    Currently in one of our client's setup, I can select expired batch from the list of items. Is there a way to prevent expired items from being selected when creating sales order (VA01) or, if the user can select the expired item, at least display an error or warning message?

    Hi,
    Do try making the batch in resticted use in change batch basic data1 tab,activate radio button of batch status for Batch restr.
    It makes
    Batch in Restricted-Use Stock
    Specifies that the batch is included in restricted-use stock.
    Use
    If, though a batch has the status "restricted", you want to use a goods movement to post a quantity to unrestricted-use stock, the quantity is posted to restricted-use stock and not to unrestricted-use stock.
    If the status of a batch is set to restricted, the total unrestricted-use stock is transferred to restricted-use stock by means of a transfer posting. A material document is created.
    You cannot change the status of a batch (unrestricted/restricted) in a goods movement, only with the following functions:
    by maintaining the batch master record manually
    using the control function provided in the QM system
    Configurations for Restricted-Use Stock
    For planning purposes, restricted-use stock is treated like blocked stock, that is, it is either available or not available, depending on your system configuration.
    Withdrawals from restricted-use stock are either possible or not possible, depending on your system configuration.
    The status of a batch can be considered in batch determination, that is, you can search for unrestricted or for restricted batches.
    _(This has been adopted from SAP documentation.)
    Change batch T.code-*MSC2n*Regards,
    Reddyy

  • Preventing setup/cleanup from being displayed during exec.

    I am trying to prevent the setup/cleanup sections of my sequence from being displayed during execution.  (i.e. I do not want the users to see anything other than the main sequence).  This way they can see the progress being made through the sequence and the cleanup sequence will not block the view of the main sequence(and the values from individual tests).
    If anyone has a clue how to do this please let me know.
    (Note: I still want the startup/cleanup to run, just invisibly)
    Thanks

    This tracing option is set in the Station Options. In Sequence Editor, goto:
    Configure >> Station Options, Tab Execution: Remove the checkmark from "Allow Tracing into Setup/Cleanup".
    Regards, Guenter.

  • [svn:osmf:] 14598: Fix FM-500: reinstating onMetaData handler clause that prevents incoming dimensions from being applied if they are not different from the dimensions that were already set .

    Revision: 14598
    Revision: 14598
    Author:   [email protected]
    Date:     2010-03-05 02:13:40 -0800 (Fri, 05 Mar 2010)
    Log Message:
    Fix FM-500: reinstating onMetaData handler clause that prevents incoming dimensions from being applied if they are not different from the dimensions that were already set.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-500
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/net/NetStreamDisplayObjectTrait.as

    You are welcome. I'm glad you got it back up.
    (1) You say you did the symbolic link. I will assume this is set correctly; it's very important that it is.
    (2) I don't know what you mean by "Been feeding the [email protected] for several weeks now, 700 emails each day at least." After the initial training period, SpamAssassin doesn't learn from mail it has already processed correctly. At this point, you only need to teach SpamAssassin when it is wrong. [email protected] should only be getting spam that is being passed as clean. Likewise, [email protected] should only be getting legitimate mail that is being flagged as junk. You are redirecting mail to both [email protected] and [email protected] ... right? SpamAssassin needs both.
    (3) Next, as I said before, you need to implement those "Frontline spam defense for Mac OS X Server." Once you have that done and issue "postfix reload" you can look at your SMTP log in Server Admin and watch as Postfix blocks one piece of junk mail after another. It's kind of cool.
    (4) Add some SARE rules:
    Visit http://www.rulesemporium.com/rules.htm and download the following rules:
    70sareadult.cf
    70saregenlsubj0.cf
    70sareheader0.cf
    70sarehtml0.cf
    70sareobfu0.cf
    70sareoem.cf
    70sarespoof.cf
    70sarestocks.cf
    70sareunsub.cf
    72sare_redirectpost
    Visit http://www.rulesemporium.com/other-rules.htm and download the following rules:
    backhair.cf
    bogus-virus-warnings.cf
    chickenpox.cf
    weeds.cf
    Copy these rules to /etc/mail/spamassassin/
    Then stop and restart mail services.
    There are other things you can do, and you'll find differing opinions about such things. In general, I think implementing the "Frontline spam defense for Mac OS X Server" and adding the SARE rules will help a lot. Good luck!

  • How can an iTunes Match user prevent songs from being uploaded to the iCloud?

    Has anyone who is currently using iTunes Match found a way to prevent selected songs in their music library from being uploaded to the iCloud. I have a number of audio files that are hour long mixes, but aren't quite large enough to run afoul of the 200MB size limit. I'd like to keep using iTunes Match, but would like to prevent it from trying to upload any of these larger files. Any help would be greatly appreciated. Thank you!

    Another oddity I just discovered is that if I turn on wifi hotspot on my phone and connect my iMac to my phone's 3G service then iTunes on my iMac will stream music just fine from iTunes match (yes, the music was only in the cloud, not on my drive).
    I've tried everything I can think of to get iTunes Match to play tracks over cellular.. including totally deauthorizing all my computers and devices, totally removing all tracks my itunes match in the cloud and re-scanning/uploading everything. Purchased new tracks, and they won't play unless they are downloaded. But they will play just fine when previeing them for purchase in iTunes app.

  • Restoring a SQL Server 2005 DB to a SQL Server 2014 install, is there any way to prevent it from being upgraded

    Does anyone know if there is a flag I can use to prevent a SQL Server 2005 database from being upgraded to SQL 2014 when it is restored to a 2014 instance?
    Don't ask why, I just need to know if this is possible or if 2005/8 DB's are required to be upgraded if they are going to run on SQL 2012/2014 instances. The documentation seems to say this is so, I just want to verify that.

    First: You cannot directly restore a 2005 database to
    2014. MS supports migration over 3 SQL Server version steps; means you can restore 2005 to 2008/2008R2/2012, but not to 2014. You have to do a migration step between.
    Olaf I was looking for this today, because I'm working with a new customer that have SQL 2005 and I have SQL 2014. And needed to restore a backup form the production server in my test server.
    When I read what you write I think, oh no!! I have to install SQL 2012 in my server. But that it's not an option for me, and I say let me try to restore the DB first in 2014 and if not work install 2012.
    You can restore a 2005 database to 2014 directly, and it works.
    For reference the version number in the servers 2005 (9.0.4035 SP3) and 2014 (12.0.2000 RTM)
    This is not related in any way to the original question that you answered (the file format will be upgraded to the new motor, that is sure).
    I put this lines because in the future there will be some people searching about if possible to restore a 2005 DB to 2014, and like me will read your lines and think it's not possible and that can make a decision to buy 2012 and not 2014 to that new server they
    will migrate.
    Don't forget to mark the best replies as answers!

Maybe you are looking for

  • Exporting Specific Artboards into .PDF

    I would like to know if it is possible to export only specific artboards from a CS4 .ai file as a .pdf like you can select them for print. I can't figure out how or find any info on that subject. (ie: I want to export artboards 2 and 4 in .pdf format

  • Transfert from one ipod to another?

    If i have an ipod and im getting the nano how do i transfer all my songs to the new one? isnt each itunes registered to a specific ipod?

  • ActBudVar$ function in Financial Reporting Studio

    I have an existing report set up this way: ACCOUNT dimension(vertical): * Children of Income * Interest Income * Income Expenses PERIOD dimension (horizontal): * Current Period * Current Period offset by -1 * Current Period offset by -2 YEAR dimensio

  • HT4623 what is a 42110 error in itunes mean?

    computer isn't recognizing the phone. reinstalled itunes, but no dice. keep getting thie error -42110 msg. any ideas? (using windows 7)

  • Adapter Deployment Problem - InvalidMappingException

    Hello All, I experiencing a wired problem by deploying custom adapter application in PI 7.1. org.hibernate.InvalidMappingException: Could not parse mapping document from resourceu2026u2026.. This adapter is deployed many times in another SAP PI7.1 sy