How to know threads status

Hello all!
I want to know if all my threads are done.
I wrote some code but when I run it have this errors:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalMonitorStateException
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:485)
        at gui.start.insertUserOpinion(start.java:177)
        at gui.start.searchButActionPerformed(start.java:145)
        at gui.start.access$000(start.java:36)
        at gui.start$1.actionPerformed(start.java:68)In my code I want to continue on my main function.
my code is:
     //creating threads by index of combobox
     for (i=0;i<=level.getSelectedIndex();i++){
     new myThread(list.get(i).toString(),model);
     //wait until all threads are done
     while  (myThread.activeCount()!=0)
     this.wait();
     }The error on the while loop
thanks for helping!!!

vitaly87 wrote:
But how do I know if all threads are done?When you have join()ed on each one of them. Like for example with your for loop there.
if I have more that one thread,and i create them with simple program not with anther thread.What?

Similar Messages

  • How to know the status of concurrent program from back-end in oracle apps

    Hi,
    Can you please explain me step by step how to know the status of the concurrent program from back end in oracle apps.
    Thanks,
    Raj

    When a record is being updated by a form, if you create a Pre-Update trigger on the block, the trigger will run for each record being updated.
    Same thing happens with a Pre-Insert and Pre-Delete trigger.

  • How to know the status of stream played using NetStream.Play method ?

    I am playing stream data published by third party server
    similar to FCS by creating NetStream object and calling Play method
    on it. Now the problem is, sometimes I am not able to view the
    published stream by playing it using Play method. Also it does not
    call OnStatus method of NetSteam. How can I know the status(or
    result) of Play method ?
    Note: NetConnection gets created successfully. I get status
    of NetStream.Play.Start / Stop when I put local flv as a first
    parameter to Play method

    Hi
    There are SQL reports in the following zip which has SQLDeveloper reports for runtime objects such as mappings and process flows;
    http://www.oracle.com/technology/products/warehouse/htdocs/Experts/owb_sqldeveloper.zip
    Cheers
    David

  • How to knowing DRQ Status?

    Hi,
    We all share ideas and opinions together to make SAP B1 product better.
    As we posted the DRQ, how can we know the status and the planning on the DRQ?

    Dear Peter,
    From here 2011, all the European transfers will have to adopt new standard SEPA. (Single Euro Payment Area)
    This change mainly consists in replacing the current bank account number on 23 characters by two codes, a code IBAN on 27 characters, and a code BIC or SWIFT on 11 characters.
    In order to be up to date with these new standards, we would like to know where you have to enter these data on SAP, because the sheet partner supplier (see below) indicates only code IBAN but not the fields BIC or SWIFT to 11 characters.
    Is SAP BO compatible with these new standards?
    Thanks in advance for your help,
    Hervé.
    Edited by: RVCRYO on Apr 26, 2010 8:25 AM

  • JSms 2.1.6:- how to know the status of message sent through GsmSmsService

    hi,
    i am using jSms 2.1.6
    can any one help in knowing the status of the messege which i sent through GsmSmsService,
    wheather messege reached the destination or not
    is there any way to know this
    please it is urgent
    nalin

    I need jsms 2.1.6 package.
    could you send that file?

  • How To  Identify thread status

    Hi Everybody,
    Anybody got an idea regarding identifying the status of the Thread like if its dead or live.
    And also how can you identify a thread.
    Very urgent,
    Thanks in advance.
    Keep smiling.....:-)

    try this
    public class ThreadTest implements Runnable {
    public static void main(String[] args) {
    ThreadTest tt = new ThreadTest();
    Thread t1 = new Thread(tt, "First");
    t1.setDaemon(true);
    Thread t2 = new Thread(tt, "Second");
    t2.setDaemon(true);
    t1.start();
    t2.start();
    try {
    Thread.sleep(2000);
    System.out.println("the first Thread is sleeping for 2 seconds");
    } catch (Exception e) {}
    synchronized (tt) {
    tt.notify();
    try {
    Thread.sleep(1000);
    System.out.println("the second Thread is sleeping for 1 second");
    } catch (Exception e) {}
    public synchronized void run() {
    try {
    wait();
    } catch (InterruptedException ie) {}
    sleepAWhile(4000);
    protected synchronized void sleepAWhile(long time) {
    try {
    Thread.sleep(time);
    } catch (Exception e) {}
    }

  • How to know the status of workflow?

    Hi all,
    When i create a Sales order in VA01 my workflow should get triggered.
    When the workflow status is 'In progress' the user should not be allowed to change the sales order that was created.
    How to do this and in which table can i get the status of a particular workflow.
    Regards,
    Gautham P

    Don't check any tables. The tables have changed between versions.
    Use two of the function modules from the workflow API instead.
    1) SAP_WAPI_WORKITEMS_TO_OBJECT to find the work items in which the object (your sales order BOR object) is used.
    2) SAP_WAPI_GET_WORKITEM_DETAIL to find work item status and more.

  • How to know the status of equipment on a particular date

    hi experts,
                   when we go to IE02 t.code there is a field showing the status of the equipment on particular date( Valid from and valid to ). If it is assigned to a particular functional location its status is displayed INST and its not assined its AVBL . Can i know from which table i can get the status of the equipment on particular date.

    hi expert,
                 I could not get the status whether it is AVLB  or INST from those table, i could see who has changed it.Could you be a bit clear regarding it

  • How to maintain the status of the Thread ?

    How to maintain the status of the Thread ?
    namanc

    I want to know whether a particular thread (java
    application) is completed successfully or not ...
    If the thread is not completed successfully then I
    want to restart the Thread.
    Actually this is the Task Scheduler Application ...
    If the particular task is not running successfully
    then I want to start the Task again ...
    namancThen it could look something like this: // loading the queue
    for each task
        add task to list of incomplete tasks
        enqueue task in work queue
    // dispatcher
    while !done()
        task = workQueue.dequeue();
        New Thread(task).start();When a task finishes, it can call a callback method on the dispatcher. The dispatcher looks at the task's status. If it finished successfully, the task gets removed from the list of incomplete tasks. Else it goes back on the work queue.
    There will be some syncing issues involved. You'll have to use wait() and notify()/notifyAll() to handle the situation where the work queue is empty, and all incomplete tasks are being worked on. And the case where the dispatcher wakes up after the notifyAll() and there's nothing to dequeue and nothing in the list of incomplete tasks.
    Clearly it needs some fine tuning, but I hope you get the idea.

  • How to know whether a method is thread-safe through the java-doc?

    In some book, it says that SAXParserFactory.newSAXParser() is thread-safe,but in the java-doc,it doesn't say that.
    newSAXParser
    public abstract SAXParser newSAXParser()
    throws ParserConfigurationException,
    SAXExceptionCreates a new instance of a SAXParser using the currently configured factory parameters.
    Returns:
    A new instance of a SAXParser.
    Throws:
    ParserConfigurationException - if a parser cannot be created which satisfies the requested configuration.
    SAXException - for SAX errors.
    I want to know, how to know whether a method is thread-safe?

    System.out is a PrintStream object. None of the methods there use the synchronized modifier, but if you look in the source code, you will find out it is thread-safe, because it will use synchronized blocks whenever it writes some text.
    The source code is in the src.jar file which you can extract.
    I didn't find any comments about that PrintStream is thread-safe in the API.

  • How to know existing Adobe Flash Player license status-.

    how to know existing Adobe Flash Player license status….

    There is no "license" for Flash Player as it's free. There is an End User Agreement, but you accept that BEFORE installing.
    To check installation status, rtight click ANY flash content and choose "Global Settings". Select the Advanced tab.

  • How to know if this computer can handle a certain monitor's resolution?

    I am looking to buy a new monitor, but I am at a loss as to how to know whether my computer can handle the monitor's resolution, will be compatible with it. I used to run two NEC Multisync FE991SB (CRT) monitors side by side, and one of them died. Their native resolution seems to be 1280x1024 per monitor. I am considering buying a DoubleSight DS-263N (LCD) monitor, which has a native resolution of 1920 x 1200, and running it alongside the NEC Multisync FE991SB that has not died. Here are the relevant vital statistics:
    Hardware Overview:
    Machine Name: Apple Power Mac G5
    Machine Model: PowerMac7,3
    CPU Type: PowerPC G5 (2.2)
    Number Of CPUs: 2
    CPU Speed: 1.8 GHz
    L2 Cache (per CPU): 512 KB
    Memory: 4 GB
    Bus Speed: 900 MHz
    Boot ROM Version: 5.1.8f7
    Graphics/Displays:
    GeForce FX 5200:
    Chipset Model: GeForce FX 5200
    Type: Display
    Bus: AGP
    Slot: SLOT-1
    VRAM (Total): 64 MB
    Vendor: nVIDIA (0x10de)
    Device ID: 0x0321
    Revision ID: 0x00a2
    ROM Revision: 2060
    Displays:
    NEC FE991SB:
    Resolution: 1280 x 1024 @ 85 Hz
    Depth: 32-bit Color
    Core Image: Supported
    Mirror: On
    Mirror Status: Hardware Mirror
    Online: Yes
    Quartz Extreme: Supported
    DoubleSIght monitor specs (I might buy one of these):
    Display
    Viewable Area:550.08 x 343.8(H x V)Pixel Pitch:0.2865mm x 0.2865mmMax. Visible Angle:178' / 178'Response Time:5 ms (G T G)Brightness:500 cd/m typ.Aspect Ratio:16:10Contrast Ratio:800:1 typ.Recommended Resolution:1920 x 1200 max
    Monitor Stand
    Adjustable Monitor Stand:Tilt
    Video Signal
    Horizontal Frequency:31.5~ 82.3KHzVertical Frequency:56~76HzDigital Signal:HDCP Capable
    Interface
    Interface type:VGA 15-pin D-sub type/DVI-D type
    Power
    AC:Input: AC 110~220V, 50~60Hz; Output: DC+24V, 5.0APower Consumption:135W max., 2W Power Save Mode
    Characteristics
    Controls:Graphic OSD, Auto AdjustmentUSB:4 USB portsDimension:23.5in W x 18.0in H x 11.0in DWeight:23 lbs.Certification:FCCWarranty:Three year limited warranty (parts & labor)
    VESA
    VESA:100mm x 100mm
    Any advice on how i can learn about compatibility? And on what card i need to buy, if i do need to buy one? Thanks.

    Dear Discussion Folks,
    Thank you all so much for your help. I think I understand now, as a result of your comments and this reply from NVIDIA customer support:
    "I understand from your mail that you would like to know if GeForce FX 5200 Ultra supports your monitor that has a recommended digital resolution of 1920 x 1200.Please be informed that as per the NVIDIA records, the maximum digital resolution supported by this graphics card is 1600 x 1200 and the maximum analog resolution supported by this graphics card is 2048 x 1536. Since you have mentioned in your e-mail that the Apple's specs page says that the maximum digital resolution supported by this graphics card is 1920 x 1200, in this case, I request you to contact Apple Support over phone and get confirmed on this. The reason why I am requesting you to contact Apple is because, we at NVIDIA, manufacture only the basic chipsets for the graphics cards and sell them to Apple Computers. The Apple Computers produce the graphics cards using the NVIDIA chipsets."
    This reassured me that there's no reason to worry about the appearance of a contradiction between the Apple tech sheet and the NVIDIA tech sheet. I went ahead and ordered this monitor today: the DoubleSIght DS- 265W.
    (by the way, sorry about typing 1900x1200 when I meant 1920x1200).
    After it arrives in a week or two, I'll update this thread to confirm that its resolution is supported by the GeForce FX 5200 Ultra card.
    Thanks again,
    Mark

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • How to show network status in top toolbar?

    how to show network status in top toolbar? Network preferences is there, but network status has disappeared on last reset of Airport Express, but may not be connected. Thanks in advance for practical help

    Interestingly, in my experience, using the method described above of unchecking the "Show Connected Servers" box in the Finder Preferences makes no difference in what I can put in the sidebar. I was able to move a sub-folder of a shared disk to the Favorites section of the Finder Sidebar, but nothing else. (i.e. I could not add the shard disk itself to the sidebar – either to the devices, favorites, or any other section, and I could only add a subfolder of the shared disk to the favorites section – not to the devices section or any other section). This was the same whether I had "Show Connected Servers" checked or not.
    I'm running OS X Mavericks, and the setup I have is with a previous generation Time Capsule (i.e. the short, square kind that you could buy before the most recent taller variety came out last year), with a LaCie 3 TB USB 3.0 external drive plugged into the USB port of the Time Capsule. I'm then accessing this network drive over WiFi. The differences in what I'm seeing may be due to some change they made in the way Mavericks handles these setups.
    I could also just be misunderstanding what you're saying, but I thought I'd add this in case anyone else gets similar results so that they'd know they're not alone. Let me know if I'm missing something here.

  • How to Insert a Status Bar to my application

    Hello all
    I use JBuilder v9 and would like to add a status bar at the bottom of the main
    frame in my program. I checked the manual pages but there is no such class as StatusBar or JStatusBar.
    When I type StatusBar (or JStatusBar) sb = new StatusBar (or JStatusBar) ();
    it gives errror message.
    Does anyone know how to add a status bar to a frame?

    A quick a dirty example:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    public class StatusBarDemo extends JFrame
      private JLabel statusBar;
      public StatusBarDemo()
        JMenu menu = new JMenu("File");
        JMenuItem item = new JMenuItem("Open");
        item.addMouseListener(new StatusBarUpdator("Open a new file"));
        menu.add(item);
        item = new JMenuItem("Print");
        item.addMouseListener(new StatusBarUpdator("Print the current file"));
        menu.add(item);
        item = new JMenuItem("Save");
        item.addMouseListener(new StatusBarUpdator("Save the current file"));
        menu.add(item);
        JMenuBar menuBar = new JMenuBar();
        menuBar.add(menu);
        setJMenuBar(menuBar);
        statusBar = new JLabel(" ");
        statusBar.setForeground(Color.black);
        statusBar.setBorder(new CompoundBorder(new EmptyBorder(2, 5, 2, 5),
                                               new SoftBevelBorder(SoftBevelBorder.LOWERED)));
        Container c = this.getContentPane();
        c.setLayout(new BorderLayout());
        c.add(statusBar, BorderLayout.SOUTH);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
      public static void main(String[] args)
        StatusBarDemo frame = new StatusBarDemo();
        frame.setSize(400,300);
        frame.setVisible(true);
      class StatusBarUpdator implements MouseListener
        private String hoverText;
        public StatusBarUpdator(String text)
          hoverText = text;
        public void mouseEntered(MouseEvent e)
          statusBar.setText(hoverText);
        public void mouseExited(MouseEvent e)
          statusBar.setText(" ");
        public void mouseClicked(MouseEvent e){}
        public void mousePressed(MouseEvent e){}
        public void mouseReleased(MouseEvent e){}
    }

Maybe you are looking for

  • IPhoto sort order changes on iPad/iPhone when photos are edited

    I have been having issues getting photos to display in the correct order on my iPad, iPhone and Apple TV. When I go into an event I want the first photo taken to be at the top and the last at the bottom. I sort by date so that photos taken on differe

  • Organisational Structure changes

    Hi I have to create new BU's, new departments, move people from old BU's or Deps to new below is my Financial and SCM plan,can you please advice if there is anything i need to add or remove, R11 Finance Changes Plan Update Cross validation rules Upda

  • Manage data element UMBSZ in Material Record : Entry too long

    Hello I would like to manage alternatives units of measure with a Numerator defined in more than 5 digits, in the material master record (transactions MM01, MM02). For example : A material with a base unit of measure = ST (Items) : view Basic data 1

  • Sharepoint2013 office 365 and SSRS

    We have Sharepoint 2013 Enterprise License. We have an on-premise Sharepoint system with SSRS. We are planning to migrate to Sharepoint office 365 portal. My question is: Is SSRS supported in Office 365 Sharepoint 2013 portal?

  • Crash when importing psd (PSL Cache error)

    Hi, When I import a Photoshop file, AE crashes with this alert: After Effects Alert Last log message was: <140735304074000> <SyncService> <4> CheckConnection: 3. Generating crash log, which may take a few minutes. I'm following the instructions for l