messages between the main thread and the FX application thread

I run a thread of the Application of FX for a main thread using Application.launch [described here: {: identifier of the thread = 2530636}]

I try to have the application thread return information on the main thread, but Application.launch returns void. Is there an easy way to communicate between the main thread and the thread of the Application?

So far, I googled and found:
-MOM (Message Oriented Middleware)
-Sockets

Thoughts/ideas/examples are appreciated--especially examples ;)--now I try to use Sockets to show/hide the application and data transmission.

What is the preferred method? Are there others that I did not find (gasp) via Google?

Dave.

Published by: cr0ck3t on April 30, 2013 21:04

Published by: cr0ck3t on April 30, 2013 21:05

Is there an easy way to get a reference to these objects to both the main thread and the thread of Application FX - called via Application.launch () since the main thread? Or what I need to use Sockets or MOM?

Not much to do with the concurrent programming is what I would call easy. It looks easy - but it's not.
You can do kind of what you're describing using Java concurrency constructs without using sockets or a package of Message Oriented Middleware (MOM).
With the Java concurrency stuff you really implement your own form or MOM light.
If you have quite an application is complex with many messages of comes and goes, then a sort of package for MOM such as the camel and ActiveMQ (http://camel.apache.org) is useful.
---------
You can find a sample of the various interactions of thread with JavaFX here:
https://gist.github.com/jewelsea/5500981 "Simulation of dwarf dragons using multiple threads to eat."
Related code is just demo-ware to try different competitive access facilities and not necessarily a recommended strategy.
If your curiosity, you can take a look and try to work out what it is, what it does and how it does.
The main reason followed is that of a blocking queue:
http://docs.Oracle.com/javase/6/docs/API/Java/util/concurrent/BlockingQueue.html
---------
Note that once you call launch of the main thread, no subsequent statement in the main method will be different until the JavaFX application terminates. If you can't start from the main thread and communicate with the main thread JavaFX application. Instead, you need to spawn another thread (or a set of threads) for communication with the JavaFX application.
---------
But really, in most cases, the best solution with the simultaneity is not care at all (or at least as little as possible). Write everything in JavaFX, use the animation of JavaFX framework to time related things and the simultaneity of JavaFX utilities for when you really need multiple interaction of wire.
http://docs.Oracle.com/JavaFX/2/threads/jfxpub-threads.htm
----------
For additional assistance, you may be better off describing exactly (i.e. really specific) what you're trying to make in a new question, perhaps with a solution of the sample in a http://sscce.org NBS

Tags: Java

Similar Questions

  • I changed my email online password and now I can't any message in the Mail application. How to upgrade the application Mail with my new password?

    I changed my gmail online password and now I can't any message in the Mail application. How to upgrade to the Mail application with the new password? I looked at the previous questions, and they were told to go to the preferences, accounts, then enter it in the password section. However, I can't find any password section.

    It would help enormously if you posted the OS you are using. 9.2.1 IOS has nothing to do with your MacBook Pro.

    In Mail, try to go to the window menu and choose connection doctor.

  • the difference between the Web application server and Web server?

    What is the functional difference and the relationship between the Server Web applications and Web server, for example: Weblogic is the Application Web server, IIS is the Web server, Apache is the Web server and Oracle Application Server is the Application Web server? Someone said, Web Application Server is a Web server, but more functional superset, seems in this case, we can also use a server of web applications as a web server. For example, we can use Weblogic, but do not use IIS and Apache, please correct me?

    Published by: user2571802 on February 28, 2010 18:51

    Hello

    Have a read of http://www.javaworld.com/javaqa/2002-08/01-qa-0823-appvswebserver.html if all goes well it should give you a little more understanding.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

    Published by: JohnGoodwin on March 1, 2010 08:17

  • When I click the iconI GET a message that the firefox application cannot be launched 10661

    I click the icon in the dock and I get a message that says that the firefox application cannot be launched 10661

    Firefox 4 requires at least OS X 10.5 and an Intel Mac. There is a third part of Firefox 4 version that works under OS X 10.4/10.5 and PPC Macs, for details, see http://www.floodgap.com/software/tenfourfox

    If you prefer, you can get the latest version of Firefox 3.6 http://www.mozilla.com/en-US/firefox/all-older.html

    Mozilla is working to keep Mac users with non-compliant systems to enter the notification on Firefox 4 and also do not display the button 'Download Firefox 4' on http://www.mozilla.com

  • I get a message from the Adobe Application Manager that keeps me from download.

    I am getting an Adobe Application Manager in 'Please close the following applications to continue - ShelllExtLoader '.   I read in the forum where there is the possibility to download manually by selecting 'download replacing '.   I don't see that option anywhere.  Help.  If not, how can I get the app to download?

    Chris

    The Task Manager / Activity Monitor---> mentioned--> Select process--> process--> right click end process.

    Mylenium

  • Hello, I get the beginning of the muse of adobe are the error message that the adobe application manager is damaged or not installed now, I downloaded 2 times and installed the problem persists, however, can me someone here with a rat page

    Hello

    I get the beginning of the muse of adobe, the error that the application manager adobe is damaged or not installed

    Now, I downloaded 2 times and installed the problem remains, however

    can someone here with rat page

    Kindly try to remove Adobe Application Manager to help cleaning tool and remove CC help | Uninstall the creative desktop application Cloud can download and install Adobe Creative Cloud apps.

  • After installing firefox 8 Mobile on Galaxy Ace android 2.3.4; run and a message appeard: the firefox application has stopped unexpectedly. Please try again. How can I solve this problem?

    a problem by running firefox on android 2.3.4

    Firefox does not work on a Galaxy Ace due to the unit having only ARMv6 in favor. Firefox needs to devices that support ARMv7.

  • BlackBerry Smartphones not receive messages from the Facebook Application

    Hello

    I do not receive messages sent to me on Facebook for my Facebook for blackberry application Inbox

    1. I uninstalled and reinstalled the application.

    2. I have searched the site, but had no luck so far.

    3. I tried to change my e-mail where I get my notifications.

    4. I have not found many other users on this forum similar problem.

    Help, please!

    Thank you

    Rohan.

    Somehow, it seems that the problem was occurring when I got my hotmail account set up to receive facebook notifications and my hotmail account configured to deliver messages to my "BOLD".

    When I associated with my gmail acc facebook for what email setup for blackberry has been done already, it seems to work properly since.

    Thanks for the reply.

    Rohan.

  • Is there a way to display a check box next to each message for moving or deleting more of 1 message at the same time?

    (Now Qwest) mail the Embarqs Web site has an empty square next to each message to make it easier to sort and delete several messages at once, instead of move or delete them one at a time. Thunderbird does have the same or a similar option, if so, how do I activate, or display it?

    Thank you
    Tom S.

    Simply, you highlight messages using the standard Windows selection keys. (I assume you are using Windows).

    To select adjacent messages, select one by clicking on it. Scroll to the last message you want to select, and then click SHIFT-key. All messages between the two will be selected.

    To select non-contiguous messages. Click on each one while pressing the CONTROL (CTRL) key.

    Once the messages are highlighted, you can use most of the operations (such as delete or move) on the lot.

  • I was stuck in a group conversation, then unblocked, and I don't see messages between these periods.

    I was in a discussion group, then I was blocked. My friend, who was still on the cat, told me about what was going on in the chat, and when she was able to add me again, I've ever seen all the messages between the point where I was blocked when I was added again. Is my Skype won't load does not, or is it something 'nobody blocked "?

    It's a thing of blocked person, you will not see these messages, even now that you're unblocked.

  • Synchronize photos between desktop PC, Tablet and mobile devices

    Hi, I can't understand how works mobile sync, hope that someone would want to guide me.

    My goal is to have a subset of my photos are synchronized between desktop PC (MAC OS x running full LR CC), smartphone (mobile LR) and my Tablet (10 Windows running full LR CC).

    I managed to set up a Collection on my desktop PC that synchronizes with Mobile - for example, this collection is where I have some photos that relate to share between my devices. For example my smart phone can see these photos and I can also add photos to the collection of my smart phone that appears on the desktop.

    However, when you run the LR tablet, I can't get the same link. For example when I activate sync he wants to delete my existing association of the lightroom file and delete all the photos in the cloud. Mobile synchronization does not work between complete lightroom different instances or am I doing wrong?

    And if not possible, is there as another way of synchronization necessary here I can ask that only a subset of my photos (my Tablet cannot hold my complete database of photos)? I looked at the area of the creative cloud but it seems to be the manual copy area and I don't break my photos out (or duplicate physically) in different physical locations on the hard drive of my desktop PC? 

    Thanks in advance!

    Hi K0LDING,

    The synchronization between a main catalog and several mobile versions.

    This could be a problem if you have the full Lighroom program installed on your Tablet and you try to synchronize an another catalog outside of your PC and according to the message, which allows to synchronize would remove the previous synchronized data.

    You can install Lightroom Mobile on your Tablet and synchronization through that.

    Kind regards

    Claes

  • ImageView image created in stage Builder 2.0 does not appear in the running application

    I use scene Builder 2.0 and have added an ImageView to the parent AnchorPane.  I added my PNG files for the application icon and the different buttons. I select the ImageView in stage Builder can analyze the file system in the package of the project folder and select the PNG for the Image.  Rated image in the Imageview in the generator from the scene in design mode and preview mode.

    While everything appears correctly when the application is run, the image assigned to the ImageView is not displayed.

    From the FXML file:

    < ImageView fx:id = "ivBRULogo" fitHeight = "64.0" fitWidth "64.0" layoutX = '14.0' = on = "14.0" pickOnBounds = "true" preserveRatio = "true" AnchorPane.leftAnchor = "14.0" AnchorPane.topAnchor ="14.0" > "

    < image >

    "< image url="@BRU_PE_B_64.png "/ >

    < / image >

    < / ImageView >

    Does anyone have an idea of what might happen between the compiled application and what scene Builder generates?

    Thank you

    Tim

    I recreated the project in Netbeans and copied the Mac files in the src folder.  I opened the FXML in stage Builder and everything looked good.

    Then I built the copied files and voila! The app seems correct with all images and colors of text (another oddity) on Windows 7.

    There must be something weird happening between the stage Builder and Netbeans in Windows 7.

  • Problem link DB between active Data Guard and reports application database

    My version of the 11.2.0.2.0 and OS database is Oracle Solaris 10 9/10.
    I am facing a problem in my custody of data Active data base for purposes of tax. Active Data guard information is as below.

    SQL > select name, database_role, open_mode from v$ database;

    NAME DATABASE_ROLE OPEN_MODE
    --------- ---------------- --------------------
    ORCL PHYSICS READ SHALL ONLY APPLY

    Detail of the problem is less than
    ------------------------------
    I have created a db link (name: DATADB_LINK) between active data guard and report of application of data base for purposes of tax.
    SQL > create database DATADB_LINK link to connect to HR identified by HR using 'DRFUNPD ';
    Database link created.

    But when I run a query using db link to my database of enforcement report I got this error below.

    ORA-01555: snapshot too old: rollback segment number 10 with the name ' _SYSSMU10_4261549777$ ' too small
    ORA-02063: preceding the line of DATADB_LINK

    Then I see logfile named database alart Active Data Guard and get below error

    ORA-01555 caused by the following SQL statement (SQL ID: 11yj3pucjguc8, time of request = 1 sec, SNA: 0x0000.07c708c3): SELECT "A2". "' BUSINESS_TRANSACTION_REFERENCE ', 'A2 '. "' BUSINESS_TRANSACTION_CODE ', MAX (CASE 'A1'. "TRANS_DATA_KEY"WHEN "feature' AND 'A1'." " END OF TRANS_DATA_VALUE"), MAX (CASE 'A1'. "TRANS_DATA_KEY" WHEN 'otherFeature' THEN 'A1' '. "" END OF TRANS_DATA_VALUE")

    But the interesting point if I run the query report directly in the Active Data Guard database, I got never error.

    So it's a problem of link DB between active Data Guard and other databases?

    Fazlul Kabir Mahfuz wrote:
    My version of the 11.2.0.2.0 and OS database is Oracle Solaris 10 9/10.
    I am facing a problem in my custody of data Active data base for purposes of tax. Active Data guard information is as below.

    SQL > select name, database_role, open_mode from v$ database;

    NAME DATABASE_ROLE OPEN_MODE
    --------- ---------------- --------------------
    ORCL PHYSICS READ SHALL ONLY APPLY

    Detail of the problem is less than
    ------------------------------
    I have created a db link (name: DATADB_LINK) between active data guard and report of application of data base for purposes of tax.
    SQL > create database DATADB_LINK link to connect to HR identified by HR using 'DRFUNPD ';
    Database link created.

    But when I run a query using db link to my database of enforcement report I got this error below.

    ORA-01555: snapshot too old: rollback segment number 10 with the name ' _SYSSMU10_4261549777$ ' too small
    ORA-02063: preceding the line of DATADB_LINK

    Then I see logfile named database alart Active Data Guard and get below error

    ORA-01555 caused by the following SQL statement (SQL ID: 11yj3pucjguc8, time of request = 1 sec, SNA: 0x0000.07c708c3): SELECT "A2". "' BUSINESS_TRANSACTION_REFERENCE ', 'A2 '. "' BUSINESS_TRANSACTION_CODE ', MAX (CASE 'A1'. "TRANS_DATA_KEY"WHEN "feature' AND 'A1'." " END OF TRANS_DATA_VALUE"), MAX (CASE 'A1'. "TRANS_DATA_KEY" WHEN 'otherFeature' THEN 'A1' '. "" END OF TRANS_DATA_VALUE")

    But the interesting point if I run the query report directly in the Active Data Guard database, I got never error.

    So it's a problem of link DB between active Data Guard and other databases?

    Check this statement that applies to your environment

    * ORA-01555 on Active Data Guard Standby Database [1273808.1 ID] *.

    also

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:8908307196113

  • Difference between the message and conversation

    What is the technical difference between a message and a conversation. Is that when multiple messages are in 1 conversation?

    A message.
    An email received or sent is a message.

    A conversation can be launched with a message.
    A conversaion can have messages, screw where the example: the 'Reply' button was used and enamel is spent here and there with the comments.

    If you select multiple messages in a list, they will be displayed below in the Message pane in the form xx number of conversatons.

    If you right-click on a message in the list and choose "open in a conversation." then it will open in a new tab showing all the emails included threaded, which are relevant to that conversation, both received emails and those you sent.

  • Exchange of data between the main VI and sub - VI

    It is my first attempt to build a comprehensive program and hope you can help me.

    The idea is to load a set of data and to perform several calculations and operations on them, find themselves in the creation of a report file.

    What I want to do is to build a main VI which contains the data, and several sub - vi to do the math, dynamically loaded in a subgroup of experts (for the simple user interface). I thought about this architecture because I'm sure I'll have to change the calculation of VI, and I don't know how I'm going to need, so I can just add an another calc VI to the plugin dir and load it. The thing is, I have to keep moving data back from the main VI to the Subvi and maybe even between sub - vi. Is there an easy (or not so hard) how? I thought about queues, but sometimes the data is to be sent to more than a subvi, and I can't have a queue for each. The idea that I get is like a network producer-consumer mode BOX: the main VI produce some data and all those interested in this data use. Then they send the results back (as a "producer") and all stakeholders in the response it consumes.

    Attached, is a "skeleton" of what I intend to do.

    There are several ways you can accomplish this. First of all, you can use the Start Asychronous Call, which will provide a component of connector for you. So, it is easy to wire the reference to it. You could also implement a global functional (also known as a motor of action) to access the event reference. It is the approach we use for our shared events. If you have lines between the main VI and ths Subvi you to format a particular message reference. However, I don't think that this approach would correspond to what you are doing.

Maybe you are looking for