3 Replies Latest reply: Jul 6, 2012 4:21 AM by Thomas Diesler RSS

    Access Config Admin Data from EJB

    Matthew Meyer Newbie

      I'm tempted by the Configuration Admin Data section of the jbossAS 7 mgmt console (http://localhost:9990/console/App.html#configadmin). It implies that I could invent my own PID, store some name value pairs and then....access them from my own bean???

       

      That is, not necessarily an osgi service of my own, but rather say an EJB and be able to do something like...

       

      ServiceReference sref = bundlecontext.getServiceReference(ConfiguredService.class.getName());

      ConfiguredService service = (ConfiguredService) bundlecontext.getService(sref);

      String myVal = service.getValue("foo"));

       

      as is implied by the ConfigurationAdminTestCase at https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/osgi/configadmin/ConfigurationAdminTestCase.java

       

      I used the mgmt console to invent a PID name and added some values.

       

      I have managed to inject a BundleContext into my EJB and can use it to query for ServiceReferences but cant seem to find a way to get at the actual PID I created.

       

      Is this something that should be possible?

        • 1. Re: Access Config Admin Data from EJB
          David Bosschaert Expert

          Hi Matthew,

           

          The best way to access Config Admin configuration is through a callback object as the configuration is likely set asynchronously and can also be updated asynchronously. The OSGi ConfigAdmin spec (chapter 104 in the OSGi Enterprise 4.2 spec) describes a number of ways to access the configuration information, but using a ManagedService implementation is probably the easiest. I've attached a test bundle (ConfiguredBundle.jar) that shows how to do this:

           

          The ManagedService implementation is called back when the configuration is set or changed:

          import org.osgi.service.cm.*;
          
          public class ConfigurationCallback implements ManagedService {
              public void updated(Dictionary properties) throws ConfigurationException {
                  System.out.println("*** Configuration provided: " + properties);
              }
          }

           

          Then you register the ManagedService implementation with the OSGi Service Registry under the PID that you want to listen to. In my case I do that in the Activator, but you can do that with your bundleContext that you obtained in your EJB too. Here I register the ManagedService with the PID called 'a.pid':

          import org.osgi.framework.*;
          import org.osgi.service.cm.ManagedService;
          
          public class Activator implements BundleActivator {
            private ServiceRegistration<?> reg;
          
            public void start(BundleContext bundleContext) throws Exception {
              Dictionary<String, Object> props = new Hashtable<String, Object>();
              props.put(Constants.SERVICE_PID, "a.pid");
              reg = bundleContext.registerService(ManagedService.class.getName(),
                new ConfigurationCallback(), props);
            }
          
            public void stop(BundleContext bundleContext) throws Exception {
              reg.unregister();
            }
          }

           

          Deploy and start the bundle in AS7 to see it working, for example through the CLI:

          $ bin/jboss-cli.sh -c
          [standalone@localhost:9999 /] deploy /...somelocation.../ConfiguredBundle_1.0.0.jar
          [standalone@localhost:9999 /] /subsystem=osgi/bundle=ConfiguredBundle_1.0.0.jar:start
          {"outcome" => "success"}

           

           

          Now you can set the configuration value through the console:

          configadmin.png

          At this point you will see that the ManagedService receives its configuration callback, in the AS7 console:

          14:42:31,826 INFO  [stdout] (CM Configuration Updater (Update: pid=a.pid))
          *** Configuration provided: {service.pid=a.pid, .org.jboss.source=fromdmr, key2=value2, key1=value1}

           

          I just tried this on AS 7.1.2, which is currently only available if you build it yourself. I think on previous versions you may need to restart the server before the configuration takes effect.

           

          Note that the set configuration is persistent and can be found in the standalone.xml:

                  <subsystem xmlns="urn:jboss:domain:configadmin:1.0">
                      <configuration pid="a.pid">
                          <property name="key1" value="value1"/>
                          <property name="key2" value="value2"/>
                      </configuration>
                  </subsystem>

           

          I just noticed that after restart the configuration information isn't passed to the bundle on restart, I've filed bug AS7-4893 for that and will look at fixing that soon.

           

          Also note that the ConfiguredBundle that is attached to this posting contains its source code, if you want to dive a bit deeper.

          • 2. Re: Access Config Admin Data from EJB
            Vlad Craciunoiu Newbie

            Hi,

             

            We want to build an application which accesses the JBoss metrics (jvm, datasources, queues..). The application will be deployed in JBoss, so we would like to access the metrics from within, not using the management API but directly the core management system. Is this possible ? Maybe with ModelControllerImpl.java, but how ?

             

            Best regards,

            Vlad

            • 3. Re: Access Config Admin Data from EJB
              Thomas Diesler Master

              This question is unrelated to this ConfigAdmin centric thread. Please take this to the AS7 forum.

              Our testsuite has a number of tests that show how to use the domain model API from a server component

               

              Here is a starting point

               

              [tdiesler@tdvaio jboss-as]$ cd testsuite/
              [tdiesler@tdvaio testsuite]$ git grep ModelControllerClient
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainControllerClientConfig.java:import org.jboss.as.controller.client.ModelControl
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainControllerClientConfig.java: * Shared test configuration where all {@linkplain
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestClient.java:import org.jboss.as.controller.client.impl.AbstractModelContro
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestClient.java:abstract class DomainTestClient extends AbstractModelControlle
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:    public static ModelNode executeForResult(final ModelNode op
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:    public static void waitUntilState(final ModelControllerClie
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:    public static void waitUntilState(final ModelControllerClie
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:    public static void waitUntilState(final ModelControllerClie
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:    public static String getServerState(final ModelControllerCl
              domain/src/test/java/org/jboss/as/test/integration/domain/management/util/DomainTestUtils.java:    public static boolean checkState(final ModelControllerClien
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ExtensionManagementTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ExtensionManagementTestCase.java:    private void extensionVersionTest(ModelControllerClient 
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ExtensionManagementTestCase.java:    private void extensionRemovalTest(ModelControllerClient 
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ExtensionManagementTestCase.java:    private static ModelNode executeForResult(final ModelNod
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/IgnoredResourcesTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/IgnoredResourcesTestCase.java:    private ModelNode executeOperation(final ModelNode op, fina
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ManagementReadsTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ManagementReadsTestCase.java:    private void resolveExpressionOnSlaveHostTest(ModelControlle
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ManagementVersionTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ManagementVersionTestCase.java:    private void rootResourceTest(String address, ModelControl
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ManagementVersionTestCase.java:    private void extensionsTest(String address, ModelControlle
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ManagementVersionTestCase.java:    private ModelNode executeOperation(final ModelNode op, fin
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:    private void executeLifecycleOperation(final ModelControlle
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:    private void executeLifecycleOperation(final ModelControlle
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:    private ModelNode executeForResult(final ModelControllerCli
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:    private boolean exists(final ModelControllerClient client, 
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:    private void resetServerToExpectedState(final ModelControll
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerManagementTestCase.java:    private static void waitForHost(final ModelControllerClient
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerRestartRequiredTestCase.java:import org.jboss.as.controller.client.ModelControllerClien
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerRestartRequiredTestCase.java:    private ModelNode getServerState(final ModelNode addre
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ServerRestartRequiredTestCase.java:    private ModelNode executeOperation(final ModelNode op,
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ValidateOperationOperationTestCase.java:import org.jboss.as.controller.client.ModelController
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ValidateOperationOperationTestCase.java:    private static ModelControllerClient client;
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ValidateOperationOperationTestCase.java:        client = ModelControllerClient.Factory.create
              domain/src/test/java/org/jboss/as/test/integration/domain/suites/ValidateOperationOperationTestCase.java:    protected ModelControllerClient getModelControlle
              domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java:        final ModelControllerClient client = ModelControllerClient.Factory.cre
              domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java:        final ModelControllerClient client = ModelControllerClient.Factory.cre
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/mdb/containerstart/SendMessagesTestCase.java:import org.jboss.as.controller.client.ModelCont
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/mdb/containerstart/SendMessagesTestCase.java:    public static void applyUpdate(ModelNode up
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:import org.jboss.as.controller.client.ModelControllerCl
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:        final ModelControllerClient modelControllerClie
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:        final ModelControllerClient modelControllerClie
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    public static void createLocalOutboundSocket(final 
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    public static void removeLocalOutboundSocket(final 
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    public static void createRemoteOutboundConnection(f
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    public static void removeRemoteOutboundConnection(f
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    public static void createStrictMaxPool(final ModelC
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    public static void removeStrictMaxPool(final ModelC
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:        final ModelControllerClient modelControllerClie
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:        final ModelControllerClient modelControllerClie
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    private static ModelControllerClient getModelContro
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:            return ModelControllerClient.Factory.create
              integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/common/EJBManagementUtil.java:    private static ModelNode execute(final ModelControl
              integration/basic/src/test/java/org/jboss/as/test/integration/extension/remove/ExtensionRemoveTestCase.java:import org.jboss.as.controller.client.ModelControl
              integration/basic/src/test/java/org/jboss/as/test/integration/extension/remove/ExtensionRemoveTestCase.java:        ModelControllerClient client = managementC
              integration/basic/src/test/java/org/jboss/as/test/integration/extension/remove/ExtensionRemoveTestCase.java:    private ModelNode executeOperation(ModelContro
              integration/basic/src/test/java/org/jboss/as/test/integration/extension/remove/ExtensionRemoveTestCase.java:    private ModelNode readResourceDescription(Mode
              integration/basic/src/test/java/org/jboss/as/test/integration/extension/remove/ExtensionRemoveTestCase.java:    private ModelNode readResource(ModelController
              integration/basic/src/test/java/org/jboss/as/test/integration/jca/JcaMgmtBase.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/basic/src/test/java/org/jboss/as/test/integration/jca/security/DsWithSecurityDomainTestCase.java:import org.jboss.as.controller.client.ModelContro
              integration/basic/src/test/java/org/jboss/as/test/integration/jmx/ModelControllerMBeanTestCase.java:import org.jboss.as.controller.client.ModelControllerClien
              integration/basic/src/test/java/org/jboss/as/test/integration/jmx/ModelControllerMBeanTestCase.java:    static ModelControllerClient client;
              integration/basic/src/test/java/org/jboss/as/test/integration/jmx/ModelControllerMBeanTestCase.java:        client = ModelControllerClient.Factory.create("loc
              integration/basic/src/test/java/org/jboss/as/test/integration/jmx/ModelControllerMBeanTestCase.java:    private static void enableJMXConnector(ModelController
              integration/basic/src/test/java/org/jboss/as/test/integration/jmx/ModelControllerMBeanTestCase.java:    private static void disableJMXConnector(ModelControlle
              integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/JMSTopicManagementTestCase.java:import org.jboss.as.controller.client.ModelContro
              integration/basic/src/test/java/org/jboss/as/test/integration/messaging/mgmt/JMSTopicManagementTestCase.java:   static void applyUpdate(ModelNode update, fina
              integration/basic/src/test/java/org/jboss/as/test/integration/messaging/security/SecurityTestCase.java:import org.jboss.as.controller.client.ModelControllerCl
              integration/basic/src/test/java/org/jboss/as/test/integration/messaging/security/SecurityTestCase.java:    static void applyUpdate(ModelNode update, final Mod
              integration/basic/src/test/java/org/jboss/as/test/integration/osgi/configadmin/ConfigAdminManagementTestCase.java:import org.jboss.as.controller.client.ModelC
              integration/basic/src/test/java/org/jboss/as/test/integration/osgi/configadmin/ConfigAdminManagementTestCase.java:    private ModelControllerClient getControl
              integration/basic/src/test/java/org/jboss/as/test/integration/osgi/management/OSGiManagementTestCase.java:import org.jboss.as.controller.client.ModelControlle
              integration/basic/src/test/java/org/jboss/as/test/integration/osgi/management/OSGiManagementTestCase.java:    private ModelControllerClient getControllerClien
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/AbstractSecurityDomainSetup.java:import org.jboss.as.controller.client.ModelCont
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/AbstractSecurityDomainSetup.java:    protected static void applyUpdates(final Mo
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/AbstractSecurityDomainSetup.java:    protected static void applyUpdate(final Mod
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/AbstractSecurityDomainSetup.java:    protected void createSecurityDomain(final C
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/Utils.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/Utils.java:   public static void applyUpdates(final List<ModelNode> updates, fin
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/Utils.java:    public static void applyUpdate(ModelNode update, final ModelContr
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/Utils.java:   public static void removeSecurityDomain(final ModelControllerClien
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/Utils.java:   public static ModelControllerClient getModelControllerClient() thr
              integration/basic/src/test/java/org/jboss/as/test/integration/security/common/Utils.java:      return ModelControllerClient.Factory.create(InetAddress.getByNa
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/DMRSecurityTestCase.java:import org.jboss.as.controller.client.ModelControlle
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/DMRSecurityTestCase.java:        ModelControllerClient modelControllerClient 
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/WebConsoleSecurityTestCase.java:import org.jboss.as.controller.client.ModelCo
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/WebConsoleSecurityTestCase.java:      private URI getBinding(final String pro
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/WebConsoleSecurityTestCase.java:            //TODO: resolve socket binding gr
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/WebConsoleSecurityTestCase.java:      private ModelNode executeForResult(fina
              integration/basic/src/test/java/org/jboss/as/test/integration/security/perimeter/WebConsoleSecurityTestCase.java:      private ModelNode readRootNode(ModelCon
              integration/basic/src/test/java/org/jboss/as/test/integration/web/formauth/FormAuthUnitTestCase.java:import org.jboss.as.controller.client.ModelControllerClie
              integration/basic/src/test/java/org/jboss/as/test/integration/web/formauth/FormAuthUnitTestCase.java:    public static void applyUpdates(final List<ModelNode>
              integration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextUtil.java:import org.jboss.as.controller.client.ModelControllerClient
              integration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextUtil.java:    public static void createVirtualServer(ModelControllerC
              integration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextUtil.java:    public static void removeVirtualServer(final ModelContr
              integration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextUtil.java:    public static void undeploy(final ModelControllerClient
              integration/basic/src/test/java/org/jboss/as/test/integration/web/rootcontext/RootContextUtil.java:    public static void applyUpdates(final List<ModelNode> u
              integration/basic/src/test/java/org/jboss/as/test/integration/web/security/WebCERTTestsSecurityDomainSetup.java:import org.jboss.as.controller.client.ModelCon
              integration/basic/src/test/java/org/jboss/as/test/integration/web/security/WebCERTTestsSecurityDomainSetup.java:    protected static void applyUpdates(final M
              integration/basic/src/test/java/org/jboss/as/test/integration/web/security/WebCERTTestsSecurityDomainSetup.java:    protected static void applyUpdate(final Mo
              integration/clust/src/test/java/org/jboss/as/test/clustering/DMRUtil.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/clust/src/test/java/org/jboss/as/test/clustering/DMRUtil.java:    public static void setPassivationIdleTimeout(ModelControllerClient client) throw
              integration/clust/src/test/java/org/jboss/as/test/clustering/DMRUtil.java:    public static void setPassivationOnReplicate(ModelControllerClient client, boole
              integration/clust/src/test/java/org/jboss/as/test/clustering/DMRUtil.java:    private static void unsetPassivationAttributes(ModelControllerClient client, Str
              integration/clust/src/test/java/org/jboss/as/test/clustering/DMRUtil.java:    public static void unsetIdleTimeoutPassivationAttribute(ModelControllerClient cl
              integration/clust/src/test/java/org/jboss/as/test/clustering/DMRUtil.java:    public static void unsetPassivationOnReplicate(ModelControllerClient client) thr
              integration/clust/src/test/java/org/jboss/as/test/clustering/cluster/ejb3/stateful/passivation/ClusterPassivationTestCase.java:import org.jboss.as.controller.
              integration/clust/src/test/java/org/jboss/as/test/clustering/cluster/ejb3/stateful/passivation/ClusterPassivationTestCase.java:    private void unsetPassivati
              integration/clust/src/test/java/org/jboss/as/test/clustering/cluster/management/CacheTestCase.java:import org.jboss.as.controller.client.ModelControllerClient
              integration/clust/src/test/java/org/jboss/as/test/clustering/cluster/management/CacheTestCase.java:    protected ModelControllerClient getModelControllerClien
              integration/clust/src/test/java/org/jboss/as/test/clustering/extended/ejb2/stateful/passivation/ClusterPassivationTestBase.java:import org.jboss.as.controller
              integration/clust/src/test/java/org/jboss/as/test/clustering/extended/ejb2/stateful/passivation/ClusterPassivationTestBase.java:    protected void setPassivat
              integration/clust/src/test/java/org/jboss/as/test/clustering/extended/ejb2/stateful/passivation/ClusterPassivationTestBase.java:    protected void unsetPassiv
              integration/manualmode/src/test/java/org/jboss/as/test/manualmode/ejb/shutdown/RemoteCallWhileShuttingDownTestCase.java:import org.jboss.as.controller.client.
              integration/manualmode/src/test/java/org/jboss/as/test/manualmode/ejb/shutdown/RemoteCallWhileShuttingDownTestCase.java:        final ModelControllerClient cl
              integration/smoke/src/test/java/org/jboss/as/test/smoke/jsr88/JSR88DeploymentTestCase.java:    @Ignore("[AS7-2771] ModelControllerClient operations don't fail
              integration/smoke/src/test/java/org/jboss/as/test/smoke/messaging/client/jms/JmsClientTestCase.java:import org.jboss.as.controller.client.ModelControllerClien
              integration/smoke/src/test/java/org/jboss/as/test/smoke/messaging/client/jms/JmsClientTestCase.java:        ModelControllerClient client = managementClient.ge
              integration/smoke/src/test/java/org/jboss/as/test/smoke/messaging/client/jms/JmsClientTestCase.java:    static void applyUpdate(ModelNode update, final ModelC
              integration/smoke/src/test/java/org/jboss/as/test/smoke/messaging/client/messaging/MessagingClientTestCase.java:import org.jboss.as.controller.client.ModelCon
              integration/smoke/src/test/java/org/jboss/as/test/smoke/messaging/client/messaging/MessagingClientTestCase.java:        final ModelControllerClient client = m
              integration/smoke/src/test/java/org/jboss/as/test/smoke/messaging/client/messaging/MessagingClientTestCase.java:    static void applyUpdate(ModelNode update, 
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/DataSourceOperationsUnitTestCase.java:import org.jboss.as.controller.client.ModelContr
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/DataSourceOperationsUnitTestCase.java:            ModifiableXaDataSource jxaDS = looku
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/DataSourceOperationsUnitTestCase.java:    private static <T> T lookup(ModelControllerC
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:import org.jboss.as.controller.client.ModelCon
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:        final ModelControllerClient client = m
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:        final ModelControllerClient client = m
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:        final ModelControllerClient client = m
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:        ModelControllerClient client = managem
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:        ModelControllerClient client = managem
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:        ModelControllerClient client = managem
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:    private ModelNode addDeploymentScanner(fin
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:    private void removeDeploymentScanner(final
              integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/servermodule/ServerInModuleDeploymentTestCase.java:    private void testDeployments(ModelControll
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleRunAsClientTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleRunAsClientTestCase.java:    private ModelControllerClient getControllerClient() {
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java: * Test bundle deployment using the {@link ModelControllerCli
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:                builder.addImportPackages(ClientConstants.cla
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:        ServerDeploymentHelper server = new ServerDeploymentH
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:        ServerDeploymentHelper server = new ServerDeploymentH
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:    private ModelControllerClient getModelControllerClient() 
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:        ServiceReference sref = context.getServiceReference(M
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleServerDeploymentTestCase.java:        return (ModelControllerClient) context.getService(sre
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleWebAppTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/smoke/src/test/java/org/jboss/as/test/smoke/osgi/SimpleWebAppTestCase.java:    private ModelControllerClient getControllerClient() {
              integration/smoke/src/test/java/org/jboss/as/test/smoke/stilts/SimpleStompletTestCase.java:import org.jboss.as.controller.client.ModelControllerClient;
              integration/smoke/src/test/java/org/jboss/as/test/smoke/stilts/SimpleStompletTestCase.java:    private ModelControllerClient getControllerClient() {
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    public static boolean addConfiguration(ModelControllerClient clien
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    public static List<String> listConfigurations(ModelControllerClien
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    public static Map<String, String> readConfiguration(ModelControlle
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    public static boolean removeConfiguration(ModelControllerClient cl
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    public static boolean updateConfiguration(ModelControllerClient cl
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    private static boolean addOrUpdateConfiguration(ModelControllerCli
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    private static ModelNode executeOperation(final ModelControllerCli
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    private static List<String> listChildrenNames(ModelControllerClien
              shared/src/main/java/org/jboss/as/test/configadmin/ConfigAdminManagementOperations.java:    private static boolean removeResource(ModelControllerClient client
              shared/src/main/java/org/jboss/as/test/integration/common/jms/DefaultHornetQProviderJMSOperations.java:import org.jboss.as.controller.client.ModelControllerCl
              shared/src/main/java/org/jboss/as/test/integration/common/jms/DefaultHornetQProviderJMSOperations.java:    private ModelControllerClient getModelControllerCli
              shared/src/main/java/org/jboss/as/test/integration/common/jms/DefaultHornetQProviderJMSOperations.java:        ModelNode result = this.getModelControllerClien
              shared/src/main/java/org/jboss/as/test/integration/management/ManagementOperations.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/integration/management/ManagementOperations.java:    public static void executeOperations(final ModelControllerClient c
              shared/src/main/java/org/jboss/as/test/integration/management/ManagementOperations.java:    public static ModelNode executeOperation(final ModelControllerClie
              shared/src/main/java/org/jboss/as/test/integration/management/ManagementOperations.java:    public static ModelNode executeOperationRaw(final ModelControllerC
              shared/src/main/java/org/jboss/as/test/integration/management/ManagementOperations.java:    private static ModelNode executeOperation(final ModelControllerCli
              shared/src/main/java/org/jboss/as/test/integration/management/ServerManager.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/integration/management/ServerManager.java:    protected ModelControllerClient getModelControllerClient() {
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtServerSetupTask.java:import org.jboss.as.controller.client.ModelControllerClien
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtServerSetupTask.java:    protected ModelControllerClient getModelControllerClie
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtTestBase.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtTestBase.java:    protected abstract ModelControllerClient getModelControllerCl
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtTestBase.java:            return ManagementOperations.executeOperation(getModel
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtTestBase.java:            return ManagementOperations.executeOperationRaw(getMo
              shared/src/main/java/org/jboss/as/test/integration/management/base/AbstractMgmtTestBase.java:        return getModelControllerClient().execute(ob.build());
              shared/src/main/java/org/jboss/as/test/integration/management/base/ContainerResourceMgmtTestBase.java:import org.jboss.as.controller.client.ModelControllerCli
              shared/src/main/java/org/jboss/as/test/integration/management/base/ContainerResourceMgmtTestBase.java:    protected ModelControllerClient getModelControllerCl
              shared/src/main/java/org/jboss/as/test/integration/management/util/CLIWrapper.java:        return ctx.getModelControllerClient() != null;
              shared/src/main/java/org/jboss/as/test/integration/web/sso/SSOTestBase.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/integration/web/sso/SSOTestBase.java:    public static void addSso(ModelControllerClient client) throws Exception {
              shared/src/main/java/org/jboss/as/test/integration/web/sso/SSOTestBase.java:    public static void addClusteredSso(ModelControllerClient client) throws Except
              shared/src/main/java/org/jboss/as/test/integration/web/sso/SSOTestBase.java:    public static void removeSso(final ModelControllerClient client) throws Except
              shared/src/main/java/org/jboss/as/test/integration/web/sso/SSOTestBase.java:    public static void applyUpdates(final List<ModelNode> updates, final ModelCont
              shared/src/main/java/org/jboss/as/test/integration/web/sso/SSOTestBase.java:    public static void restartServer(final ModelControllerClient client) {
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static void activateFramework(ModelControllerClient client) throws MgmtOp
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static String getActivationMode(ModelControllerClient client) throws Mgmt
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean setActivationMode(ModelControllerClient client, String mod
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static Integer getFrameworkStartLevel(ModelControllerClient client) throw
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean setFrameworkStartLevel(ModelControllerClient client, int i
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean bundleStart(ModelControllerClient client, Object resId) th
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean bundleStop(ModelControllerClient client, Object resId) thr
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static List<Long> listBundleIDs(ModelControllerClient client) throws Mgmt
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static Long getBundleId(ModelControllerClient client, String symbolicName
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static String getBundleState(ModelControllerClient client, Object resId) 
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static ModelNode getBundleInfo(ModelControllerClient client, Object resId
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean addCapability(ModelControllerClient client, String name, I
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static List<String> listCapabilities(ModelControllerClient client) throws
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean removeCapability(ModelControllerClient client, String name
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean addProperty(ModelControllerClient client, String name, Str
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static List<String> listProperties(ModelControllerClient client) throws M
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static String readProperty(ModelControllerClient client, String name) thr
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    public static boolean removeProperty(ModelControllerClient client, String name) 
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    private static ModelNode executeOperation(final ModelControllerClient client, Mo
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    private static ModelNode executeOperation(final ModelControllerClient client, Mo
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    private static List<String> listChildrenNames(ModelControllerClient client, Stri
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    private static boolean removeResource(ModelControllerClient client, String type,
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    private static String readAttribute(ModelControllerClient client, String attribu
              shared/src/main/java/org/jboss/as/test/osgi/OSGiManagementOperations.java:    private static boolean writeAttribute(ModelControllerClient client, String attri
              shared/src/main/java/org/jboss/as/test/shared/TestSuiteEnvironment.java:import org.jboss.as.controller.client.ModelControllerClient;
              shared/src/main/java/org/jboss/as/test/shared/TestSuiteEnvironment.java:    public static ModelControllerClient getModelControllerClient() {
              shared/src/main/java/org/jboss/as/test/shared/TestSuiteEnvironment.java:            return ModelControllerClient.Factory.create(
              

               

              Actually a few of them