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.

Similar Messages

  • How to maintain the material master data in plant

    Hi all,
    while creating BOM I am getting an error "no material master data in plant' can some one help me how to maintain the material master data in plant
    Regards,
    Balu

    Check the material available in MARC table in SE11 transaction against your plant.If it is not available please maintain through MM01 transaction.

  • How to maintained the Text  language for CKF keyfigure

    Dear All,
    Please let me know how to maintained the text language for CKF I am using only keyfigures in CKF.
    Issue is text is not showing in Spain language when user exeuted the report (longin Spain) for CKF keyfigures .
    As per report design there are formuals and direct keyfigures and CKF has defined and we keep it under in Row struture in the report.
    After exeuted the report (Login Spain)Text has converted in all languages along with spain except for CKF keyfigures.
    Issue in text CKF's:
    There is a main  CKF (Cost) under this again we defined two sub CKF's those are total cost and average cost. We able to see the text in Spain language for Main CKF(cost) and also cheked in RSZELTTXT(Texts of reporting component elements) for the same.
    We can able to see the text in all languages for main CKF(cost) and enteries are there in RSZELTTXT table.
    We can see only  the text in english for  total cost and average cost and also enteris are there only in EN in RSZELTTXT table.
    It would help to me if any one can answer my question.
    Thanks in advance .
    Regards,
    MQ

    U can fetch the texts for the items using
    Read_text.
    Example:
        g_f_tdname = xvttp-vbeln.
        g_f_obj = p_obj.
        g_f_langu = 'DE'.
        REFRESH g_t_lines.
        CLEAR g_t_lines.
        CALL FUNCTION 'READ_TEXT'
             EXPORTING
                  id                      = p_var
                  language                = g_f_langu
                  name                    = g_f_tdname
                  object                  = g_f_obj
             TABLES
                  lines                   = g_t_lines
             EXCEPTIONS
                  id                      = 1
                  language                = 2
                  name                    = 3
                  not_found               = 4
                  object                  = 5
                  reference_check         = 6
                  wrong_access_to_archive = 7
                  OTHERS                  = 8.
        IF sy-subrc <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    The Required fields are,
    Text-id ,language,name,object.
    Let me know if you further require help.
    Regards

  • How to Maintain the Pricing Condition Records in CRM

    Hi
    I am new to the CRM
    How to maintain the pricing condition records in crm for the particular condition type?
    as we do in SD(VK11)
    Thanks

    Hi Binu,
    First of all, you could maintain pricing conditions in the following places:
    1. In General Condition Maintenance (GCM)
    2. At the product maintenance level
    3. At the 'Price agreement' tab of Contracts
    4. As manual conditions during order processing at item level
    Now, if you want to maintain conditions using GCM, you first have to maintain a condition maintenance group in the customizing where in you can assign condition table and condition type for different counter values. I am assuming that you have done this activity successfully.
    When you run the transaction '/SAPCND/GCM', for application 'CRM', your condition maintenance group name and context 'GCM', you will be initially taken to a screen where in you'll have an item area which would be blank and then condition fields would be displayed in a tree on the left.
    Here, select the field 'Condition type' and click on icon 'Select records'. You would get a dialog prompting you to enter condition type. Here you can specifiy the condition type for which you want to maintain/view condition records.
    If no condition records are available, item area would be left blank. Here, you can choose a condition type using the standard F4 help. Depending on condition types that are assigned to condition maintenance group, different condition types would be displayed in the F4-help using which you can maintain condition records.
    Hope this helps.
    Regards,
    Pavithra
    **PS: Please reward points if this helps.

  • Validation: How to maintain the entry in GB02C

    HI FI GURUS n EXPERTS,
    My requirement is that - We want to restrict Negative posting for some GL i.e. For some GL balance should not be Zero.
    When I have made the search on SDN, I found it can be done with the help of Validation: OB28 & GGB0.
    Currently we are not using any validation. When we use T-Code GGB0 --> Financial Accounting --> Line Item --> New Validation
    System shows a pop-up window to select Boolean Class & Message ID.
    I also found that this information is maintained in Table GB02C.
    When I use Se16 to see the detail of the table GB02C, I found there is only one entry Bool. Class: FP1 & Message ID 7F.
    But I don't know How to maintain the entry in table GB02C & What is the T-Code for it. which message ID I have to create.
    Please help.
    DSC

    Dear Alex,
    When I use: GGB0 --> Financial Accounting --> Line Item --> New Validation
    System shows a pop-up window to select Boolean Class & Message Class, I select the Message Class 9 and for Message Class Press F4 and select any message class. System gives an error message: Message ID must start with 'Z' Message no. GB116.
    Basically, My question is that: Which T-Code we have to use to maintain Boolean Class & Message Class.
    With thanks,
    DSC

  • How to stop the thread?

    Hi,
    How to stop the thread in java. This is my program.
    import java.net.InetAddress;
    public class ThreadPing extends Thread {
         ThreadPing(String pingIP)
              super(pingIP);
              start();
         public void run()
              try
              String pingIP = Thread.currentThread().getName();
              InetAddress inet = InetAddress.getByName(pingIP);
              Boolean get=inet.isReachable(1500);          
              if(get==true)
                   System.out.println(inet.getHostName());               
              }catch(Exception e)
         public static void main(String args[])
              for(int i=1;i<=100;i++)
                   String pingIP = "192.168.1."+i;
                   ThreadPing tp = new ThreadPing(pingIP);
    Thanks in advance.

    The simplest way to stop all the thread is to make all thread daemons and exit the program when you want them to stop.

  • How to maintain the vendor details in sap pi ?

    HI All,
    Here i am working with B2B scenario , can you help me how to maintain the vendor details and client details in parties,'
    here i have 49 vendors.
    control records are changing according to the vendor s .
    Plz help me ......

    Can u help me how to maintain the link between the pi and ecc for identifiers
    Would like to know what your scenario is. Identifier would be required to be maintained in the Party (created in SAP PI) when the scenario is Inbound.
    It is actually the Partner Number for the Partner Profile created in we20 of the sAP ECC system. (you may have to store it as KU or LI) in SAP system.
    Regards,
    Abhishek.

  • How to maintain the contact person in Business Partner ?

    Hi Experts,
    Could you help to resolving the below Requirement.
    __  +Requirement:+__
    How to maintain the contact person in Business Partner ?
    How to get the Contact person in Is-Media Documents?
    Thanks& Regards
    Venkat

    Dear Venkat,
    In SD Customer Master data, we can maintain Contact Person in General Data tab page.
    For my knowledge, we can not find u201CContact Personu201D field in ISM Business Partner u2013 General Data. Correct me if I am wrong.
    Mostly user enters the contact person details in u201CSearch Term 1/ 2 fieldu201D in Address tab page in ISM Business Partner u2013 General Data tab page. While creating ISM Billing Document for this Business Partner, system prints this contact person details in ISM Invoices.
    (Or)
    While creating ISM Order, user can maintain Contact Person name in Header Details(Click on u201CGo to >Header>Details>Purchase Order Data>Cont.Person)
    If you maintain Contact Person name in Header Details also, system print this contact person details in ISM Invoices.
    Check from your end.
    Best Regards,
    Chandramohan

  • How to maintain the contact list in the phonebook when i change my sim card

    how to maintain the contact list in the phonebook when i change my sim card

    The SIM has not affect on the contacts in an iPhone. Unlike other devices, the contacts are not maintained on the SIM card.

  • How to maintain the data in the view cluster

    we are doing upgrade, we have one view cluster app_log in this object scwb
    and subobjects is swtlo1,02,03 like i have some subobjects in 4.6c we transported the view cluster to ecc6.0 in ecc 6.0 i have object scwb  but subobjects doesn't exist how to maintain the subobjects in view cluster.

    Definition
    A view cluster is a group of maintenance dialogs which are collected in one maintenance unit for business or technical reasons. They allow related data in more than one table/view to be maintained consistently.
    Use
    Whereas only 1:1 relationships can be processed in maintenance views (except for language-dependent texts), key extensions and relationships of cardinality N:M can also be handled in view clusters. Maintenance dialogs with no key, or partial key-dependence, can also be combined into view clusters.
    Grouping dialogs into one maintenance unit has the following advantages for data maintenance:
    Navigation: A view cluster contains convenient standard navigation between the individual maintenance dialogs. This simplifies the maintenance of the data in a view cluster.
    Consistency: The view cluster ensures data consistency when deleting, copying, saving, retrieving and manually transporting data. For example when an entry in a higher-level view is deleted, , it automatically ensures that all dependent entries in lower-level views are also deleted.
    You can first split tables with a lot of fields into various views and then collect them into a view cluster.
    Use tabs to format very wide tables with a lot of fields.
    Structure
    Navigation in a view cluster is usually based on the hierarchy of the tables/views on which the dialogs are based. A view cluster usually consists of one or more root dialogs and the at most 14 maintenance dialogs which depend on them. A view at a lower level has one or more additional fields in its key compared its higher-level view. Each data record at the higher level has several dependent data records below it.
    Each maintenance dialog is an independent unit consisting of an overview screen or an overview and a detail screen, depending on the dialog type. As well as the data to be maintained, the overview screen contains a navigation area, in which you can go to higher or lower level maintenance dialogs.
    One-level maintenance dialogs only contain one screen, the list screen, in which all existing data records are displayed in a table. In a two-level maintenance dialog, double-clicking on a data record in the list screen takes you to the detail screen, which displays all the fields in the selected data record.
    Generate a maintenance dialog for each view before you call the cluster maintenance (SM34). When you generate the maintenance dialog, flag the key fields which are identical in the view and its higher-level in the cluster, with the maintenance attribute S. The system fills the key fields when you go from the upper to the lower level, with the values of the data record selected in the upper level. Go to the transaction SE54 to define a view cluster.
    <b>Rewards point if useful.......</b>
    regards....
    Abhaysingh.

  • How to maintain the integrity of datbase??

    Hi,
    I wanted to know that waht are the things which must always be considerd when you maintain the integrity of database and also how to maintain the security that balance the user requirement? I am asking in general point of view.
    hope for your precious advise.

    Data integrity is normally ensured by ensuring that the schema design is properly normalized (i.e. there is 1 and only 1 place where a particular piece of information belongs) and by creating referential integrity constraints. It is also a good idea to create packages that operate on the tables and expose only these packaged procedures to app developers. When there are bugs, it is a lot easier to fix a single stored procedure than to modify every application out there. Stored procedure interfaces also simplify life for developers because they don't have to be concerned about remembering to insert all the appropriate relationships, just passing in the right parameters to the function.
    Your question on security, unfortunately, is incredibly broad. Generally, practice the principle of least privilege-- give users the absolute minimum of privileges they could need to do their job. Precisely what sort of security policies you need really depends on the application and the organization. Large US companies have things like Sarbanes-Oxley to worry about which drives a lot of requirements, systems with sensitive data (i.e. payroll) probably need more security than something like the product database.
    Justin

  • How to maintain the characterstics of the values tab of limits maintain.

    Hi SAP ALL,
                     Hi how to maintain the characterstics point of valu scales maintain activally i want the P R release authorsiation limit increase.
    Thnaks

    The Class Type of PR & PO Release is 032 and for Class Go to SPRO-MM-Purchasing-Purchase Order-Release Procedure-Release Strategies and Here you will find the Class.
    Else Go to Release Strategies-classification using the same above path and Change the Chareceteristic Values and Save.
    Regards,
    Ashok

  • Hi, how to mark the thread as sticky thread?

    Hi,
    how to mark the thread as sticky thread?
    Thanks & Regards,
    Swathi

    this can be done by moderators or admins only. You should contact one of them so they can decide whether a post can be sticked or not.

  • How to increase the thread count for JDBC adapter

    Hi ALL,
                Could someone advice me on how to increase the thread count for JDBC Adapter in Visual Admin:
    JDBC_http://sap.com/xi/XI/System.Call.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Recv.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Rqst.maxConsumers 5
    JDBC_http://sap.com/xi/XI/System.Send.maxConsumers 5
    I need to increase them to 10.
    Regards,
    Xier

    hi check the below links:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/806e75a0-0e01-0010-2587-fc518de8ac1a
    admin manual:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fdb09490-0201-0010-e09e-a76388646ad0
    note:reward points if solution found helpfull.....
    regards
    chandrakanth.k

  • How to maintain the dynamic description for a workitem ?

    Hi everyone ,
    How to maintain the dynamic description for a workitem ?
    Thanks ,
    Naval Bhatt

    OPen PFTC Txn
    Enter the TAsk ID and openit in change mode
    declare a container element in the task container and the same element in the workflow too.
    Now from the workflow pass the value to the task container by using binding.
    and in the workitem text of the task conatiner.
    For e;g
    if you want to display the workitem id in the task decription
    open the task in the pftc and add the element in the workitem text and then pass the element value , so that the value that you have passed will be displayed in the workitem text.
    *&WORKITEMID& Add *

Maybe you are looking for

  • Run a loop when there is any change in value of any control or local variable in side the loop

    I am trying to write a program for a complicated multivariate system. I have many different controls connected to different functionality of the system. What I want to do is, run a continuous time loop, but I don't want the program to go over all the

  • Will there be a new bios

    Will there be a new bios for the K8N neo platinum? or is 1.4 the last. I know beta bioses are available, but I don't want to use those.

  • Can't move or resize Chromium in Awesome WM

    Hello All, I recently noticed that chromium has started launching as a floating window by default in awesome. Along with this, I can no longer resize or move it by holding MOD4 and dragging with the left/right mouse buttons. (the cursor changes to th

  • XML parser RT

    Hi all! I need some help: i want to parse an xml file in labview Real Time.  In windows i know you can use a microsoft parser using Windows ActiveX. But i think this method will not work in RT environment .. Am I wrong ??? Does anyone knows how to do

  • Cross-Tab Conditional Formatting

    Hello Everyone I have a question, I am working with on a cross-tab table version 2008 that requires a dollar symbol in some of the columns, but not all of them. I tried to fix this problem with a conditional formula, but for those columns that are ca