9.2. The API
BlazeDS exposes a public Java API. You can leverage that API to customize the behavior of BlazeDS resources.
Before you start using the API it's a must that you explore it thoroughly and understand the role of some of its main classes. A good starting point of exploration is a sketch of its key classes and their interrelationships. Figure 9-3 provides such a sketch.
The flex.messaging.services.ServiceAdapter abstract class sits at the root of the hierarchy depicted in Figure 9-3. All built-in adapter classes inherit from the ServiceAdapter abstract class. Abstract classes not only define a contract like interfaces do but also define behavior through partial method implementations. The ServiceAdapter class states the base behavioral characteristics of a BlazeDS adapter.
The ServiceAdapter class extends the ManageableComponent class. The ManageableComponent abstract class implements the Manageable and the FlexComponent interfaces. The Manageable interface allows a server-side BlazeDS component to be managed and controlled by a peer MBean. The FlexComponent interface defines the lifecycle methods that allow you to instantiate, initialize, start, and stop a component.
Figure 9.3. Figure 9-3
Apart from the lifecycle's "start" and "stop" methods, which start and stop an adapter, the ServiceAdapter class defines the following methods:
A getter and setter pair to get and ...
Get Professional BlazeDS: Creating Rich Internet Applications with Flex® and Java® 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.