Examples of OperationFailedException


Examples of org.jboss.as.controller.OperationFailedException

            AbstractFormatterSpec.fromModelNode(context, resolvedValue).apply(handler);
        } else if (ENCODING.getName().equals(attributeName)) {
            try {
                handler.setEncoding(resolvedValue.asString());
            } catch (UnsupportedEncodingException e) {
                throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToSetHandlerEncoding()));
            }
        }
        return doApplyUpdateToRuntime(context, operation, attributeName, resolvedValue, currentValue, name, handler);
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

                AbstractFormatterSpec.fromModelNode(context, valueToRestore).apply(handler);
            } else if (ENCODING.getName().equals(attributeName)) {
                try {
                    handler.setEncoding(valueToRestore.asString());
                } catch (UnsupportedEncodingException e) {
                    throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToSetHandlerEncoding()));
                }
            }
            doRevertUpdateToRuntime(context, operation, attributeName, valueToRestore, valueToRevert, name, handler);
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

     *
     * @return the exception.
     */
    static OperationFailedException createFailureMessage(final String description) {
        ModelNode failure = new ModelNode().set(description);
        return new OperationFailedException(failure);
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

                        if (encoding.isDefined()) {
                            try {
                                handler.setEncoding(encoding.asString());
                            } catch (UnsupportedEncodingException e) {
                                throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToSetHandlerEncoding()));
                            }
                        }

                        if (filter.isDefined()) {
                            handler.setFilter(ModelParser.parseFilter(context, filter));
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        if (value.isDefined()) {
            for (String key : value.keys()) {
                if (allowedValues.containsKey(key)) {
                    allowedValues.get(key).getValidator().validateParameter(key, value.get(key));
                } else {
                    throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidValueTypeKey(key, allowedValues.keySet())));
                }
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

    public void validateParameter(final String parameterName, final ModelNode value) throws OperationFailedException {
        super.validateParameter(parameterName, value);
        if (value.isDefined()) {
            final Target target = Target.fromString(value.asString());
            if (target == null || !allowedValues.contains(target)) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidTargetName(allowedValues)));
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        if (value.isDefined()) {
            final String stringValue = value.asString();
            try {
                ModelParser.parseSize(value);
            } catch (IllegalArgumentException e) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidSize(stringValue)));
            } catch (IllegalStateException e) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidSize(stringValue)));
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        if (value.isDefined()) {
            final String levelString = value.asString();
            try {
                final Level level = ModelParser.parseLevel(value);
                if (!allowedValues.contains(level)) {
                    throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidLogLevel(levelString)));
                }
            } catch (IllegalArgumentException e) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidLogLevel(levelString)));
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        try {
            if (encoding.isDefined())
                service.setEncoding(encoding.asString());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
        }

        if (formatter.isDefined()) {
            service.setFormatterSpec(AbstractFormatterSpec.fromModelNode(context, model));
        }
View Full Code Here

Examples of org.jboss.as.controller.OperationFailedException

        if (value.isDefined()) {
            final String oaString = value.asString();
            try {
                final OverflowAction overflowAction = ModelParser.parseOverflowAction(value);
                if (overflowAction == null || !allowedValues.contains(overflowAction)) {
                    throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidOverflowAction(oaString)));
                }
            } catch (IllegalArgumentException e) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidOverflowAction(oaString)));
            }
        }
    }
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.