Search in sources :

Example 11 with LocalStringManagerImpl

use of com.sun.enterprise.util.LocalStringManagerImpl in project Payara by payara.

the class GenericListCommand method postConstruct.

@Override
public void postConstruct() {
    super.postConstruct();
    listing = targetMethod.getAnnotation(Listing.class);
    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.
        cmdModel = new GenericCommandModel(targetType, false, null, listing.i18n(), new LocalStringManagerImpl(targetType), habitat.<DomDocument>getService(DomDocument.class), commandName, false, listing.resolver(), GenericListCommand.class);
        targetModel = habitat.<DomDocument>getService(DomDocument.class).buildModel(targetType);
        if (logger.isLoggable(level)) {
            for (String paramName : cmdModel.getParametersNames()) {
                CommandModel.ParamModel param = cmdModel.getModelFor(paramName);
                logger.log(Level.FINE, "I take {0} parameters", param.getName());
            }
        }
    } catch (Exception e) {
        String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.command_model_exception", "Exception while creating the command model for the generic command {0} : {1}", commandName, e.getMessage());
        LogHelper.log(logger, Level.SEVERE, ConfigApiLoggerInfo.GENERIC_CREATE_CMD_FAILED, e, commandName);
        throw new RuntimeException(msg, e);
    }
}
Also used : LocalStringManagerImpl(com.sun.enterprise.util.LocalStringManagerImpl) GenericCommandModel(org.glassfish.common.util.admin.GenericCommandModel) GenericCommandModel(org.glassfish.common.util.admin.GenericCommandModel) CommandModel(org.glassfish.api.admin.CommandModel) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

LocalStringManagerImpl (com.sun.enterprise.util.LocalStringManagerImpl)11 PropertyVetoException (java.beans.PropertyVetoException)3 GenericCommandModel (org.glassfish.common.util.admin.GenericCommandModel)3 IOException (java.io.IOException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 CustomConfiguration (com.sun.enterprise.config.modularity.annotation.CustomConfiguration)1 ConfigBeanDefaultValue (com.sun.enterprise.config.modularity.customization.ConfigBeanDefaultValue)1 ModuleXMLConfigurationFileParser (com.sun.enterprise.config.modularity.parser.ModuleXMLConfigurationFileParser)1 MainFrame (com.sun.enterprise.tools.verifier.gui.MainFrame)1 LocalStringManager (com.sun.enterprise.util.LocalStringManager)1 File (java.io.File)1 PrintWriter (java.io.PrintWriter)1 Field (java.lang.reflect.Field)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Stack (java.util.Stack)1 StringTokenizer (java.util.StringTokenizer)1 LogRecord (java.util.logging.LogRecord)1