WAS v8.5 > Administer applications and their environment > Use the administrative clients > Use administrative programs (JMX)

Administrative programs for multiple Java Platform, Enterprise Edition application servers

We can develop an administrative client to manage multiple vendor application servers through existing MBean support in the WebSphere Application Server.


Existence of MBeans for stopped components

Best practice: The WAS completely implements the Java Platform, Enterprise Edition (Java EE) Management specification. However, some differences in details between the Java EE specification and the WAS implementation are important for you to understand when we access WAS components. These differences are important to you when we access application MBeans because we can use either the WAS programming model or the Java EE programming model.best-practices

In the WAS programming model, if an MBean exists, we can assume that it is running. If an MBean does not exist, we can assume that it is stopped. Transient states between the started state and the stopped state are the same as the stopped state, which means that no MBean exists.

In the Java EE programming model, the MBean always exists regardless of the state of the component.

We can determine the state of a component by querying the state attribute. However, the state attribute only exists for MBeans that are state manageable, meaning they implement the StateManageable interface. State manageable MBeans have start(), startRecursive(), and stop() operations whether these MBeans are Java EE MBeans or WAS MBeans. Additionally, the WAS defines the stateful interface. The stateful interface means the component has a state and emits the Java EE.state.notifications method, but the component cannot directly manage the state. For example, a web module cannot stop itself. However, the application containing the web module can stop it.

Not all MBeans that have a state are state-manageable. Servlets, Java EE modules and enterprise beans, for example, are all stateful, but are not state manageable. The Java EE server is not state-manageable because no start() operation is available on a server.

The J2EEApplication MBean is an example of a state manageable MBean. When the WAS starts, each application activates a J2EEApplication MBean for itself. A J2EEApplication MBean has a Java EE type of J2EEApplication (for example, ObjectName *:*,j2eeType=J2EEApplication). If the application starts, it also activates an Application MBean with a type of Application (for example, *:*,type=Application). When the application changes state, the Application MBean is activated or deactivated. However, the J2EEApplication MBean is always activated. We can retrieve the application state changes by getting the state attribute.

The modules attribute on the J2EEApplication component returns an array of object names, one for every module in the application. The Application Server activates an MBean for each of these modules only after the Application Server starts the application. The managed enterprise bean isRegistered(ObjectName) method returns false if the application, and therefore the module, is not running.

All of the attributes that are defined in the Java EE management specification return valid values when the managed object stops. Other attributes and operations, for example those specifically defined for the Application Server, use the com.ibm.websphere.management.exception.ObjectNotRunningException exception if they are accessed when the object is stopped.

If you install the application while the server runs, the application installs the J2EEApplication MBean when the installation completes. Conversely, when the application uninstalls the J2EEApplication MBean, the application deactivates the MBean.


Map type properties

We can determine which MBeans have a j2eeType property and a WAS type property in their ObjectName property sets by going to the additional application programming interfaces documentation. Select the MBean interfaces subtopic, and then specific MBeans in the list. Look for type= and j2eeType=. We can use the type property to query for any MBeans. MBeans derived from the Java EE specification have an additional j2eeType property as part of their ObjectName property sets. We can also use the j2eeType property to query for MBeans.


Optional WAS interfaces

The EventProvider, StateManageable, and StatisticsProvider interfaces are optional interfaces the Java EE Management specification defines. Which of the interfaces the product implements varies from MBean to MBean. Go to the additional application programming interfaces documentation to see which interfaces the product implements for a particular MBean. Select the MBean interfaces subtopic, and then a specific MBean in the list. Find All Parent MBeans. The interfaces implemented for the MBean follow All Parent MBeans. For example, the J2EEDomain MBean does not implement any of the interfaces, while the JVM MBean implements the StatisticsProvider interface.


Related


Deploy and managing a custom Java administrative client program with multiple Java Platform, Enterprise Edition application servers


Reference:

Additional Application Programming Interfaces (APIs)


+

Search Tips   |   Advanced Search