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 ...

Get Agile Enterprise Application Development with Flex now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.