opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/DefaultTCPNIOTransport.java
@@ -22,15 +22,14 @@ * * * Copyright 2010 Sun Microsystems, Inc. * Portions copyright 2011-2013 ForgeRock AS * Portions copyright 2011-2014 ForgeRock AS */ package org.forgerock.opendj.grizzly; import static com.forgerock.opendj.util.StaticUtils.DEFAULT_LOG; import java.io.IOException; import org.forgerock.i18n.LocalizableMessage; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.glassfish.grizzly.nio.transport.TCPNIOTransport; import org.glassfish.grizzly.nio.transport.TCPNIOTransportBuilder; import org.glassfish.grizzly.strategies.SameThreadIOStrategy; @@ -45,6 +44,8 @@ * options. */ final class DefaultTCPNIOTransport extends ReferenceCountedObject<TCPNIOTransport> { private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); static final DefaultTCPNIOTransport DEFAULT_TRANSPORT = new DefaultTCPNIOTransport(); private DefaultTCPNIOTransport() { @@ -57,7 +58,7 @@ instance.shutdownNow(); } catch (final IOException e) { // TODO: I18N DEFAULT_LOG.warn("An error occurred while shutting down the Grizzly transport", e); logger.warn(LocalizableMessage.raw("An error occurred while shutting down the Grizzly transport", e)); } } opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPConnection.java
@@ -24,13 +24,9 @@ * Copyright 2010 Sun Microsystems, Inc. * Portions Copyright 2011-2014 ForgeRock AS */ package org.forgerock.opendj.grizzly; import static com.forgerock.opendj.grizzly.GrizzlyMessages.LDAP_CONNECTION_BIND_OR_START_TLS_CONNECTION_TIMEOUT; import static com.forgerock.opendj.grizzly.GrizzlyMessages.LDAP_CONNECTION_BIND_OR_START_TLS_REQUEST_TIMEOUT; import static com.forgerock.opendj.grizzly.GrizzlyMessages.LDAP_CONNECTION_REQUEST_TIMEOUT; import static com.forgerock.opendj.util.StaticUtils.DEFAULT_LOG; import static com.forgerock.opendj.grizzly.GrizzlyMessages.*; import static org.forgerock.opendj.ldap.ErrorResultException.newErrorResult; import java.io.IOException; @@ -45,6 +41,8 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import org.forgerock.i18n.LocalizableMessage; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.io.LDAPWriter; import org.forgerock.opendj.ldap.AbstractAsynchronousConnection; import org.forgerock.opendj.ldap.ConnectionEventListener; @@ -114,6 +112,7 @@ } } private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); private final AtomicBoolean bindOrStartTLSInProgress = new AtomicBoolean(false); private final org.glassfish.grizzly.Connection<?> connection; private final AtomicInteger nextMsgID = new AtomicInteger(1); @@ -613,8 +612,8 @@ * invalidating the connection. We'll do the latter, since * ignoring timeouts could cause the application to hang. */ DEFAULT_LOG.debug("Failing bind or StartTLS request due to timeout " + "(connection will be invalidated): " + future); logger.debug(LocalizableMessage.raw("Failing bind or StartTLS request due to timeout %s" + "(connection will be invalidated): ", future)); final Result result = Responses.newResult(ResultCode.CLIENT_SIDE_TIMEOUT).setDiagnosticMessage( LDAP_CONNECTION_BIND_OR_START_TLS_REQUEST_TIMEOUT.get(timeout) @@ -628,7 +627,7 @@ .toString()); connectionErrorOccurred(errorResult); } else { DEFAULT_LOG.debug("Failing request due to timeout: " + future); logger.debug(LocalizableMessage.raw("Failing request due to timeout: %s", future)); final Result result = Responses.newResult(ResultCode.CLIENT_SIDE_TIMEOUT).setDiagnosticMessage( LDAP_CONNECTION_REQUEST_TIMEOUT.get(timeout).toString()); opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/GrizzlyLDAPListener.java
@@ -24,16 +24,16 @@ * Copyright 2010 Sun Microsystems, Inc. * Portions copyright 2011-2014 ForgeRock AS */ package org.forgerock.opendj.grizzly; import static com.forgerock.opendj.util.StaticUtils.DEFAULT_LOG; import static org.forgerock.opendj.grizzly.DefaultTCPNIOTransport.DEFAULT_TRANSPORT; import java.io.IOException; import java.net.InetSocketAddress; import java.util.concurrent.atomic.AtomicBoolean; import org.forgerock.i18n.LocalizableMessage; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.ldap.Connections; import org.forgerock.opendj.ldap.DecodeOptions; import org.forgerock.opendj.ldap.LDAPClientContext; @@ -51,6 +51,8 @@ * LDAP listener implementation using Grizzly for transport. */ public final class GrizzlyLDAPListener implements LDAPListenerImpl { private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); private final ReferenceCountedObject<TCPNIOTransport>.Reference transport; private final ServerConnectionFactory<LDAPClientContext, Integer> connectionFactory; private final TCPNIOServerConnection serverConnection; @@ -130,7 +132,7 @@ Thread.currentThread().interrupt(); } catch (final Exception e) { // TODO: I18N DEFAULT_LOG.warn("Exception occurred while closing listener", e); logger.warn(LocalizableMessage.raw("Exception occurred while closing listener", e)); } transport.release(); }