O'Reilly logo

Agile Enterprise Application Development with Flex by Tony Hillerson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Networking Architecture of BlazeDS

BlazeDS provides a clean separation of the networking layer (a servlet container) from the actual implementation of server-side services used by Flex clients. To recap what you learned in Chapter 5, the elements that are communicating on the servlet container level and delivering messages to and from services are called endpoints. If you open the configuration file services-config.xml that comes with BlazeDS, you’ll find declarations of several communication channels, for example:

<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
 <endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>

By adding new or extending existing endpoints, you can add new or extend existing protocols or even expose the low-level networking in the way required by your application. Figure 6-4 depicts the business part of the application as a service that can be accessed via an endpoint of the protocol being used (a BlazeDS implementation of AMF, in our example). Both your application and BlazeDS live inside the servlet container.

Server-side layers

Figure 6-4. Server-side layers

The following sections demonstrate how Farata Systems extended BlazeDS to work with Java nonblocking I/O (NIO) and continuations (suspend/resume mode) offered by the Jetty API.

Setting Up a BlazeDS Sample ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required