Package org.jboss.as.console.mbui.dmr

Examples of org.jboss.as.console.mbui.dmr.ResourceAddress


    }

    public void onCreateResource(final String addressString, final ModelNode payload, final Callback... callback) {

        final String name = payload.get(NAME).asString();
        final ResourceAddress address = new ResourceAddress(addressString, statementContext);
        ModelNode op = address.asOperation(payload);
        op.get(OP).set(ADD);

        dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
View Full Code Here


        });
    }

    public void onRemoveResource(final String addressString, final String name, final Callback... callback) {

        final ResourceAddress address = new ResourceAddress(addressString, statementContext);
        ModelNode op = address.asFqAddress(name);
        op.get(OP).set(REMOVE);

        dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
View Full Code Here

    }

    public void onSaveResource(final String addressString, final String name, Map<String, Object> changedValues,
                               final Callback... callback) {

        final ResourceAddress address = new ResourceAddress(addressString, statementContext);
        final ModelNodeAdapter adapter = new ModelNodeAdapter();

        // name can be omitted
        ModelNode operation = name!=null ?
                adapter.fromChangeset(changedValues, address.asFqAddress(name)) :
                adapter.fromChangeset(changedValues, address);

        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
                for (Callback cb : callback) {
                    cb.onFailure(address, name, caught);
                }
            }

            @Override
            public void onSuccess(DMRResponse dmrResponse) {
                ModelNode response = dmrResponse.get();
                if (response.isFailure()) {
                    Console.error("Failed to save " + address.toString(), response.getFailureDescription());
                    for (Callback cb : callback) {
                        cb.onFailure(address, name, new RuntimeException("Failed to add resource " + name +":"+ response.getFailureDescription()));
                    }
                }
                else {
                    Console.info("Successfully saved " + address.toString());
                    for (Callback cb : callback) {
                        cb.onSuccess(address, name);
                    }
                }
            }
View Full Code Here

        this.revealStrategy = revealStrategy;
        this.securityFramework = securityFramework;
        this.bufferPoolStore = bufferPoolStore;
        this.workerStore = workerStore;

        this.bufferPoolAddressTemplate = new ResourceAddress("{selected.profile}/subsystem=io/buffer-pool=*",
                bufferPoolStore.getStatementContext());
        this.workerAddressTemplate = new ResourceAddress("{selected.profile}/subsystem=io/worker=*",
                workerStore.getStatementContext());
    }
View Full Code Here

        operationDelegate.onSaveResource(RESOURCE_ADDRESS, name, changedValues, new RefreshCallback(channel));
    }

    @Process(actionType = RefreshWorkers.class)
    public void refresh(final Dispatcher.Channel channel) {
        final ResourceAddress op = new ResourceAddress("{selected.profile}/subsystem=io/", statementContext);
        op.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION);
        op.get(CHILD_TYPE).set("worker");
        op.get(INCLUDE_RUNTIME).set(true);

        dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
                channel.nack(caught);
View Full Code Here

        this.circuit = circuit;
        this.revealStrategy = revealStrategy;
        this.securityFramework = securityFramework;
        this.batchStore = batchStore;

        this.batchTemplate = new ResourceAddress(BATCH_ADDRESS, batchStore.getStatementContext());
        this.threadPoolTemplate = new ResourceAddress(THREAD_POOL_ADDRESS, batchStore.getStatementContext());
        this.jobRepositoryTemplate = new ResourceAddress(JOB_REPOSITORY_ADDRESS, batchStore.getStatementContext());
        this.threadFactoriesTemplate = new ResourceAddress(THREAD_FACTORIES_ADDRESS, batchStore.getStatementContext());
    }
View Full Code Here


    // ------------------------------------------------------ model node factory methods

    private ModelNode readResourceOp(String addressTemplate) {
        final ResourceAddress op = new ResourceAddress(addressTemplate, statementContext);
        op.get(OP).set(READ_RESOURCE_OPERATION);
        op.get(INCLUDE_RUNTIME).set(true);
        op.get("attributes-only").set(true);
        return op;
    }
View Full Code Here

        op.get("attributes-only").set(true);
        return op;
    }

    private ModelNode readThreadFactoriesOp() {
        final ResourceAddress op = new ResourceAddress(BATCH_ADDRESS, statementContext);
        op.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION);
        op.get(CHILD_TYPE).set("thread-factory");
        op.get(INCLUDE_RUNTIME).set(true);
        return op;
    }
View Full Code Here

        operationDelegate.onSaveResource(RESOURCE_ADDRESS, name, changedValues, new RefreshCallback(channel));
    }

    @Process(actionType = RefreshBufferPools.class)
    public void refresh(final Dispatcher.Channel channel) {
        final ResourceAddress op = new ResourceAddress("{selected.profile}/subsystem=io/", statementContext);
        op.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION);
        op.get(CHILD_TYPE).set("buffer-pool");
        op.get(INCLUDE_RUNTIME).set(true);

        dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
                channel.nack(caught);
View Full Code Here

        persistsModules(modules);
    }

    @Override
    public void onLaunchAddResourceDialog(final String addressString) {
        ResourceAddress address = new ResourceAddress(addressString, statementContext);
        String type = address.getResourceType();

        window = new DefaultWindow(Console.MESSAGES.createTitle(type.toUpperCase()));
        window.setWidth(480);
        window.setHeight(360);
View Full Code Here

TOP

Related Classes of org.jboss.as.console.mbui.dmr.ResourceAddress

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.