Package com.sun.enterprise.util

Examples of com.sun.enterprise.util.LocalStringManagerImpl


        // and also set report.setFailureCause(exception). We need to avoid the duplicate message.
        if (aReport.getMessage() != null && aReport.getMessage().length() != 0) {
            mainMsg = aReport.getMessage();
            String format = "{0}";
            if (ActionReport.ExitCode.WARNING.equals(aReport.getActionExitCode())) {
                LocalStringManagerImpl localStrings = new LocalStringManagerImpl(ActionReporter.class);
                format = localStrings.getLocalString("flag.message.as.warning", "Warning: {0}");
            }
            if (ActionReport.ExitCode.FAILURE.equals(aReport.getActionExitCode())) {
                LocalStringManagerImpl localStrings = new LocalStringManagerImpl(ActionReporter.class);
                format = localStrings.getLocalString("flag.message.as.failure", "Failure: {0}");
            }
            if (sb.length() > 0) sb.append(EOL_MARKER);
            sb.append(MessageFormat.format(format,mainMsg));
        }
        if (aReport.getFailureCause() != null && aReport.getFailureCause().getMessage() != null && aReport.getFailureCause().getMessage().length() != 0) {
View Full Code Here


        String outs = finalOutput.toString();

        if (!ok(outs)) {
            // we want at least one line of output.  Otherwise RemoteResponseManager
            // will consider this an error.  It is NOT an error there just is no data to report.
            LocalStringManagerImpl localStrings = new LocalStringManagerImpl(PlainTextActionReporter.class);
            writer.print(localStrings.getLocalString("get.mon.no.data", "No monitoring data to report."));
            writer.print("\n"); // forces an error to manifest constructor
        }
        else
            writer.print(outs);
View Full Code Here

        resolverType = listing.resolver();
        try {
      // we pass false for "useAnnotations" as the @Param declarations on
      // the target type are not used for the List method parameters.
            model = new GenericCommandModel(targetType, false, null, listing.i18n(),
                    new LocalStringManagerImpl(targetType),
                    habitat.getComponent(DomDocument.class), commandName, listing.resolver(), null);
            if (logger.isLoggable(level)) {
                for (String paramName : model.getParametersNames()) {
                    CommandModel.ParamModel param = model.getModelFor(paramName);
                    logger.fine("I take " + param.getName() + " parameters");
View Full Code Here

        resolverType = delete.resolver();
        try {
            // we pass false for "useAnnotations" as the @Param declarations on
      // the target type are not used for the Delete method parameters.
            model = new GenericCommandModel(targetType, false, delete.cluster(), delete.i18n(),
                    new LocalStringManagerImpl(targetType),
                    habitat.getComponent(DomDocument.class), commandName,
                    delete.resolver(), delete.decorator());
            if (logger.isLoggable(level)) {
                for (String paramName : model.getParametersNames()) {
                    CommandModel.ParamModel param = model.getModelFor(paramName);
View Full Code Here

        create = getAnnotation(targetMethod, Create.class);
        resolverType = create.resolver();
        try {
            model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(),
                    new LocalStringManagerImpl(targetType),
                    habitat.getComponent(DomDocument.class),
                    commandName, create.resolver(), create.decorator());
            if (logger.isLoggable(level)) {
                for (String paramName : model.getParametersNames()) {
                    CommandModel.ParamModel param = model.getModelFor(paramName);
View Full Code Here

        Service service = commandType.getAnnotation(Service.class);
        commandName = service != null ? service.name() : null;
        commandClass = commandType;
        i18n = commandType.getAnnotation(I18n.class);
        execOn = commandType.getAnnotation(ExecuteOn.class);
        localStrings = new LocalStringManagerImpl(commandType);
        managedJob = AnnotationUtil.presentTransitive(ManagedJob.class, commandType);

        params = init(commandType, i18n, localStrings);
        Class currentClazz = commandType;
        boolean found = false;
View Full Code Here


            for (Field f : currentClazz.getDeclaredFields()) {
                I18n fieldI18n = f.getAnnotation(I18n.class);
                if (fieldI18n!=null) {
                    localStrings = new LocalStringManagerImpl(commandType);
                }
                add(results, f, i18n, localStrings);
            }

            for (Method m : currentClazz.getDeclaredMethods()) {
                I18n fieldI18n = m.getAnnotation(I18n.class);
                if (fieldI18n!=null) {
                    localStrings = new LocalStringManagerImpl(commandType);
                }
                add(results, m, i18n, localStrings);
            }

            currentClazz = currentClazz.getSuperclass();
View Full Code Here

        String outs = finalOutput.toString();

        if (!ok(outs)) {
            // we want at least one line of output.  Otherwise RemoteResponseManager
            // will consider this an error.  It is NOT an error there just is no data to report.
            LocalStringManagerImpl localStrings = new LocalStringManagerImpl(PlainTextActionReporter.class);
            writer.print(localStrings.getLocalString("get.mon.no.data", "No monitoring data to report."));
            writer.print("\n"); // forces an error to manifest constructor
        }
        else
            writer.print(outs);
View Full Code Here

        resolverType = delete.resolver();
        try {
            // we pass false for "useAnnotations" as the @Param declarations on
      // the target type are not used for the Delete method parameters.
            model = new GenericCommandModel(targetType, false, delete.cluster(), delete.i18n(),
                    new LocalStringManagerImpl(targetType),
                    habitat.<DomDocument>getService(DomDocument.class), commandName, false,
                    delete.resolver(), delete.decorator());
            if (logger.isLoggable(level)) {
                for (String paramName : model.getParametersNames()) {
                    CommandModel.ParamModel param = model.getModelFor(paramName);
View Full Code Here

        create = getAnnotation(targetMethod, Create.class);
        resolverType = create.resolver();
        try {
            model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(),
                    new LocalStringManagerImpl(targetType),
                    habitat.<DomDocument>getService(DomDocument.class),
                    commandName, false, create.resolver(), create.decorator());
            if (logger.isLoggable(level)) {
                for (String paramName : model.getParametersNames()) {
                    CommandModel.ParamModel param = model.getModelFor(paramName);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.util.LocalStringManagerImpl

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.