OK, so I figured out that Feed gets loaded because it's referred to in a remoting destination in remoting-config.xml, and I got my class running the same way.  However, I'm assuming this isn't the right way/place to setup FlexSession listeners and implement push logic via DataServiceTransaction.  Can you point me in the right direction?

Thanks,

Tom

On 7/11/06, Tom Bray <[EMAIL PROTECTED]> wrote:
I'm new to J2EE webapps, so please pardon my ignorance.  When does the Feed class get loaded/instantiated?  Does this happen automatically when the samples server is started?  I'm trying to do something similar in another app but my class doesn't seem to be loading.  I dropped my class in { server.root}/default/flex/WEB-INF/classes/test and was hoping it would magically start running when I restarted the server.  My goal is to figure out how to work with FlexSession and DataServiceTransaction and I figured I'd be able to do that from the class below.  Any help getting it up and running would be greatly appreciated.

//in C:\JRun4\servers\default\flex\WEB-INF\classes\test
package test;

import flex.messaging.FlexSession;
import flex.messaging.FlexSessionListener;
import flex.data.DataServiceTransaction;

public class MyTest implements FlexSessionListener
{
    private static FeedThread thread;
   
    public MyTest()
    {       
        thread = new FeedThread();
        thread.start();       
        FlexSession.addSessionCreatedListener(this);
    }
   
    public void sessionCreated( FlexSession session )
    {
        System.out.println( "sessionDestroyed!" );
    }       
   
    public void sessionDestroyed( FlexSession session )
    {
        System.out.println( "sessionDestroyed!" );
    }
   
    public static class FeedThread extends Thread
    {
        public boolean running = true;

        public void run()
        {
            while (running)
            {
                /*
                DataServiceTransaction dtx = DataServiceTransaction.begin( false );
                dtx.refreshFill( "myDest", new ArrayList() );
                */

                System.out.println( "running!" );
               
                try
                {
                    Thread.sleep(1000);
                }
                catch (InterruptedException e)
                {

                }
            }
        }
    }   

}


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to