Package org.jboss.as.controller.client

Examples of org.jboss.as.controller.client.ModelControllerClient


        if(containerConfig.getUsername() != null) {
            Authentication.username = containerConfig.getUsername();
            Authentication.password = containerConfig.getPassword();
        }

        ModelControllerClient modelControllerClient = null;
        try {
            modelControllerClient = ModelControllerClient.Factory.create(
                    containerConfig.getManagementAddress(),
                    containerConfig.getManagementPort(),
                    getCallbackHandler());
View Full Code Here


         * First configure a JavaMail Session for the Server to bind into JNDI; this
         * will be used by our MailService EJB.  In a production environment, we'll likely have configured
         * the server before it was started to point to a real SMTP server
         */

        final ModelControllerClient client = managementClient.getControllerClient();

        final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
        final ModelNode steps = composite.get(STEPS);

        final ModelNode createSocketBindingOperation = new ModelNode();
        createSocketBindingOperation.get("operation").set("add");
        createSocketBindingOperation.get("host").set("localhost");
        createSocketBindingOperation.get("port").set(25000);
        final ModelNode socketBindingAddress = createSocketBindingOperation.get("address");
        socketBindingAddress.add("socket-binding-group", "standard-sockets");
        socketBindingAddress.add("remote-destination-outbound-socket-binding", "mail-smtp-25000");
        steps.add(createSocketBindingOperation);

        final ModelNode createMailServiceOperation = new ModelNode();
        createMailServiceOperation.get("operation").set("add");
        createMailServiceOperation.get("jndi-name").set(SMTPMailServiceConstants.JNDI_BIND_NAME_MAIL_SESSION);
        createMailServiceOperation.get("debug").set("false");
        final ModelNode smtpAddress = createMailServiceOperation.get("address");
        smtpAddress.add("subsystem", "mail");
        smtpAddress.add("mail-session", SMTPMailServiceConstants.JNDI_BIND_NAME_MAIL_SESSION);
        steps.add(createMailServiceOperation);

        final ModelNode createSMTPServer = new ModelNode();
        createSMTPServer.get("operation").set("add");
        createSMTPServer.get("outbound-socket-binding-ref").set("mail-smtp-25000");
        final ModelNode smtpServerAddress = createSMTPServer.get("address");
        smtpServerAddress.add("subsystem", "mail");
        smtpServerAddress.add("mail-session", SMTPMailServiceConstants.JNDI_BIND_NAME_MAIL_SESSION);
        smtpServerAddress.add("server", "smtp");
        steps.add(createSMTPServer);

        System.out.println("Configure mail service :" + client.execute(composite));

        /*
         * With the config all set and dependencies in place, now we can deploy
         */

 
View Full Code Here

    @RunAsClient
    @InSequence(value = 3)
    @Test
    public void resetAppServerConfig(@ArquillianResource ManagementClient managementClient)
            throws Exception {
        final ModelControllerClient client = managementClient.getControllerClient();

        deployer.undeploy(DEPLOYMENT_NAME);

        final ModelNode removeSocketBindingOperation = new ModelNode();
        removeSocketBindingOperation.get("operation").set("remove");
        final ModelNode socketBindingAddress = removeSocketBindingOperation.get("address");
        socketBindingAddress.add("socket-binding-group", "standard-sockets");
        socketBindingAddress.add("remote-destination-outbound-socket-binding", "mail-smtp-25000");
        System.out.println("REMOVE SOCKETS" + client.execute(removeSocketBindingOperation));

        final ModelNode removeMailServiceOperation = new ModelNode();
        removeMailServiceOperation.get("operation").set("remove");
        final ModelNode smtpAddress = removeMailServiceOperation.get("address");
        smtpAddress.add("subsystem", "mail");
        smtpAddress.add("mail-session", SMTPMailServiceConstants.JNDI_BIND_NAME_MAIL_SESSION);
        System.out.println("REMOVE MAIL" + client.execute(removeMailServiceOperation));

        final ModelNode reloadOperation = new ModelNode();
        reloadOperation.get("operation").set("reload");
        System.out.println("Reload config:" + client.execute(reloadOperation));
        Thread.sleep(3000); // Because the operation returns but then server reload continues in the BG
                    // Find from the WildFly team a better notification mechanism upon which to wait
                    // https://github.com/arquillian/continuous-enterprise-development/issues/66
        //no longer needed since WildFly 8 CR1
    }
View Full Code Here

    public void testMessagingClient() throws Exception {

        final String queueName = "queue.standalone";

        final ClientSessionFactory sf = createClientSessionFactory(managementClient.getMgmtAddress(), 5445);
        final ModelControllerClient client = managementClient.getControllerClient();

        // Check that the queue does not exists
        if (queueExists(queueName, sf)) {
            throw new IllegalStateException();
        }
View Full Code Here

    public void testDeploymentStreamApi() throws Exception {
        final JavaArchive archive = ShrinkWrapUtils.createJavaArchive("servermodule/test-deployment.sar",
                Simple.class.getPackage());
        final ServerDeploymentManager manager = ServerDeploymentManager.Factory
                .create(InetAddress.getByName(managementClient.getMgmtAddress()), managementClient.getMgmtPort(), getCallbackHandler());
        final ModelControllerClient client = managementClient.getControllerClient();
        testDeployments(client, new DeploymentExecutor() {

            @Override
            public void initialDeploy() {
                final InputStream is = archive.as(ZipExporter.class).exportAsInputStream();
View Full Code Here

        final JavaArchive archive = ShrinkWrapUtils.createJavaArchive("servermodule/test-deployment.sar",
                Simple.class.getPackage());

        final ServerDeploymentManager manager = ServerDeploymentManager.Factory
                .create(InetAddress.getByName(managementClient.getMgmtAddress()), managementClient.getMgmtPort(), getCallbackHandler());
        final ModelControllerClient client = managementClient.getControllerClient();
        final File dir = new File("target/archives");
        dir.mkdirs();
        final File file = new File(dir, "test-deployment.sar");
        archive.as(ZipExporter.class).exportTo(file, true);
View Full Code Here

    }

    @Test
    public void testFilesystemScannerRegistration() throws Exception {
        final File deployDir = createDeploymentDir("dummy");
        final ModelControllerClient client = managementClient.getControllerClient();
        final String scannerName = "dummy";
        addDeploymentScanner(deployDir, client, scannerName, false);
        removeDeploymentScanner(client, scannerName);
        addDeploymentScanner(deployDir, client, scannerName, false);
        removeDeploymentScanner(client, scannerName);
View Full Code Here

        final File file = new File(dir, "test-deployment.sar");
        archive.as(ZipExporter.class).exportTo(file, true);

        final File deployDir = createDeploymentDir("marker-deployments");

        ModelControllerClient client = managementClient.getControllerClient();
        final String scannerName = "markerZips";
        addDeploymentScanner(deployDir, client, scannerName, false);

        final File target = new File(deployDir, "test-deployment.sar");
        final File deployed = new File(deployDir, "test-deployment.sar.deployed");
View Full Code Here

        final File file = new File(dir, "test-deployment.sar");
        archive.as(ZipExporter.class).exportTo(file, true);

        final File deployDir = createDeploymentDir("auto-deployments");

        ModelControllerClient client = managementClient.getControllerClient();
        final String scannerName = "autoZips";
        addDeploymentScanner(deployDir, client, scannerName, true);

        final File target = new File(deployDir, "test-deployment.sar");
        final File deployed = new File(deployDir, "test-deployment.sar.deployed");
View Full Code Here

    @Test
    public void testExplodedFilesystemDeployment() throws Exception {

        final File deployDir = createDeploymentDir("exploded-deployments");

        ModelControllerClient client = managementClient.getControllerClient();
        final String scannerName = "exploded";
        addDeploymentScanner(deployDir, client, scannerName, false);

        final JavaArchive archive = ShrinkWrapUtils.createJavaArchive("servermodule/test-deployment.sar",
                Simple.class.getPackage());
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.client.ModelControllerClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.