WebLogic は、ランタイム MBean サーバーに JNDI 名検索を提供しています。
この規則は、WebLogic MBean サーバーの JNDI 名 java:comp/env/jmx/runtime を含むすべてのストリング・リテラルをスキャンします。
例えば、この規則により、以下の例の JNDI 名にフラグを立てます。
|
import javax.management.MBeanServer; import javax.naming.InitialContext; InitialContext ctx = new InitialContext(); MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime"); |
アプリケーションが MBean サーバーに JNDI 名検索を使用している場合、javax.management.MBeanFactory API を使用して MBeanServer へのアクセスやカスタム MBean の管理を行うように、アプリケーションを変更します。コードが WebLogic 提供の MBean にアクセスする場合、WebSphere Application Server によって提供される同様の機能にマイグレーションします。
WebSphere Application Server traditional で実行するアプリケーションの場合、AdminServiceFactory クラスを使用して MBean サーバーにアクセスできます。
|
import javax.management.MBeanServer; import com.ibm.websphere.management.AdminServiceFactory; MBeanServer server = AdminServiceFactory.getMBeanFactory().getMBeanServer(); |
詳しくは、以下を参照してください。