Managing LCDS FlexSession with ColdFusion8


i trying figure out how manage session flex client connecting lcds/coldfusion instance.  have determined "logic" behind problem, can't figure out how implement using cf8.

 

i'd able track login/logout (browser close) via flexsessionlistener.  here's java class found handle events:

 

-----------------------

 

import flex.messaging.*;


public class sessionwatcher implements flexsessionlistener {


  protected flexsession session;

 

  public sessionwatcher() {

    flexsession.addsessioncreatedlistener(this);

  }

 

  @override

  public void sessioncreated(flexsession session) {

    this.session = session;

    system.out.println("session " + session.getid() + " has been created");

    session.addsessiondestroyedlistener(this);

  }

 

  @override

  public void sessiondestroyed(flexsession session) {

    system.out.println("session " + session.getid() + " has been destroyed");

  }

}

 

 

--------------------------------

 

i've compiled , placed web_inf/classes directory, , have called via createobject("java", "sessionwatcher").

 

however, far i've gotten.  don't understand method in can "merge" existing cfc file called on client login implement this.  here's i've tried:

 

---------------------------------

 

 

listenerclass1 = createobject("java", "sessionwatcher");

 

createobject('java', 'flex.messaging.flexcontext').getflexsession().addsessioncreatedlistener(listenerclass1);

 

createobject('java', 'flex.messaging.flexcontext').getflexsession().addsessiondestroyedlistener(listenerclass1 );

 

 

--------------------------------

 

i'm either not finding "system.out.println" output listener functions when callled, or they're not getting called @ all.

 

 

if has done before, please give me idea on how accomplish this.  however, if can point me in right direction how use java files in cf well.

 

 

thanks in advance,

 

brendan



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support