From 90405b8f9778a5a266307ef27c43d7484bc1fb91 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 22 Oct 2010 06:52:25 +0000
Subject: [PATCH] Sync commit by matthew_swift Expose Grizzly transport configuration in LDAPOptions and LDAPListenerOptions in order to allow better customization of transport.

---
 opendj-sdk/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/opendj-sdk/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java b/opendj-sdk/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java
index 6610745..fc08a15 100644
--- a/opendj-sdk/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java
+++ b/opendj-sdk/sdk/src/com/sun/opends/sdk/ldap/LDAPConnectionFactoryImpl.java
@@ -253,17 +253,15 @@
   public LDAPConnectionFactoryImpl(final SocketAddress address,
       final LDAPOptions options)
   {
-    TCPNIOTransport tmpTransport = null;
-    if (options instanceof GrizzlyLDAPOptions)
+    if (options.getTCPNIOTransport() == null)
     {
-      tmpTransport = ((GrizzlyLDAPOptions) options).getTCPNIOTransport();
+      this.transport = GlobalTransportFactory.getInstance()
+          .createTCPTransport();
     }
-    if (tmpTransport == null)
+    else
     {
-      tmpTransport = GlobalTransportFactory.getInstance().createTCPTransport();
+      this.transport = options.getTCPNIOTransport();
     }
-    this.transport = tmpTransport;
-
     this.socketAddress = address;
     this.options = new LDAPOptions(options);
     this.clientFilter = new LDAPClientFilter(new LDAPReader(

--
Gitblit v1.10.0