Flylib.com

Books Software

 
 
 

6.7 Wrapping Up


6.7 Wrapping Up

In this chapter, you learned about ActionScript's cousin ”Server-Side ActionScript. You learned that SSAS is in reality an implementation of JavaScript that is also scriptable with Java, making it a highly customizable language. Also in this chapter, several missing features were added using Java, including the ability to read directories and files on the server and the ability to send and retrieve emails. In addition, the limitations of the SSAS implementation for JRun were shown.

Chapter 7 focuses on the Java language and the J2EE implementation of Flash Remoting.


Chapter 7. Flash Remoting and Java

Flash Remoting for J2EE (Java 2 Enterprise Edition) allows Flash clients to communicate efficiently with Enterprise Java applications running on the server. J2EE is a collection of core Java features plus standard application programming interfaces (APIs) for enterprise-level services such as messaging, naming, and remote components . This chapter discusses the details of using Flash Remoting with Java applications. It assumes that you are familiar with writing Flash Remoting clients as covered in earlier chapters and with web application development in Java application servers that support the Servlet 2.2 or 2.3 specifications. If you are not schooled in Java and have trouble following the examples in this chapter, consult the resources cited in Appendix B.

Flash Remoting for J2EE must be purchased separately from Macromedia, although a trial version is available. For an open source implementation, refer to Section 7.13 at the end of this chapter.


7.1 The Flash Remoting Gateway

Flash Remoting for J2EE is essentially a servlet that uses Java introspection , also called reflection , to invoke methods on objects running in a Java application server. This servlet and its supporting classes are collectively named the Flash Remoting gateway . Combined with the client-side Flash Remoting components , Flash Remoting for J2EE gives Flash clients a simple object-oriented interface to locate Java objects as services, call methods on them, and handle the results.

It is worth noting that the implementation of Flash Remoting for J2EE is the same implementation that supports Flash Remoting for ColdFusion. Flash Remoting for ColdFusion includes the additional service types of ColdFusion pages, ColdFusion Components, and web services, but the core gateway implementation is the same. Much of the discussion in this chapter concerning the internal behavior of the gateway also applies to Flash Remoting for ColdFusion.


7.2 Supported Platforms

Any application running on a Java application server that supports the Servlet 2.2 or 2.3 specifications can use Flash Remoting to provide services to Flash clients .

Macromedia explicitly supports JRun 4.0, IBM WebSphere Application Server 4, BEA WebLogic, and Sun ONE Web Server. The Remoting gateway determines the application server platform by looking for known classes in its classpath , a list of locations in which to look for Java classes and other resources. For Sun ONE Web Server, Flash Remoting does not support Enterprise JavaBean (EJB) services. For IBM WebSphere and BEA WebLogic, Remoting supports the standard service types described later in this chapter.

Flash Remoting supports several additional features on JRun. The user credentials specified using NetConnection.setCredentials( ) are used to define the user and user role in Container-Managed Security , the J2EE standard way of authenticating and authorizing users, and for access to EJBs. Flash Remoting can be used to give Flash clients access to JRun's JMX MBeans. Finally, Flash Remoting writes its log messages using JRun's logging infrastructure.

Flash Remoting also runs correctly on numerous other J2EE application servers, including Caucho Resin, Tomcat, JBoss, ATG Dynamo, Oracle 9i AS, and HP Application Server. However, do not take this list as complete. The next section describes how to set up Flash Remoting for these and other application servers so you can try additional platforms yourself.