WebLogic Event Server Administration and Configuration Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Configuring Applications and Servers Dynamically

This section contains information on the following subjects:

 


Overview of Dynamic Configuration

WebLogic Event Server applications define an event processing network (EPN) that is made up of components such as processors, streams, and adapters. You deploy these applications to a WebLogic Event Server instance that has been started in a domain.

Note: Components are also sometimes referred to as stages, in particular in the management Javadocs. However, for consistency with the rest of the WebLogic Event Server documentation, this section uses the term components.

You can dynamically configure each componnent in the EPN using managed beans, or MBeans. You manipulate the MBeans either by using the standard Java Management Extenstion (JMX) APIs or using wlevs.Admin, the WebLogic Event Server administration command-line utility. It is assumed in this section you are going to use JMX; see wlevs.Admin Command-Line Reference for details about using wlevs.Admin.

You can also perform some configuration and application lifecycle management of the server, domain, and deployed applications using MBeans, although this section predominantly describes configuring individual application components. However, because server, domain, and application configuration is also done using MBeans, much of the information in this section is applicable.

Each component in a deployed application (adapter, stream, or processor) has a configuration MBean that manages the underlying configuration of the component. Each type of component has its own set of manageable artifacts. For example, you can dynamically configure the maximum number of threads for a stream or the EPL rules associated with a processor. You can also dynamically enable or disable monitoring for a component.

 


Overview of WebLogic Event Server MBeans

WebLogic Event Server exposes the following types of MBeans:

For full reference information about WebLogic Event Server MBeans, see the following Javadocs:

Configuration MBeans

When you deploy a WebLogic Event Server application, the server automatically creates a configuration MBean for each component in the EPN whose manageability has been enabled, or in other words, for each component registered in the EPN assembly file whose manageable attribute is set to true. If you have extended the configuration of an adapter, then the server deploys a a custom configuration MBean for the adapter.

Using JMX, you can dynamically configure the component using its configuration MBean. For example, using the StreamMBean.setMaxSize() method you can set the size of a stream component. A common configuration method for all components is to enable or disable monitoring; for example, to disable monitoring for an adapter, use the method AdapterMBean.disableMonitoring().

 


MBean Hierarchy and Naming

All MBeans must be registered in an MBean server under an object name of type javax.management.ObjectName. WebLogic Event Server follows a convention in which object names for child MBeans contain part of its parent MBean object name.

Configuration MBean Naming

WebLogic Event Server configuration MBeans are arranged in a hierarchy. The object name of each MBean reflects its position in the hierarchy. A typical object naming pattern is as follows:

    com.bea.wlevs:Name=name,Type=type,[TypeOfParentMBean=NameOfParentMBean]

where:

The order of the key properties is not significant, but the object name must begin with com.bea:wlevs:.

For example, the object name of the MBean corresponding to a processor called myprocessor in the application myapplication is as follows:

    com.bea.wlevs:Name=myprocessor,Type=EPLProcessor,Application=myapplication

The following table describes the key properties that WebLogic Server encodes in its MBean object names.

Table 4-1 WebLogic Event Server MBean Object Name Key Properties
This Key Property
Specifies
Name=name
The string that you provided when you created the resource that the MBean represents. This is typically the name of a component.
The name of a particular component is specified in the EPN assembly file using the id attribute of the component registration.
For example, in the case of processors, the entry in the EPN assembly file might look like the following:

<wlevs:processor id="myprocessor" manageable="true" />

In this case, the key property would be Name=myprocessor.
Type=type
The short name of the MBean's type. The short name is the unqualified type name without the MBean suffix.
For example, for an MBean that is an instance of the EPLProcessorMBean, use EPLProcessor. In this case, the key property would be Type=EPLProcessor.
TypeOfParentMBean=NameOfParentMBean
Specifies the type and name of the parent MBean.
For components, this is always Application=application_name, where application_name refers to the name of the application of which the component is a part.
The name of a particular WebLogic Event Server application is specified with the Bundle-SymbolicName header of the MANIFEST.MF file of the application bundle. For example, if an application has the following MANIFEST.MF snippet (only relevant parts are shown):

Manifest-Version: 1.0
Archiver-Version:
Build-Jdk: 1.5.0_06
....
Bundle-SymbolicName: myapplication

then the key property would be Application=myapplication.

The following table shows examples of configuration MBean objects names that correspond to the component declarations in the HelloWorld sample EPN assembly file. In each example, the application name is helloworld

Table 4-2 Component Declaration Example With Corresponding MBean Object Names
Sample Component Declaration in EPN Assembly File
Corresponding Configuration MBean Object Name
<wlevs:adapter
id="helloworldAdapter"
provider="hellomsgs"
manageable="true">
<wlevs:instance-property
name="message"
value="HelloWorld - the current time is:"/>
</wlevs:adapter>
com.bea.wlevs:Name=helloworldAdapter,Type=HelloworldAdapterConfig,Application=helloworld
HelloworldAdapterConfig is an example of a custom configuration extension MBean. Its manageable property is message.
<wlevs:processor
id="helloworldProcessor"
manageable="true" />
com.bea.wlevs:Name=helloworldProcessor,Type=EPLProcessor,Application=helloworld
EPLProcessor is the standard configuration MBean for processor components. The manageable property is rules.
<wlevs:stream
id="helloworldInstream"
manageable="true">
<wlevs:listener ref="helloworldProcessor"/>
<wlevs:source ref="helloworldAdapter"/>
</wlevs:stream>
com.bea.wlevs:Name=helloworldInstream,Type=Stream,Application=helloworld
Stream is the standard configuration MBean for a stream component. The manageable properties are MaxSize and MaxThreads.

 


Dynamically Configuring a Component Using JMX: Typical Steps

It is assumed in this section that you are going to use the Java Management Extensions (JMX) APIs to manipulate the configuration MBeans; if you want to use wlevs.Admin, see wlevs.Admin Command-Line Reference. Be sure you have read the following sections that describe WebLogic Event Server configuration and runtime MBeans:

To dynamically configure a component of an EPN, follow these steps:

  1. Be sure that the JMX service is configured for your domain. For details see Configuring JMX for WebLogic Event Server.
  2. Be sure that the manageable attribute of the component in the EPN assembly file has been set to true. By default the attribute is false. For example:
  3. <wlevs:processor id="helloworldProcessor" manageable="true" />

    You cannot dynamically change the value of this attribute. In practice this means that, for example, if you have set manageable to true and deployed the application, but then you later want to disable manageability, you must undeploy the application, manually update the EPN assembly file and set manageable to false, then redeploy the application.

  4. Write the JMX Java code to configure the component using the appropriate MBean.
  5. For example, assume you want to configure a processor called helloworldProcessor that is part of the WebLogic Event Server application called myapplication. The following Java code shows how to instantiate an instance of the appropriate MBean (EPLProcessorMBean) and then get a list of all the EPL rules associated with the processor:

    ObjectName eplName =
    ObjectName.getInstance("com.bea.wlevs:Name=helloworldProcessor,Type=EPLProcessor,Application=myapplication");
    EPLProcessorMBean eplMBean = (EPLProcessorMBean)
    MBeanServerInvocationHandler.newProxyInstance(
    mbsc,
    ObjectName.getInstance(eplName),
    EPLProcessorMBean.class,
    true);

    Map rules = eplMBean.getAllRules();

  Back to Top       Previous  Next