Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3496800
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:17:37+00:00 2026-05-18T12:17:37+00:00

So here is the code I have so far: Flex Code <?xml version=1.0 encoding=utf-8?>

  • 0

So here is the code I have so far:

Flex Code

<?xml version="1.0" encoding="utf-8"?>

<fx:Declarations>


    <s:RemoteObject id="getStockPrices" result="result(event)" destination="blazeDsService"
                    endpoint="http://localhost:8400/flexspring/messagebroker/streamingamf"/>

</fx:Declarations>


<mx:DataGrid  x="10" y="295" width="910" height="211" creationComplete="getStockPrices.getQuotes();"
             dataProvider="{getStockPrices.getQuotes.lastResult}" >
    <mx:columns>
        <mx:DataGridColumn headerText="Stock Ticker" dataField="name" />
        <mx:DataGridColumn headerText="Price" dataField="price"/>
        <mx:DataGridColumn headerText="Hi" dataField="col3"/>
        <mx:DataGridColumn headerText="Low" dataField="col4"/>
        <!--<mx:DataGridColumn headerText="Adverage" dataField="col5"/>
        <mx:DataGridColumn headerText="Graph" dataField="col6"/>-->
    </mx:columns>
</mx:DataGrid>


<mx:Button label="Retrieve Stocks" click="retrieveStocks()"/>

And this is the java Class file. This returns and arraylist:

package flex;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingInclude;
import org.springframework.stereotype.Service;

import supportingClasses.StockQuote;

@Service

@RemotingDestination

public class BlazeDsService {

private static final String[] MASTER_LIST = {"C", "FNM", "FRE", "F", "GOOG", "AIG", "CSCO", "MSFT", "AAPL", "YHOO", "BSX", "PORT","F", "TNT", "ESP", "RET", "VBN", "EES"};


@RemotingInclude
public List<StockQuote> getQuotes(){
    List<StockQuote> list = new ArrayList<StockQuote>();
    Random r = new Random();
    for (String s:MASTER_LIST){
        StockQuote sq = new StockQuote();
        sq.setName(s);
        sq.setPrice(r.nextInt(50));
        list.add(sq);
    }
    return list;
}

}

At the minute a button needs to be pressed to refresh the data. I want to get rid of this and poll the information every x seconds. Can this be done?

Do I need to change my set-up? create some publish – subscribe pattern and use Streaming channels?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:17:37+00:00Added an answer on May 18, 2026 at 12:17 pm

    If you just want to call the getQuotes method at every X seconds you can use a timer in Flex, no need for messaging. If you want to be notified when a stock value changed you can use a consumer on the flex side which is subscribed to the same destination where the server is adding messages. You can find a sample doing just that in the BlazeDS samples folder, under traderdesktop folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code I have thus far: import java.io.*; class JAVAFilter implements FilenameFilter
I am playing with XamlPadX and here is the code I have so far:
I have this code here: var infiltrationResult; while(thisOption) { var trNode = document.createElement('tr'); var
We have some old C code here that's built with nmake. Is there an
I have a piece of code here that i really could use some help
See here: http://code.google.com/p/ie7-js/ Does anyone have any experience or remarks about this javascript? Is
Here's my problem - I have some code like this: <mx:Canvas width=300 height=300> <mx:Button
I have got the following code from here to read an Excel file using
Here is a code snippet for an asp:Wizard control I have on an aspx
I have some code where I'm returning an array of objects. Here's a simplified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.