APISonar


org.glassfish.api.logging.LogHelper.log

> org > glassfish > api > logging > LogHelper > log
org APIs glassfish APIs api APIs logging APIs LogHelper APIs log APIs

Example 1
public void closeConnections(List connList) {
        for (Object obj : connList) {
            try {
                 closeXAConnection(obj);
            } catch (Exception ex) {
                LogHelper.log(_logger, Level.WARNING, JMSLoggerInfo.CLOSE_CONNECTION_FAILED, ex);
            }
        }
    }
Example 2
public void testLogMessageWithExceptionArgument() throws IOException {
        LogHelper.log(LOGGER, Level.SEVERE, ERROR_READING_TEST_CONF_FILE_ID, 
                new Exception(TEST_EXCEPTION_MESSAGE), TEST_CONF_FILE);
        String[] expectedContents = new String[] {
                CANNOT_READ_TEST_CONFIGURATION_FILE_MSG + TEST_CONF_FILE,
                TEST_EXCEPTION_MESSAGE
        };
        validateLogContents(ULF_LOG, expectedContents);
        validateLogContents(ODL_LOG, expectedContents);
        System.out.println("Test passed successfully.");
    }
Example 3
private Method returnException(Class owner, Class typeToSet) {
        if (owner.isAssignableFrom(Applications.class) && (typeToSet.isAssignableFrom(Application.class)) || typeToSet.isAssignableFrom(Module.class)) {
            try {
                Method m = owner.getMethod("getModules");
                return m;
            } catch (NoSuchMethodException e) {
                LogHelper.log(LOG, Level.INFO, noMethodInReturnException, e, 
                        owner.getName(), typeToSet.getName());
            }
        }
        return null;
    }
Example 4
public void validateActivationSpec(ActivationSpec spec) {
        boolean validate =  "true".equals(System.getProperty("validate.jms.ra"));
        if (validate) {
            try {
                spec.validate();
            } catch (Exception ex) {
                LogHelper.log(_logger, Level.SEVERE, JMSLoggerInfo.ENDPOINT_VALIDATE_FAILED, ex);
            }
        }
    }
Example 5
public CommandModel getModel(String scope, String commandName, Logger logger) {
        AdminCommand command;
        try {
            String commandServiceName = (scope != null) ? scope + commandName : commandName;
            command = habitat.getService(AdminCommand.class, commandServiceName);
        } catch (MultiException e) {
            LogHelper.log(logger, Level.SEVERE, KernelLoggerInfo.cantInstantiateCommand, 
                    e, commandName);
            return null;
        }
        return command == null ? null : getModel(command);
    }