120
Chapter 7: Using Flash Remoting for Java
About Flash Remoting for Java
Flash Remoting exposes Java objects as services that are accessible from Flash applications as
ActionScript functions that correspond to Java object methods. A Flash developer writes
ActionScript that uses the ActionScript Service class to connect to a remote Java application
server, get a reference to a service, and invoke the service’s functions.
How Flash Remoting for Java works
To transport messages, Flash Remoting uses a binary message format called Action Message
Format (AMF) delivered over HTTP and modeled on the Simple Object Access Protocol (SOAP)
used in web services implementations. AMF is smaller and faster than standard SOAP, and is
purely asynchronous and event driven. It lets you send a variety of data types, including record
sets, Java objects, primitives such as integers, strings, XML documents, references to EJBObjects,
and dates across the wire. For more information about AMF, see
“Understanding Action Message
Format” on page 64
.
The Flash Remoting gateway is a front controller on the Java application server that handles the
conversion of data types between ActionScript and Java.
When the gateway receives a service request, the request passes through a set of filters that handle
such things as serialization, logging, and security, before arriving at a
service adapter,
which
handles the service and invocation type. Flash Remoting has adapters for JavaBeans, Java classes,
EJBs, JMX MBeans, and server-side ActionScript.
Where Flash Remoting fits into the Java application architecture
A
design pattern
is a solution to a recurring problem. Many design patterns are used in the context
of a model-view-controller architecture, in which you separate data access functionality from the
user interface and control logic that uses that functionality.
In design pattern terminology, a Flash application that uses Flash Remoting is the view portion of
an application, much as a JavaServer Pages (JSP)-based or servlet-based front end is. Macromedia
Flash Player, running in a web browser or in stand-alone mode, is the client in which the view is
rendered. The Flash Remoting gateway is a front controller that translates interactions with the
Flash-based view into actions that server-side Java objects perform.
Using Flash Remoting, you can take advantage of common design patterns and frameworks in
which relational data is mapped to objects such as EJBs, JavaBeans, value objects, JMX MBeans,
or Java collections that are returned to the client.
In addition to using built-in data-type mapping, you can pass any serializable object from Java to
a Flash client. The Java fields of the Java instance, including private fields, are converted to
ActionScript properties on an ActionScript result object; when you work with JavaBeans, this
feature gives you access to JavaBean properties.
Two design patterns, the
value object
and
session facade
patterns, can be particularly useful with
Flash Remoting. Both patterns can reduce the number of remote method calls required in a Flash
application.
Содержание FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT...
Страница 1: ...Using Flash Remoting for Flash MX 2004 ActionScript 2 0...
Страница 8: ...8 Contents...
Страница 62: ...62 Chapter 3 Using the RemotingConnector component Flash Professional only...
Страница 142: ...142 Chapter 7 Using Flash Remoting for Java...