Examples of OperationFailedException


Examples of org.jboss.as.controller.OperationFailedException

                service.setRotateSize(operation.get(ROTATE_SIZE).asLong(DEFAULT_ROTATE_SIZE));
            serviceBuilder.addListener(verificationHandler);
            serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
            newControllers.add(serviceBuilder.install());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }

    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

                        }
                        if (operation.hasDefined(ENCODING)) {
                            try {
                                handler.setEncoding(operation.get(ENCODING).asString());
                            } catch (UnsupportedEncodingException e) {
                                throw new OperationFailedException(e, new ModelNode().set("Failed to set handler encoding."));
                            }
                        }
                        updateRuntime(operation, handler);
                    }
                    context.completeStep();
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

            newControllers.add(target.addService(LogServices.loggerName(loggerName), service)
                    .addListener(verificationHandler)
                    .setInitialMode(ServiceController.Mode.ACTIVE)
                    .install());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }
        try {
            // install logger handler services
            if (handlers.isDefined()) {
                newControllers.addAll(LogServices.installLoggerHandlers(target, loggerName, handlers, verificationHandler));
            }
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

            if (operation.hasDefined(FORMATTER)) service.setFormatterSpec(createFormatterSpec(operation));
            serviceBuilder.addListener(verificationHandler);
            serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
            newControllers.add(serviceBuilder.install());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }

    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

                                .setInitialMode(ServiceController.Mode.ACTIVE)
                                .install();


                    } catch (Throwable t) {
                        throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
                    }
                    Collection<ServiceController<?>> loggerControllers = null;
                    try {
                        // install logger handler services
                        if (handlers.getType() != ModelType.UNDEFINED) {
                            loggerControllers = LogServices.installLoggerHandlers(target, "", handlers, verificationHandler);
                        }
                    } catch (Throwable t) {
                        throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
                    }

                    context.addStep(verificationHandler, OperationContext.Stage.VERIFY);

                    if (context.completeStep() == OperationContext.ResultAction.ROLLBACK) {
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

            if (operation.hasDefined(FORMATTER)) service.setFormatterSpec(createFormatterSpec(operation));
            serviceBuilder.addListener(verificationHandler);
            serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
            newControllers.add(serviceBuilder.install());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

            final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(address, attributeName);
            if (attributeAccess == null) {
                final Set<String> children = context.getRegistry().getChildNames(address);
                if(children.contains(attributeName)) {
                    throw new OperationFailedException(new ModelNode().set(String.format("'%s' is a registered child of resource (%s)", attributeName, address))); // TODO i18n
                } else if(context.getSubModel().has(attributeName)) {
                    final ModelNode result = context.getSubModel().get(attributeName).clone();
                    resultHandler.handleResultFragment(Util.NO_LOCATION, result);
                    resultHandler.handleResultComplete();
                } else {
                    throw new OperationFailedException(new ModelNode().set("No known attribute called " + attributeName)); // TODO i18n
                }
            } else if (attributeAccess.getReadHandler() == null) {
                final ModelNode result = context.getSubModel().get(attributeName).clone();
                resultHandler.handleResultFragment(Util.NO_LOCATION, result);
                resultHandler.handleResultComplete();
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

            OperationResult handlerResult = null;

            final String attributeName = operation.require(NAME).asString();
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(PathAddress.pathAddress(operation.get(OP_ADDR)), attributeName);
            if (attributeAccess == null) {
                throw new OperationFailedException(new ModelNode().set("No known attribute called " + attributeName)); // TODO i18n
            } else if (attributeAccess.getAccessType() != AccessType.READ_WRITE) {
                throw new OperationFailedException(new ModelNode().set("Attribute " + attributeName + " is not writeable")); // TODO i18n
            } else {
                handlerResult = attributeAccess.getWriteHandler().execute(context, operation, resultHandler);
            }

            return handlerResult;
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

                resultHandler.handleResultFragment(new String[0], result);
            } else {
                final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
                final Set<String> childNames = context.getRegistry().getChildNames(address);
                if (!childNames.contains(childName)) {
                    throw new OperationFailedException(new ModelNode().set("No known child called " + childName)); //TODO i18n
                } else {
                    final ModelNode result = new ModelNode();
                    subModel = subModel.get(childName);
                    if (!subModel.isDefined()) {
                        result.setEmptyList();
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

                resultHandler.handleResultComplete();
            } else {
                final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
                final Set<String> childNames = context.getRegistry().getChildNames(address);
                if (!childNames.contains(childName)) {
                    throw new OperationFailedException(new ModelNode().set("No known child called " + childName)); //TODO i18n
                } else {
                    final AtomicBoolean ok = new AtomicBoolean(true);
                    final ModelNode result = new ModelNode();
                    subModel = subModel.get(childName);
                    if (!subModel.isDefined()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.