|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Deprecated. 9.0.0.0 Replaced by standard JMX design patterns in which clients use the javax.management.MBeanServerConnection
interface to discover MBeans, attributes, and attribute types at runtime.
public interface MBeanHome
An interface for accessing the Managed Beans (MBeans) that WebLogic Server uses to expose its management attributes and operations.
Use this interface to retrieve any of the following:
WebLogicMBean
. All MBeans that WebLogic Server provides, except for Security MBeans, extend WebLogicMBean
.
MBean types that you create cannot extend WebLogicMBean
. Therefore, you cannot use this stub to interact with MBeans based on an MBean type that you have created. In addition, the stub is not part of the JMX specification and might not be available on other Java EE application servers.
javax.management.MBeanServer
interface, which is described in a subsequent section of this introduction.RemoteMBeanServer
, which extends the standard JMX javax.management.MBeanServer
and java.rmi.Remote
.To look up the MBeanHome
interface, use the Helper
class. Alternatively, you can use Environment
and javax.naming.Context
to look up this interface from a server instance's JNDI tree.
In a WebLogic Server domain, there are two distinct behaviors for the MBeanHome
interface:
MBeanHome
InterfaceMBeanHome
InterfaceThe Local MBeanHome
Interface
Each server instance in a domain provides a local MBeanHome
interface. You can use this local interface to retrieve a stub for the Runtime MBeans and Local Configuration MBeans that are registered on the server instance. After you retrieve the stub, you can then use it to invoke get
, set
, and other operations on the MBean. For example:
wlMBean = MBeanHome.getMBean(WebLogicObjectName)
wlMBean.getAttribute
wlMBean.setAttribute
wlMBean.operationName
The Administration MBeanHome
Interface
In addition to the local MBeanHome
interface, a domain's Administration Server provides an additional instance of the MBeanHome
interface. This administration MBeanHome
interface provides type-safe access to Administration MBeans, all Local Configuration MBeans for all server instances in the domain, and all Runtime MBeans for all server instances in the domain.
For example, a query for ServerRuntime
MBeans on the administration MBeanHome
returns one ServerRuntime
MBean for each running server in the domain. The same query on the MBeanHome
of a Managed Server (or the local MBeanHome
of the Administration Server) returns only the ServerRuntime
MBean for that server. For the difference between Administration, Local Configuration, and Runtime MBeans, refer to weblogic.management.WebLogicMBean
.
While the administration MBeanHome
provides a convenient single access point for all MBeans in the domain, you must sort through the lookup results to find an MBean for a specific server instance. In addition, it uses RMI to contact MBeans on Managed Servers, which uses more network resources and might take longer than using a local MBeanHome
interface.
The MBeanServer
and RemoteMBeanServer
Interfaces
Instead of using the MBeanHome
interface to retrieve a stub, you can use it to retrieve the MBeanServer
interface, which is the standard JMX interface for interacting with MBeans, or the WebLogic Server RemoteMBeanServer
, which extends MBeanServer
and java.rmi.Remote
. If you invoke MBean operations through these interfaces, you must use standard JMX techniques as described in the JMX API documentation.
The MBeanServer
and RemoteMBeanServer
interfaces on a Managed Server provide access to the Local Configuration MBeans and Runtime MBeans for that server instance. These interfaces on an Administration Server provide access to the Local Configuration MBeans and Runtime MBeans for the Administration Server instance and to all Administration MBeans for the domain. These interfaces on an Administration Server do not provide access to Local Configuration and Runtime MBeans for Managed Servers.
WebLogicMBean
, RemoteMBeanServer
, Helper
Field Summary | |
---|---|
static String |
ADMIN_JNDI_NAME Deprecated. Represents the JNDI name of domain's administration MBeanHome interface. |
static String |
JNDI_NAME Deprecated. Part of a string that represents the JNDI name of a server's local MBeanHome as registered in the Administration Server's JNDI tree. |
static String |
LOCAL_JNDI_NAME Deprecated. Represents the JNDI name of a server's local MBeanHome interface as registered in the server's own JNDI tree. |
Method Summary | |
---|---|
abstract void |
addManagedHome(MBeanHome managedHome, String managedServerName, String managedURL) Deprecated. Adds managed MBeanHome to the admin mbean server. |
abstract WebLogicMBean |
createAdminMBean(String name, String type) Deprecated. Creates an Administration MBean with the specified name and type in the default JMX domain. |
abstract WebLogicMBean |
createAdminMBean(String name, String type, String domain) Deprecated. Creates an Administration MBean with the specified name, type, and domain. |
abstract WebLogicMBean |
createAdminMBean(String name, String type, String domain, ConfigurationMBean parent) Deprecated. Creates an Administration MBean with the name, type, domain, and parent that you specify. |
abstract void |
deleteMBean(ObjectName obj) Deprecated. Delete the MBean matching the specified ObjectName. |
abstract void |
deleteMBean(WebLogicMBean mbean) Deprecated. Delete the specified MBean.. |
abstract DomainMBean |
getActiveDomain() Deprecated. Returns the name of the WebLogic Server domain to which the server that is hosting this MBeanHome instance belongs. |
abstract ConfigurationMBean |
getAdminMBean(String name, String type) Deprecated. Returns a type-safe stub for the Administration MBean in the default JMX domain whose JMX oject name matches the name and type values that you specify. |
abstract ConfigurationMBean |
getAdminMBean(String name, String type, String domain) Deprecated. Returns a type-safe stub for the Administration MBean whose JMX object name matches the name, type, and domain value that you specify. |
abstract Set |
getAllMBeans() Deprecated. Returns a type-safe stub for all MBeans that are in the default JMX domain. |
abstract Set |
getAllMBeans(String domain) Deprecated. Returns a type-safe stub for all MBeans that are in the JMX domain that you specify. |
abstract ConfigurationMBean |
getConfigurationMBean(String name, String type) Deprecated. Returns a type-safe stub for the Local Configuration MBean in the default JMX domain whose JMX object name matches the name and type values that you specify. |
abstract String |
getDomainName() Deprecated. Returns the name of the WebLogic Server domain to which the server that is hosting this MBeanHome instance belongs. |
abstract WebLogicMBean |
getMBean(ObjectName objectName) Deprecated. Returns a type-safe stub for the MBean whose complete JMX object name is contained in the ObjectName that you specify. |
abstract WebLogicMBean |
getMBean(String name, Class cls) Deprecated. Returns a type-safe stub for all MBeans in the default JMX domain that implement the class you specify. |
abstract WebLogicMBean |
getMBean(String name, String type) Deprecated. Returns a type-safe stub for the Administration MBean in the default JMX domain whose JMX object name matches the name and type values that you specify. |
abstract WebLogicMBean |
getMBean(String name, String type, String domain) Deprecated. Returns a type-safe interface for the Administration MBean whose JMX object name matches the name, type, and domain values that you specify. |
abstract WebLogicMBean |
getMBean(String name, String type, String domain, String location) Deprecated. Returns a type-safe interface for the Runtime MBean or Local Configuration MBean whose JMX object name matches the name, type, domain, and location values that you specify. |
abstract Set |
getMBeansByType(String type) Deprecated. Returns a type-safe stub for all MBeans in the default JMX domain that are an instance of a type that you specify. |
abstract RemoteMBeanServer |
getMBeanServer() Deprecated. Returns the MBeanServer interface for the server that hosts this MBeanHome instance. |
abstract RuntimeMBean |
getRuntimeMBean(String name, String type) Deprecated. Returns a type-safe stub for a Runtime MBean in the default JMX domain whose JMX object name matches the name and type values you specify. |
Field Detail |
---|
static final String JNDI_NAME
MBeanHome
as registered in the Administration Server's JNDI tree. The Adminstration Server's JNDI tree registers the local MBeanHome
interface of each server instance in the domain.
To specify the full JNDI name of a local MBeanHome
in the Administration Server's JNDI tree, use JNDI_NAME.<emphasis>relevantServerName</emphasis>
.
static final String LOCAL_JNDI_NAME
MBeanHome
interface as registered in the server's own JNDI tree.
static final String ADMIN_JNDI_NAME
MBeanHome
interface. The administration MBeanHome
is registered only in the JNDI tree of the Administration Server.
Method Detail |
---|
RemoteMBeanServer getMBeanServer()
MBeanServer
interface for the server that hosts this MBeanHome
instance.
For example, if you retrieve the local MBeanHome
interface for a server named MS1, then this method returns the MBeanServer
interface for MS1. If you retrieve the administration MBeanHome
, this method returns the MBeanServer
interface for the the Administration Server.
MBeanServer
interfaceWebLogicMBean getMBean(ObjectName objectName) throws InstanceNotFoundException
ObjectName
that you specify. The ObjectName
value may not contain wildcard characters.objectName
- The javax.management.ObjectName
or WebLogicObjectName
of the MBeanInstanceNotFoundException
WebLogicMBean getMBean(String name, String type, String domain, String location) throws InstanceNotFoundException
WeblogicObjectName
and invokes getMBean(ObjectName)
.name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, for instances of the ServerRuntimeMBean
class, specify ServerRuntime
. For Local Configuration MBeans, append Config
. For example, for Local Configuration instances of the ServerMBean
class, specify ServerConfig
.domain
- The name of the JMX domain. For WebLogicMBean
MBeans, this corresponds to the name of the current WebLogic Server administration domain.location
- The name of the server instance on which the MBean instance resides.InstanceNotFoundException
- If there is no match to the values that you specifyWebLogicMBean getMBean(String name, String type, String domain) throws InstanceNotFoundException
WebLogicObjectName
and invokes the MBeanHome.getMBean(ObjectName)
method.name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the named MBean is an instance. To determine the value for this paramter, remove the MBean suffix from the interface name. For example, for instances of the interface class ServerMBean
, specify Server
as its type.domain
- The name of the JMX domain. For WebLogicMBean
MBeans, this corresponds to the name of the current WebLogic Server administration domain.InstanceNotFoundException
- If there is no match to the values that you specifyWebLogicMBean getMBean(String name, String type) throws InstanceNotFoundException
The default JMX domain is defined as follows:
weblogic
.You can access Administration MBeans only from the domain's administration MBeanHome
interface.
name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the named MBean is an instance. To determine the value for this paramter, remove the MBean
suffix from the interface name. For example, for instances of the interface class ServerMBean
, specify Server
as its type.InstanceNotFoundException
WebLogicMBean getMBean(String name, Class cls) throws InstanceNotFoundException
The default JMX domain is defined as follows:
weblogic
.Searching by class is very inefficient and should be avoided.
name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.cls
- A class nameInstanceNotFoundException
Set getMBeansByType(String type)
The default JMX domain is defined as follows:
weblogic
.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For Local Configuration MBeans, append Config
. For example, for Local Configuration instances of the interface class ServerMBean
, specify ServerConfig
as its type. For Administration instances, specify Server
. For an instance of the ServerRuntimeMBean
class, specify ServerRuntime
.Set getAllMBeans(String domain)
domain
- The name of the JMX domain. For WebLogicMBean
MBeans, this corresponds to the name of the current WebLogic Server administration domain.Set getAllMBeans()
The default JMX domain is defined as follows:
weblogic
.DomainMBean getActiveDomain()
MBeanHome
instance belongs.ConfigurationMBean getAdminMBean(String name, String type, String domain) throws InstanceNotFoundException
MBeanHome
interface.name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, for instances of the interface class ServerMBean
, specify Server
.domain
- The name of the JMX domain. For WebLogicMBean
MBeans, this corresponds to the name of the current WebLogic Server administration domain.InstanceNotFoundException
ConfigurationMBean getAdminMBean(String name, String type) throws InstanceNotFoundException
The default JMX domain is defined as follows:
weblogic
.You can access Administration MBeans only from the domain's Administration MBeanHome
interface.
name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, for instances of the interface class ServerMBean
, specify Server
.InstanceNotFoundException
ConfigurationMBean getConfigurationMBean(String name, String type) throws InstanceNotFoundException
The default JMX domain is defined as follows:
weblogic
.Use this method to retrieve only MBeans that are direct children of DomainMBean. This method does not return MBeans that are below the first level of the MBean hierarchy.
WebLogic Server MBeans exist within a hierarchy that reflects the resources with which they are associated. DomainMBean contains only a few direct children. For example, ClusterMBean, ServerMBean, ApplicationMBean, RealmMBean, and many JDBC and JMS MBeans are direct children of DomainMBean. Most other MBeans are children of these top-level MBeans.
For example, each server instance can contain multiple execute queues. WebLogic Server represents this relationship by making each ExecuteQueueMBean a child of a ServerMBean. While you can use getConfigurationMBean
to retrieve the ServerMBean, you cannot use the method to retrieve ExecuteQueueMBeans.
Instead, the recommended approach for retrieving child Configuration MBeans is as follows:
getConfigurationMBean
) to retrieve the ServerMBean, ClusterMBean, or other top-level MBeans.getExecuteQueues
method that retrieves all child ExecuteQueueMBeans.In some cases, parent MBeans do not provide methods that you can use to retrieve child MBeans. In these cases, use getMBeanByType()
and iterate over the results to find the MBean that matches your criteria.
name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name and append Config
. For example, for Local Configuration instances of the interface class ServerMBean
, specify ServerConfig
.InstanceNotFoundException
MBeanHome.getAdminMBean(java.lang.String, java.lang.String, java.lang.String)
RuntimeMBean getRuntimeMBean(String name, String type) throws InstanceNotFoundException
The default JMX domain is defined as follows:
weblogic
.Use this method to retrieve only MBeans that are direct children of ServerRuntimeMBean. This method does not return MBeans that are below the first level of the MBean hierarchy.
WebLogic Server MBeans exist within a hierarchy that reflects the resources with which they are associated. ServerRuntimeMBean is the root of the runtime hierarchy. It contains only a few direct children. For example, ClusterRuntimeMBean, and many JDBC and JMS MBeans are direct children of ServerRuntimeMBean. Most other MBeans are children of these top-level MBeans.
The recommended approach for retrieving child Runtime MBeans is as follows:
In some cases, parent MBeans do not provide methods that you can use to retrieve child MBeans. In these cases, use getMBeanByType()
and iterate over the results to find the MBean that matches your criteria.
name
- The string that you provided when you created the associated resource. For example, when you create a server, you must provide a name for that server, such as myServer
.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, for an instance of the ServerRuntimeMBean
class, specify ServerRuntime
.InstanceNotFoundException
MBeanHome.getAdminMBean(java.lang.String, java.lang.String, java.lang.String)
WebLogicMBean createAdminMBean(String name, String type, String domain, ConfigurationMBean parent) throws MBeanCreationException
MBeanHome
interface.
With the exception of DomainMBean
, all WebLogic Server MBeans are direct or indirect children of DomainMBean
. Because this parent-child relationship applies to all WebLogic Server MBeans, you do not need to express it.
Other parent-child relationships must be expressed when you create an MBean instance. For example, to create a LogMBean
to manage the local log file of a server instance, you must use this method to specify the server's ServerMBean
Administration MBean. If you do not specify this relationship, this method assumes that you want to create a LogMBean
to manage the domain-wide log file.
name
- A string that uniquely identifies this MBean instance.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, to create an instance of the interface class LogMBean
, specify Log
.domain
- The name of the JMX domain. For WebLogicMBean
MBeans, this corresponds to the name of the current WebLogic Server administration domain.parent
- Specifies the object to which this MBean instance belongs. For example, to create an instance of a server-specific LogMBean
, which configures the server-specific log file, specify the name of the server instance (as defined in ServerMBean
) as the parent.MBeanCreationException
WebLogicMBean createAdminMBean(String name, String type, String domain) throws MBeanCreationException
MBeanHome
interface.name
- A string that uniquely identifies this MBean instance.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, to create an instance of the interface class ServerMBean
, specify Server
.domain
- The name of the JMX domain. For WebLogicMBean
MBeans, this corresponds to the name of the current WebLogic Server administration domain. administration domain.MBeanCreationException
WebLogicMBean createAdminMBean(String name, String type) throws MBeanCreationException
MBeanHome
interface.
The default JMX domain is defined as follows:
weblogic
.name
- A string that uniquely identifies this MBean instance.type
- The interface class of which the MBean is an instance. To determine the value for this parameter, remove the MBean
suffix from the interface name. For example, to create an instance of the interface class ServerMBean
, specify Server
.MBeanCreationException
void addManagedHome(MBeanHome managedHome, String managedServerName, String managedURL)
managedHome
- The feature to be added to the ManagedHome attributemanagedServerName
- The feature to be added to the ManagedHome attributemanagedURL
- The feature to be added to the ManagedHome attributeString getDomainName()
MBeanHome
instance belongs.
If the MBeanHome
is instantiated on a client, this method returns a null value.
void deleteMBean(ObjectName obj) throws InstanceNotFoundException, MBeanRegistrationException
obj
-InstanceNotFoundException
MBeanRegistrationException
void deleteMBean(WebLogicMBean mbean) throws InstanceNotFoundException, MBeanRegistrationException
mbean
-InstanceNotFoundException
MBeanRegistrationException
|
Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |