Managing services

Flex Data Services uses Java Management Beans (MBeans) to provide run-time monitoring and management of the services configured in the Flex services configuration file. The run-time monitoring and management console is an example of a Flex client application that provides access to the run-time MBeans. The application calls a Remoting Service destination, which is a Java class that makes calls to the MBeans. The console is in the flex-admin web application; you run it by opening http://server:port/flex-admin when the web application is running, where server:port contains your server and port names.

NOTE

 

The run-time monitoring and management console exposes administrative functionality without authorization checks. You should deploy the flex-admin web application to the same application server that your Flex web application is deployed to, and you should lock down the flex-admin web application by using J2EE security or some other means to protect access to it.

Subtopics

MBean creation and registration
MBean naming conventions
Creating a custom MBean for a custom ServiceAdapter class

MBean creation and registration

The APIs exposed by the run-time MBeans do not affect or interact with the Flex Data Services configuration files. You can use them for operations such as ending a stale connection or monitoring message throttling, but you cannot use them for operations such as registering a new service or altering the settings for an existing server component.

The run-time MBeans are instantiated and registered with the local MBean server by their corresponding managed resource. For example, when a MessageBroker is instantiated, it creates and registers a corresponding MessageBrokerControlMBean with the MBean server. The underlying resource sets the attributes for the run-time MBeans and they are exposed in a read-only manner by the MBean API. In some cases, an MBean can poll its underlying resource for an attribute value.

MBean naming conventions

The run-time MBean model starts at the MessageBrokerControlMBean. You can traverse the model by using attributes on MBeans that reference other MBeans. For example, to access an EndpointControlMBean, you start at the MessageBrokerControlMBean and get the Endpoints attribute. This attribute contains the ObjectNames of all endpoints that are registered with the management broker. This allows any management client to generate a single ObjectName for the root MessageBrokerControlMBean, and from there, navigate to and manage any of the other MBeans in the system without having their ObjectNames.

The run-time MBean model is organized hierarchically, however, each registered Mean in the system has an MBean ObjectName and can be fetched or queried directly if necessary. The run-time MBeans follow ObjectName conventions to simplify registration, lookup, and querying. An ObjectName for an MBean instance is defined as follows:

{domain}:{key}={value}[,{keyN}={valueN}]*

You can provide any number of additional key-value pairs to uniquely identify the MBean instance.

All of the run-time MBeans belong to the flex.run-time domain. If an application name is available, it is also included in the domain as follows: flex.runtime.application-name

Each of the run-time MBean ObjectNames contains the following keys:

Key

Description

type

Short type name of the resource managed by the MBean. The MessageBrokerControlMBean manages the flex.messaging.MessageBroker, so its type is MessageBroker.

id

The id value of the resource managed by the MBean. If no name or id is available on the resource, an id is created according to this strategy:

id = {type} + N

Where N is a numeric increment for instances of this type.

An ObjectName can also contain additional optional keys.

The run-time MBeans are documented in the public Flex Data Services Javadoc documentation. The Javadoc also includes documentation for the flex.management.jmx.MBeanServerGateway class, which the run-time monitoring and management console uses as a Remoting Service destination.


Flex 2

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/2/docs/00001115.html