How to wait for a Process to complete without using wait,notify methods

I have created a new Process using run.exec() method using a cmdline String array in the format "java, class name, 4 command line arguments" to be passed to the main method of that class. But I have a maximum limit of the no. of processes to be created e.g. 5. So whenever I create a process, I use a static semaphore class to decrease the count, and increase it again when the process ends; so when the 6th process wants to start it will be suspended until another process is complete. My problem is how do I communicate to the calling class that the process has ended. I don't want to create any threads as that will defeat the purpose of creating separate processes. I have tried Process.waitFor() method but it doesn't work.

you could add a iamfinished method to the class where you store the counter and thread calls it if it is finished.

Similar Messages

  • How to check for locks on a material - without using Enqueue function

    Hi
        We have a requirement in which - we need to check the lock ( exclusive ) on a material before we call the BAPI to update the material.
    I don't want to actually lock the material before calling the BAPI - the BAPI itself acquires the lock as a part of its processing. All I want to do is to check whether lock on a material exists before calling the BAPI - thus avoiding any lock related issues on the material in the BAPI call.
    How do we just merely check whether material is locked - any standard function module /SAP tables where in material lock is stored that we use/interrogate ?
    Correct answers will be promptly rewarded.

    Hi ,
          There is standard function enqueue_read ,based on material number .
    Pass the material number to FM ENQUEUE_READ if sy-subrc = 0 then material is locked otherwise not .
    Please reward if useful.

  • How do I resolve "Error processing your request", when using Download link in My Orders (photoshop 5

    How do I resolve "error processing your request" when using the download link in My Orders for photoshop 5

    As Jeff already hinted at, try a different browser. Such issues almost always are local problems on your end. Something is either changing or blocking the HTTP headers used for forwarding (could be your router, a desktop firewall or other security tools) or a JavaScript is not running/ being blocked.
    Mylenium

  • How to Start process in ProcessChain Without using Repeat option?

    How to Start process in ProcessChain Without using Repeat option?

    Se16 -- table:RSPCPROCESSLOG - click on display entries.
    Entet the variant, instance start date (this info you can get from the "display message" of PC.
    Now execute to display the table entries of RSPCPROCESSLOG.
    Next goto SE37 transaction --enter RSPC_PROCESS_FINISH
    Take the entries from the above table to set the input parameters of the FM.
    I_logid = log_id(from above table)
    I_type = type(from above table)
    i_variant = varaint (from above table)
    i_instance = (from above table)
    Click on F8(EXECUTE)
    now the actual process is set to gree and the process chain will be triggered (rest of the PC with out repeating the step from where is was red).

  • How AP behaves for withholding tax when vertax is used for tax calculation

    Hi,
    I am currently working on R12 implementation, I have requirement where business has to calculate the USE tax and withhold it from being paid to the supplier in case if use tax is not mentioned on the Invoice and pay it to tax authorities directly by business. Our client has Vertax third party tax engine. now the question is does it works same as it is in oracle payables in cases if client want to use vertax to calculate tax. How oracle behaves for withholding tax when vertax is used for tax calculations.
    Regards,
    Shashi.

    Hi
    Cheque Go to Menubar of  which document you have to  post for getting the WHT value  Menubar Settings - editing options -  remove the tick calculate tax on net amount.
    Rgds
    Vani

  • HT4059 I bought a book but I don't know how I paid for it. Does iBooks automatically use credit on my itunes account?

    I bought a book but I don't know how I paid for it. Does iBooks automatically use credit on my itunes account?

    The store credit in your iTunes account will be used first. Otherwise, the charge card you have on file will be used.

  • HT2204 I have recently immigrated to the US but my apple ID is still stuck with my previous country. How do I change the country? Preferably without using a credit card

    I have recently immigrated to the US but my apple ID is still stuck with my previous country. How do I change the country? Preferably without using a credit cardI've only been here in the US 2 months and still have no US credit card.

    Your credit or debit card credentials must be associated with the same country where you reside.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

  • HT1689 How can I play podcasts on my iphone without using data?

    How can I play podcasts on my iphone without using data?

    I used to sync my podcasts to my phone individually, but found out that the Podcast app works better for me.  It continously downloads the podcasts (not really sure when, that's the only thing, when its downloading it may use data depending on where you are) and also deletes the ones i have listened to.  Hopefully that will help you out!

  • How to transfer files from mac to ipad without using itunes

    how to transfer files from mac to ipad without using itunes ???
    as i want to use my ipad for official use as well...please suggest..

    well to be 100% technical, no you didn't but that aside, it good to know there are ways for people to transfer music into the default apps without iTunes, if they have a need.
    I tend to use 3rd party apps for documents, like your mentioned iExplorer etc, which are handy.
    I see from a search the two "apps" you mentioned are not iOS apps, which I had assumed, SyncPod and FreeSync are apps for your computer, that would explain their access to the default Music/Video apps.
    I had wondered how Apple had allowed iOS apps in the store that could get around the sandboxing in iOS of apps.
    Message was edited by: CGW3

  • Does anyone know how to get an application you had once without using App Store?

    Does anyone know how to get an application you had once without using App Store?
    Because I'm underage and I couldn't get it back.
    I just want it back, I'm not going to use any money in App Store...

    When you say you "had it once", how did you get it then?  The App Store has only been around for a few years, so there are lots of apps out there that you would once get from the developer, but now they're only available on the App store.  Which app(s) are you referring to? 

  • How to display the fields in ALV Output without using Field catalog?

    How to display the fields in ALV Output without using Field catalog?
    Could you pls tell me the coding?
    Akshitha.

    Hi,
    u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
    data: itab type table of mara.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_structure_name = itab
    CHANGING
    ct_fieldcat = lt_fieldcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *Pass that field catalog into the fillowing FM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_grid_title            = 'REPORTING'
                is_layout              = gt_layout
                it_fieldcat             = lt_fieldcat[]
           tables
                t_outtab                = itab.

  • I have all my pictures in an external drive, how do i create a library in iphoto without using my internal drive space?

    i have all my pictures in an external drive (around 1tb), how do i create a library in iphoto without using my internal drive space? thanks!

    In iPhoto use the command "File > Switch to Library" and then click "Create New" in the Library Chooser panel.
    Select a folder on your external drive as the destination.
    You can also get to this panel by holding down the alt/options key when you launch iPhoto.

  • HT201371 how do i un-disable my iphone 5s without using itunes

    how do i un-disable my iphone 5s without using itunes

    Make a Genius Bar appointment at your nearest Apple Store and have them Restore it as a new iPhone in iTunes.

  • How can i ge into the app store without using a credit card?

    How do i get into the app store without using a credit card?

    Unless you can find an item in the store that costs the same as your balance then you will need to contact iTunes Support and ask them if they can remove the balance : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How can I back into the main screen without using the activator bottom?

    How can I back into the main screen without using the activator bottom?

    I assume you mean the HOME button. You cannot. The HOME button is the only way to exit an app.

Maybe you are looking for

  • How can i input an IRIG time as timebase for DAQ

    i've got a 6062E board for collecting analog data but need to have IRIG time from another source input as the time base for the labview DAQ channels.  How can i do this with labview and my existing h/w ? thanks, jac

  • Question about version based downloads

    How does the jnlp-servlet know where different versions of a jar are? Does it look through the entire web directory for version.xml files and keeps a list? I am asking because I don't really understand what steps would be involved when I needed to cr

  • BufferedReader Problem (inserting space after every character)

    (This is a message I sent to an Aglet forum, however I thought maybe someone here could help me with the BufferedReader problem...with the spacing...read below) -Blake ok here's what I'm attempting to do. I have a Master Aglet that creates a slave wh

  • How to clear session in JSP?

    I searched yahoo, and found that it seemed not easy to force invalid the session using jsp, compared to php just three lines: session_start(); session_unset(); session_destroy(); How to acheive this using JSP? Must I follow these (quite complex) step

  • How do I close apps on iPhone 4S?

    How do I close apps on iPhone 4s?