Example usage for com.liferay.portal.kernel.util SortedProperties list

List of usage examples for com.liferay.portal.kernel.util SortedProperties list

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util SortedProperties list.

Prototype

@Override
    public void list(PrintWriter out) 

Source Link

Usage

From source file:com.liferay.mail.util.MailSessionFactoryBean.java

License:Open Source License

@Override
protected Session createInstance() throws Exception {
    Properties properties = PropsUtil.getProperties(_propertyPrefix, true);

    String jndiName = properties.getProperty("jndi.name");

    if (Validator.isNotNull(jndiName)) {
        try {//from   w w w .  j  av a 2 s .c  om
            return (Session) JNDIUtil.lookup(new InitialContext(), jndiName);
        } catch (Exception e) {
            _log.error("Unable to lookup " + jndiName, e);
        }
    }

    Session session = Session.getInstance(properties);

    if (_log.isDebugEnabled()) {
        session.setDebug(true);

        SortedProperties sortedProperties = new SortedProperties(session.getProperties());

        _log.debug("Properties for prefix " + _propertyPrefix);

        sortedProperties.list(System.out);
    }

    return session;
}