Hi.
Justin Fujita wrote:
> It sounds like you're looking for Adobe's Data Management feature
> (FDS/LCDS) which was not included in BlazeDS. The functionality of Data
> Management's client-side data synchronization can however be simulated
> using a messaging framework.
Maybe. But it can be done with blazeds.
Here's how -- Data Push:
1. In swf1 create an event that calls a server method using RemoteObject.
2. On the server, do something like this:
package foo;
import flex.messaging.MessageBroker;
import flex.messaging.messages.AsyncMessage;
import flex.messaging.util.UUIDUtils;
public class FooUtils {
public void pushData() {
MessageBroker mb = MessageBroker.getMessageBroker(null);
AsyncMessage am = new AsyncMessage();
am.setDestination("pusher");
am.setMessageId(UUIDUtils.createUUID());
am.setBody("foobar");
mb.routeMessageToService(am, null);
}
}
In messaging-config.xml set the destination:
<destination id="pusher">
<channels>
<channel ref="my-streaming-amf"/>
</channels>
</destination>
3. In swf2 create a consumer:
<mx:Consumer id="consumer" destination="feed"
message="messageHandler(event.message)"/>
4. In swf2 create a handler that handles the push:
private function messageHandler(message:IMessage):void {
trace("You rock");
//do whatever!
}
(-:
Kind regards.
Luke
>
> On Sun, May 18, 2008 at 10:13 PM, Luke Vanderfluit
> <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Hi.
>
> Im using blazeds and a java backend.
> I have a swf that updates stuff on the server and thus in the database.
>
> My question is: Is it possible to have a second swf (using blazeds)
> that will listen for
> or subscribe to changes on a server object and have the server
> object push changes to the
> subscribed object.
>
> IOW. I want to have one swf respond to changes made with a different
> swf.
>
> Thanks.
>
> Kind regards.
> Luke.
>
> --
> Luke Vanderfluit
> Analyst / Web Programmer
> e3Learning.com.au <http://e3Learning.com.au>
> 08 8221 6422
>
>
>
>
> --
> Thanks for reading. -Justin
> Flickr: http://www.flickr.com/photos/neopan/
--
Luke Vanderfluit
Analyst / Web Programmer
e3Learning.com.au
08 8221 6422