Child thread reminder to parent thread

Hello

I have a question about the cross-thread communication.

I have a class of the class (parent) for example, which creates a child class B executes in its own thread.

I want to have the child thread callback to its parent.

If I do a cal in my class B run a such parent.somethingHasHappened () are there problems I should be aware with regard to blocking.

For example, if I make a call to a function in the parent class of the child that might potentially be blocked due to the parent thread be filled (if not what happens if I call parent.somethingHasHappened () and that the parent thread is busy, or is there something that would prevent me from doing this type of call)

My apologies if this is a stupid question I; m getting my head around the Java, model thread after years of Symbian.

Pooling mechanism may depend on the task.

For example - put in place a thread to check the indicator of value and run it on regular basis (TimerTask class use).

Or implement a while() loop, and check the indicator at each iteration.

Tags: BlackBerry Developers

Similar Questions

  • Close all child threads when closing of the scene

    I have several instances of child threads that are started and should continue to perform in until applications stops.

    I have classes that extends from task and I create the son as

    new topic (subject of the class) m:System.NET.HttpListener.start ();

    When it comes to interruption/slaughter (do not know which is correct, please let me know) threads that should be made on the inside

    {primaryStage.onCloseOperation ()}

    Here I want to put an end to all discussions of the child, but because my sons are divided into different classes, my not having is not a clear picture how to achieve this.

    I know there is a problem of design, in my application, when it comes to discussions, but I'm not able to find a way to solve the.

    Use thread.setDaemon (true) Thread (Java Platform SE 7)

    I suggest to use the framework of the executor and a ThreadFactory, for only need create a thread demon once.

    Something like this:

    Executor = Executors.newCachedThreadPool (new ThreadFactory() {}

    @Override

    public Thread NouveauThread (Runnable r) {}

    Thread thread = new Thread (r);

    thread.setDaemon (true);

    Returns the thread;

    }

    });

    And then use it like this:

    Executor.Execute (yourTaskOrRunnable);

    When there are only demon running threads, the JVM will stop and also stop all the sons of the demon.

  • Simple example of child to access the Parent data

    Hi all

    Im trying to explore and make sense of OOP.  Ive been learning as much as I can, but why cant seemt to extract data from a class parent child.  Ive put the child to inherit from the parent and creates an accessor parent to read and write.  I write the data in the parent class and then try to read data from the child's class. Is there something im missing? Anyone have or know a link to a simple example of this?

    Thank you

    Matt

    Ok.  I think you have a misunderstanding of the works the POO here.  The idea with OOP is that you can pass the child object in the parent methods and is in any case on this object.  Your drawing should look like this:

  • Can move us the child member of some parents to the other Parent as child member

    Hi all

    Can u just answer the following question: we need urgently.

    Can we get out the child member of some parents to the other Parent as child member with deletion/cut / child member
    ??

    Move in the direction of cut and paste.
    In the outline of the editor, if you drag a child member by a parent to another parent he will do the same.
    If you want to add a child member by a parent to another parent in keeping one, you can do this by copying and pastechild for the new parent and you must set the property of the Member as a shared member.

  • The child jobs with tasks Parent liaison

    A Parent task you need in custom Inbox.
    Now, when the user opens this task he should see several tasks assigned to this user for this ID.
    Once all tasks are complete, so only I will be done with the parent task.

    Is here

    How to bind the child jobs with one parent task
    Show a single task parent in the Inbox through jsp custom
    When all the tasks are completed how can I ensure that the duties of Parent is now?

    Please pour in your thoughts...

    Looks like it's a perfect fit for the optional tasks in an interactive activity.

    With interactive activities, you have a main task, and you can define as many optional tasks you want. The activity ends when executing the main task (if you have the auto all the option enabled).

    You can set all your tasks of 'child' as optional tasks and then have the task main validate that all optional tasks have been executed before continuing or display an error message saying that x is not done.

    You would see only the main task in the Inbox, but when you see the details of the task, you would see all optional tasks that can be performed.

  • How to copy the properties of the child to another class parent class the child at run time?

    Hi all

    I have 3 classes:

    Class A: parent

    Child classes B and c:

    At runtime, I want to istantiate an object of class C of an existing class B object.

    In particular: I have an object of class B with its properties; Then, I want to create an object of class C, which the parent properties are 'taken' of object B.

    I tried to use "more generic class" and "to a more specific class', but without success.

    Can you help me?

    Basically, you will need to write explicit code that will have all relevant data and move everything to the new object.

  • Cannot add child account to the parental control

    No matter how many times I add my child account to watch safely from the family, it does not work. The account appears in the list of monitored accounts and has the correct options I selected via the Family Safety however website when my child connects his account said "this account is not monitored by parental control.

    I deleted the computer AND the child of the Family Safety options site. I uninstalled and reinstalled parental control over the child's laptop computer but the account is STILL without oversight and shows via the control panel in Windows 7.

    When I log on the site of Family Safety on that account child watch the monitored account as 'white' "computername" when "in white" should be the account on the laptop.

    I am a computer professional and cannot understand it. What other options do I have?

    ANSWER FOUND!

    I found the answer on a long search of these forums...

    I had this problem because the computer name was the same as the name of my child's account. I changed the name of the computer to another one of his account on the computer and I was able to successfully activate Parental controls through parental controls on the computer.

  • A-team Mobile persistence Accelerator - Insertion into the child records for a Parent-child data objects

    Hello team

    We use persistence Mobile Accelerator for our application of MAF. We must build couple of REST services for it (Fetch, Create, Update), problem is we are able to insert/update of the parent records but we are not able to create child records.

    It seems when we ask the operation of creation in the book of the child, is no new line for child is created.

    Here is the screenshot of the data control wizard:

    parent.pngchild.png

    Here is the task (update) and desktop (create) JSON format (TaskAssignment is the address of the child)

    PUT the task:

    {

    'Task': {}

    'ACTIVITY_ID': 100,.

    'PROJECTID': 100,.

    'ACTIVITY_NAME': "string",.

    'DESCRIPTION': 'string ',.

    'PARENT_ACTIVITY_ID': 100,.

    'STATUS': "string",.

    'PRIORITY': "string",.

    'PERCENTAGE_COMPLETE': 100,.

    "START_DATE": "2008-09 - 28 T 21: 49:45.

    "END_DATE": "2014-09 - 18 T 19: 18:33.

    'ETA': ' 2006-08 - 19 T 13: 27:14 - 04:00 ",".

    'ESTIMATED_HOURS': 100,.

    'ACTUAL_HOURS': 100,.

    'OWNER_USER_ID': 100,.

    'CREATED_BY': "string",.

    "CREATION_DATE': ' 2009-05 - 16 T 08: 42:28"

    'LAST_UPDATED_BY': 100,.

    'LAST_UPDATE_DATE': ' 2003-08 - 08T 20: 18:37 - 04:00 ",".

    "TaskAssignment": [{}

    'ASSIGNMENT_ID': 1000.00.

    'PROJECT_TEAM_MEMBER_ID': 1000.00.

    "START_DATE": "2012-09 - 13 T 09: 00:34 - 04:00", ".

    "END_DATE": "2009-10 - 14 T 03: 16:36."

    'CREATED_BY': "string",.

    'CREATION_DATE': ' 2010-03 - 18 T 12: 05:32.

    'LAST_UPDATED_BY': "string",.

    "LAST_UPDATE_DATE": "2018-12 - 28 T 14: 51:14 - 05:00", ".

    'FAVORITE_FLAG': "string".

    } ]

    }

    }

    Workstation:

    {

    "Task": [{}

    "ACTIVITY_ID": 1000.00.

    'PROJECTID': 1000.00.

    'ACTIVITY_NAME': "string",.

    'DESCRIPTION': 'string ',.

    'PARENT_ACTIVITY_ID': 1000.00.

    'STATUS': "string",.

    'PRIORITY': "string",.

    'PERCENTAGE_COMPLETE': 1000.00.

    "START_DATE": "2008-09 - 28 T 21: 49:45.

    "END_DATE": "2014-09 - 18 T 19: 18:33.

    'ETA': ' 2006-08 - 19 T 13: 27:14 - 04:00 ",".

    'ESTIMATED_HOURS': 1000.00.

    'ACTUAL_HOURS': 1000.00.

    'OWNER_USER_ID': 1000.00.

    'CREATED_BY': "string",.

    "CREATION_DATE': ' 2009-05 - 16 T 08: 42:28"

    'LAST_UPDATED_BY': "string",.

    'LAST_UPDATE_DATE': ' 2003-08 - 08T 20: 18:37 - 04:00 ",".

    "TaskAssignment": [{}

    'ASSIGNMENT_ID': 1000.00.

    'PROJECT_TEAM_MEMBER_ID': 1000.00.

    "START_DATE": "2012-09 - 13 T 09: 00:34 - 04:00", ".

    "END_DATE": "2009-10 - 14 T 03: 16:36."

    'CREATED_BY': "string",.

    'CREATION_DATE': ' 2010-03 - 18 T 12: 05:32.

    'LAST_UPDATED_BY': "string",.

    "LAST_UPDATE_DATE": "2018-12 - 28 T 14: 51:14 - 05:00", ".

    'FAVORITE_FLAG': "string".

    } ]

    } ]

    }

    Please let me know if I missed all the details.

    Waiting for answer!

    Thank you

    Diprish

    Massari,

    Task.Java seems good. The question is: how to create the new instance of task assignment in the UI?

    That's what you do: you must use the create operation standard of the palette of the title of the collection of nested task assignment data control. Thus, enrich the collection of task, the collection taskAssignment nested in the task, expand the node of the operations and drag and drop the operation of creation on your page. This should add the new instance to the collection of the current task task assignment. To make sure that this is the case, set a breakpoint in the addTaskAssignment method in Task.java. Then, when you save the parent task, load useful json must include a table nested with the new task assignment.

    Steven Davelaar,

    Oracle Mobile A-team.

  • How to include child fxml inside fxml parent

    Need help with this problem when I want to include child fxml of different package. I'm able to include child.fxml in parent.fxml, if both are in the same place, but do not know how to add a child.fxml in parent.fxml when both are in the other location/package.

    I am aware of this path (Ex: <children><fx:include source="../../anotherPackage/child.fxml"/></children> ) but I am looking for a solution where I don't have to give a relative path, because the same file child.fxml will be in a location path / different on my system after the deployment target.


    Thanks in advance.



    Relative path, with a leading slash (/) operates according to different fxml under different maven module are in the class path. So for all the child fxml files use the path as xxxx.fxml. It worked for me.

  • Apply criteria to child VO when executing Parent VO

    I use Jdev 11.1.1.3

    I have a Parent VO and VO child with a view that link linked between them.
    I have a Search Page with 4 search parameters, including the Parent VO 2 and 2 of the VO of the child. AM data control, I dropped the VO Parent and the child VO with her 2 different tabular associaed.

    My question is when the user enters the value of the child VO, and then when I run the query on the VO Parent, I want the criteria to apply for the VO of the child.

    I have tried to substitute the executeQueryForCollection in my Parent VO, obtained the viewlink in the VO Parent, then got the Destination (which is my child VO) and set the connection parameters.
    So my Code looks like

    ' public Sub executeQueryForCollection (Object, Object [] params qc,
    int noUserParams)
    {

    ViewLinkImpl viewLinkImpl = null;
    ViewLink UCS [] = this.getViewLinks ();
    String [] vluNames = new String [vlu.length];
    for (int j = 0; j < vlu.length; j ++)
    {
    vluNames [j] is ASI [j] .getName ();.
    If (vluNames [j] .equals ("ViewLinkName"))
    {
    viewLinkImpl = (ViewLinkImpl), ASI [j];
    break;
    }
    }

    ChildVOImpl childVOImpl = viewLinkImpl.getDestination ((ChildVOImpl));

    childVOImpl.setBindXXX ("Value");
    childVOImpl.setBindYYY ("Value");
    super.executeQueryForCollection (qc, params, noUserParams);

    }

    But what happens is that when I run it, I get an exception "parameter Missing IN or OUT to index: 1"because if I print the query for ChildVO, I see. "

    Select * from child Table where FiledName1 =: BindXXX and FieldName2 =: BindYYY and = FieldName3: BindAnotherID

    This BindAnotherId comes from where the Clause attached to the ViewLink.
    I expect the framework so that the value for BindAnotherID, because BindAnotherID is the field that ParentVO and ChildVO are associated.

    Can someone please shed some light on this or if you know a different approach to meet the requirement of the execution of a child VO executing test so VO parent is appreciated. Thanks in advance.

    Hello

    Please, try this link and see if it works, I've created a little demo to replicate your situation, and it seems to work for me. See if you can use this approach. I don't create additional view objects (other than the two objects from view base) and created a sample page.
    I created bind variable during execution and used (the objects in my view has not all bind variables)

    http://rnuka.blogspot.com/2013/03/master-detail-screen-with-search-fields.html

    I hope it's useful for you.

    Thank you
    Delighted Nuka.

    Published by: Nuka delighted March 29, 2013 16:16

  • Responsive HTML5 with mergedprojects, creates a hyperlink to a file in the project html parent to a child html file and it does not work! The child has with the parent TOC, but need to tie. Help, please!

    Hi group!

    I have a brilliant parent project that serves as a springboard for other projects. Users click a component of software they want and are redirected to a page with a list of all the documentation available for this component. Click on the name of a document and access - a lot of PDF files. BUT I also wish they were able to tie the online help for the component. After having read up on the link through / between projects, I knew that I needed to create a parent project (for the page intro and links brilliant) and projects for children (for software components).

    THEN

    I created a parent sensitive HTML5 project and the projects of two children. I compiled the parent to create mergedprojects files, and then open the projects children and collected to the appropriate mergedprojects folder. I then created a hyperlink to the file list html documentation in the project parent towards the child file software component html (output folder and start page [which is the same as the default theme]) and the link does not work! The child and its table of contents appears in the parent TOC so topics are here, but I can't link to them. If necessary, I can send screenshots.

    Where I am dorking this place?

    Thanks in advance for your time and help!

    Scottie 'needs help' gear

    What is your relationship like? And how did you create the link?

    A typical reactive merged help is structured as follows:

    index.htm (Master home page)

    mergedProjects

    childName

    index.htm (starting page for child)

    A child from the index.htm page link would look like this:... /... index.htm

    Kind regards

    Willam

  • Instance of common child VO for several parent your

    Hello

    I use Jdev 11.1.1.6.

    A use case that I thought is common and simple intrigued me. I don't know if I understand.
    Let me explain the case of use here:
    There are 2 entities EM and, where EM is master and EC's child [using association]
    There are 2 views VM1 and VM2 based on entity EM [both views have different set of columns, and show a different set of data based on the WHERE clause]
    There is a view of the common child VC based on entity EC

    There's a viewlink created between VM1 and VC-> Vm1VcVL [based on the entity association]
    Similarly, another created between VM2 and VC-> Vm2VcVL [based on the entity association]

    I exposed VM1 and VM2 on application module
    I exposed VC under VM1 instance using viewlink Vm1VcVL
    then I exposed the same instance of the VC under VM2 using his own viewlink i.e. Vm2VcVL

    Underlying idea using the same instance must create stubborn taskflow that one side of the user interface for VC be reused under taskflows stubborn parent and showing the respective children records based on registration parent.

    When I tested this above configuration AM with ADF BC Tester, it shows even together [child] VC registration for the two viewlinks. It filters the record according to the first master viewlink [Vm1VcVL] only.

    I forgot here?
    Is it supposed to work like this? If Yes, what is the right way to achieve the above use cases.

    Thank you
    JAI

    If I understand well (from your photo :)), you have an af:setPropertyListener and areas on the same page (in the same workflow)?
    So, they use the same pageFlowScope (region of bind parameters use the same pageFlowScope as setPropertyListener - no content within the region).
    When you click the tab, setPropertyListener will set the variable pageFlowScope.viewName that is bound to the BTF input parameter.

    BTF is already activated(I suppose) so you must refresh it.
    You can try to refresh the value = 'if necessary' (activation property instead)
    (doc: ' ifNeeded: refresh the ADF area if the value of a task flow binding parameter is changed. ") If you select this value, do not set a value for the RefreshCondition property in step 4. »)

    Update:
    I just tested this in JDev 11.1.2.3 (a panelTabbed with two tabs and setPropertyListeners and in a region that contains the output text field linked to the input parameter)
    Default refresh settings, region will not refresh (not display anything in outputText component), with refresh = "ifNeeded" this works as expected.

    Dario

    Published by: kdario on 7 November 2012 14:38

    Published by: kdario on 7 November 2012 15:01

  • How to upgrade the parent table and child by updating the parent table

    I have a parent EMPLOYEE table that includes columns (sysid, serviceno, employeename...) sysid is the primary key, serviceno is the Unique key and I have DEPENDENT child table includes columns (sysid, employee_sysid, name, date of birth...) there still SYSID is a primary key for the table of dependants, employee_sysid is a foreign key in the EMPLOYEE table.

    Now I want to change SYSID (with the help of the sequence) in the EMPLOYEE table that they want an update in the table of people dependent

    Note: I have 10000 records in the EMPLOYEE table as I have 5 more children tables that need to update new SYSID.

    Please help me

    first disable FOREIGN KEY constraints.
    You can update Parent and child record with the help of the trigger.
    Here I give you an examlpe... It can help u.

    create a parent (id number primary key, name varchar2 (100)) table
    /
    create table child_1 (primary key id, p_id number number, date of birth, date)
    CONSTRAINT FK_id FOREIGN KEY (p_id) REFERENCES parent (ID))
    /
    create table child_2 (key primary id, p_id2, addr varchar2 number number (1000))
    CONSTRAINT FK_id2 FOREIGN KEY (p_id2) REFERENCES parent (ID))
    /

    Insert some test data for the parent tables and children.

    change the constraint to disable child_2 table FK_id2
    /
    change the constraint to disable child_1 table FK_id2
    /

    CREATE OR REPLACE TRIGGER delete_child
    BEFORE parent UPDATE ON
    FOR EACH LINE
    BEGIN
    UPDATE CHILD_1
    P_ID =:NEW.ID SET
    WHERE P_ID =:OLD.ID;
    UPDATE CHILD_2
    SET = P_ID2: NEW.ID
    WHERE P_ID2 =:OLD.ID;
    END;
    /

    then Upadte parent table primary key col and check the children tables.
    do enable constraints...

  • How can a child navigatorContent access its parent?

    I have 1 mx:ViewStack with 3 children s:NavigatorContent inside.

    Ho can I get access to the child element (NavigatorContent) property SelectedIndex of the parent (ViewStack)?

    I tried event.target.parent.parent.myViewStackid.selectedIndex = 1 but never succeed.

    [using Flash Builder 4beta2]

    Thank you very much

    Hello

    Yes disatching an event is the way to go.  Here's the same example with this extra.

    Heres the Hotel component

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/halo" width = "400" height = "300" >

    protected function editButton_clickHandler(event:MouseEvent):void

    {

    dispatchEvent (new Event ('myButtonClick'));

    }

    ]]>

    [Event (name = "myButtonClick" type = "flash.events.Event")]

    You can see the sent button event handler and event called myButtonClick.  Notice the tag .  This tells the compiler to flex what we call this event and the type of event it is.  Otherwise said, he will expose in mxml and you can listen to it in the main file.

    This is the main file

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    "xmlns:MX ="library://ns.adobe.com/flex/halo"minWidth ="1024"minHeight ="768"xmlns:local =" * ">

    protected function hotelcomp1_myClickHandler(event:Event):void

    {

    viewstack1. SelectedIndex = 0;

    }

    ]]>

    You can see here now in the viewstack in the mxml hotelComp that I have listed for the myButtonClick exactly as I would any other event and it called the hotel1Comp_myClickHandler that defines the index selected to 0.

    Hope that is kind to you.

    Andrew

  • Child simple path to Parent Question

    Hello:
    mainTimeline.myMovieClip_mc
    When myMovieClip_mc comes to its frame 30, I want to trigger a function that belongs to the mainTimeline.
    I expect myMovieClip_mc.parent.myFunction () to work, but it causes an error.
    How to pass the calendar information of the child until the Parent timeline.
    myFunction(); is a trigger in mainTimeline.myMovieClip_mc
    Thank you, M_L_R

    Excellent Joergen N: Hello! Thank you. It works for me M_L_R

Maybe you are looking for