9 Replies Latest reply on Oct 14, 2011 2:39 PM by Brian Richardson

    How to change property of already installed mbean via xml?

    arjan tijms Novice

      I would like to change a property of an mbean that is already installed in JBoss AS 5.1. I could do this programmatically, or I could change this in the JBoss configuration file that installs the bean in the first place.

       

      However, I would like to do this for a single application, not for the whole app server and if possible in an xml file. Is this possible?

       

      For example, I have a login-service.xml file in the root of an ear application, containing this:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
          <mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="foo:service=DynamicLoginConfig">
              <attribute name="AuthConfig">login-config.xml</attribute>
              <depends optional-attribute-name="LoginConfigService">
                  jboss.security:service=XMLLoginConfig
              </depends>
              <depends optional-attribute-name="SecurityManagerService">
                  jboss.security:service=JaasSecurityManager
              </depends>
          </mbean>
      </server>
      

       

      What I want to do is configure the already installed "jboss.security:service=JaasSecurityManager", by setting the DefaultCacheTime to 0.

       

      Of course the following doesn't work:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      
          <mbean code="org.jboss.security.plugins.JaasSecurityManagerService" name="jboss.security:service=JaasSecurityManager">        
              <attribute name="DefaultCacheTimeout">0</attribute>
          </mbean>    
      
          <mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="foo:service=DynamicLoginConfig">
              <attribute name="AuthConfig">login-config.xml</attribute>
              <depends optional-attribute-name="LoginConfigService">
                  jboss.security:service=XMLLoginConfig
              </depends>
              <depends optional-attribute-name="SecurityManagerService">
                  jboss.security:service=JaasSecurityManager
              </depends>
          </mbean>
      </server>
      

       

      In this case, it tries to install "jboss.security:service=JaasSecurityManager" again, but all I want is set a property on the already running instance.

       

      Is there a syntax available to do that?