Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 681939 Details for
Bug 901302
CLI failing to connect on initial connection and only succeeds on second attempt
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
0001-added-timeout-to-cli.patch
0001-added-timeout-to-cli.patch (text/x-patch), 28.74 KB, created by
Shay Matasaro
on 2013-01-09 17:29:20 UTC
(
hide
)
Description:
0001-added-timeout-to-cli.patch
Filename:
MIME Type:
Creator:
Shay Matasaro
Created:
2013-01-09 17:29:20 UTC
Size:
28.74 KB
patch
obsolete
>From 432a157548727436cb441ebcc2541088457136c9 Mon Sep 17 00:00:00 2001 >Message-Id: <432a157548727436cb441ebcc2541088457136c9.1357752153.git.smatasar@redhat.com> >From: Shay Matasaro <smatasar@redhat.com> >Date: Wed, 9 Jan 2013 12:11:00 -0500 >Subject: [PATCH] added timeout to cli > >--- > .../resources/docs/schema/jboss-as-cli_1_1.xsd | 16 ++++-- > cli/src/main/java/org/jboss/as/cli/CliConfig.java | 7 +++ > .../org/jboss/as/cli/CommandContextFactory.java | 2 +- > .../java/org/jboss/as/cli/impl/CliConfigImpl.java | 10 ++++ > .../java/org/jboss/as/cli/impl/CliLauncher.java | 30 ++++++++--- > .../as/cli/impl/CommandContextFactoryImpl.java | 6 +- > .../org/jboss/as/cli/impl/CommandContextImpl.java | 13 ++++- > cli/src/main/resources/help/help.txt | 9 ++- > .../as/cli/completion/mock/MockCliConfig.java | 9 +++- > .../controller/client/ModelControllerClient.java | 14 +++++ > .../client/impl/ClientConfigurationImpl.java | 55 ++++++++++++++----- > 11 files changed, 134 insertions(+), 39 deletions(-) > >diff --git a/build/src/main/resources/docs/schema/jboss-as-cli_1_1.xsd b/build/src/main/resources/docs/schema/jboss-as-cli_1_1.xsd >index f42a35b..ddb217e 100644 >--- a/build/src/main/resources/docs/schema/jboss-as-cli_1_1.xsd >+++ b/build/src/main/resources/docs/schema/jboss-as-cli_1_1.xsd >@@ -60,7 +60,7 @@ > </xs:sequence> > </xs:complexType> > </xs:element> >- >+ > <xs:element name="validate-operation-requests" type="xs:boolean" default="true"> > <xs:annotation> > <xs:documentation> >@@ -70,7 +70,7 @@ > </xs:documentation> > </xs:annotation> > </xs:element> >- >+ > <xs:element name="history"> > <xs:annotation> > <xs:documentation> >@@ -86,7 +86,15 @@ > </xs:sequence> > </xs:complexType> > </xs:element> >- >+ >+ <xs:element name="connection-timeout" type="xs:int" default="5000"> >+ <xs:annotation> >+ <xs:documentation> >+ The time allowed to establish a connection with the controller. >+ </xs:documentation> >+ </xs:annotation> >+ </xs:element> >+ > <xs:element name="ssl"> > <xs:annotation> > <xs:documentation> >@@ -99,7 +107,7 @@ > <xs:element name="key-store" type="xs:string" minOccurs="0" /> > <xs:element name="key-store-password" type="xs:string" minOccurs="0" /> > <xs:element name="alias" type="xs:string" minOccurs="0" /> >- <xs:element name="key-password" type="xs:string" minOccurs="0" /> >+ <xs:element name="key-password" type="xs:string" minOccurs="0" /> > <xs:element name="trust-store" type="xs:string" minOccurs="0" /> > <xs:element name="trust-store-password" type="xs:string" minOccurs="0" /> > <xs:element name="modify-trust-store" type="xs:boolean" default="true" minOccurs="0"> >diff --git a/cli/src/main/java/org/jboss/as/cli/CliConfig.java b/cli/src/main/java/org/jboss/as/cli/CliConfig.java >index cdacedf..1871959 100644 >--- a/cli/src/main/java/org/jboss/as/cli/CliConfig.java >+++ b/cli/src/main/java/org/jboss/as/cli/CliConfig.java >@@ -72,6 +72,13 @@ public interface CliConfig { > int getHistoryMaxSize(); > > /** >+ * Connection timeout period in milliseconds. >+ * >+ * @return connection timeout in milliseconds >+ */ >+ int getConnectionTimeout(); >+ >+ /** > * The global SSL configuration if it has been defined. > * > * @return The SSLConfig >diff --git a/cli/src/main/java/org/jboss/as/cli/CommandContextFactory.java b/cli/src/main/java/org/jboss/as/cli/CommandContextFactory.java >index 3f4b943..2e3430f 100644 >--- a/cli/src/main/java/org/jboss/as/cli/CommandContextFactory.java >+++ b/cli/src/main/java/org/jboss/as/cli/CommandContextFactory.java >@@ -57,7 +57,7 @@ public abstract class CommandContextFactory { > String username, char[] password) throws CliInitializationException; > > public abstract CommandContext newCommandContext(String controllerHost, int controllerPort, >- String username, char[] password, boolean initConsole) throws CliInitializationException; >+ String username, char[] password, boolean initConsole, final int connectionTimeout) throws CliInitializationException; > > public abstract CommandContext newCommandContext(String controllerHost, int controllerPort, > String username, char[] password, >diff --git a/cli/src/main/java/org/jboss/as/cli/impl/CliConfigImpl.java b/cli/src/main/java/org/jboss/as/cli/impl/CliConfigImpl.java >index b79b893..2914541 100644 >--- a/cli/src/main/java/org/jboss/as/cli/impl/CliConfigImpl.java >+++ b/cli/src/main/java/org/jboss/as/cli/impl/CliConfigImpl.java >@@ -58,6 +58,7 @@ class CliConfigImpl implements CliConfig { > private static final String HOST = "host"; > private static final String MAX_SIZE = "max-size"; > private static final String PORT = "port"; >+ private static final String CONNECTION_TIMEOUT = "connection-timeout"; > private static final String VALIDATE_OPERATION_REQUESTS = "validate-operation-requests"; > > static CliConfig load(final CommandContext ctx) throws CliInitializationException { >@@ -123,6 +124,8 @@ class CliConfigImpl implements CliConfig { > historyFileName = ".jboss-cli-history"; > historyFileDir = SecurityActions.getSystemProperty("user.home"); > historyMaxSize = 500; >+ >+ connectionTimeout = 5000; > } > > private String defaultControllerHost; >@@ -132,6 +135,8 @@ class CliConfigImpl implements CliConfig { > private String historyFileName; > private String historyFileDir; > private int historyMaxSize; >+ >+ private int connectionTimeout; > > private boolean validateOperationRequests = true; > >@@ -168,6 +173,11 @@ class CliConfigImpl implements CliConfig { > } > > @Override >+ public int getConnectionTimeout() { >+ return connectionTimeout; >+ } >+ >+ @Override > public boolean isValidateOperationRequests() { > return validateOperationRequests; > } >diff --git a/cli/src/main/java/org/jboss/as/cli/impl/CliLauncher.java b/cli/src/main/java/org/jboss/as/cli/impl/CliLauncher.java >index 3c0f520..359885d 100644 >--- a/cli/src/main/java/org/jboss/as/cli/impl/CliLauncher.java >+++ b/cli/src/main/java/org/jboss/as/cli/impl/CliLauncher.java >@@ -59,6 +59,8 @@ public class CliLauncher { > boolean version = false; > String username = null; > char[] password = null; >+ int timeout = -1; >+ > for(String arg : args) { > if(arg.startsWith("--controller=") || arg.startsWith("controller=")) { > final String value; >@@ -163,6 +165,20 @@ public class CliLauncher { > username = arg.startsWith("--") ? arg.substring(7) : arg.substring(5); > } else if (arg.startsWith("--password=")) { > password = (arg.startsWith("--") ? arg.substring(11) : arg.substring(9)).toCharArray(); >+ } else if (arg.startsWith("--timeout=")) { >+ if (timeout > 0) { >+ argError = "Duplicate argument '--timeout'"; >+ break; >+ } >+ final String value = arg.substring(10); >+ try { >+ timeout = Integer.parseInt(value); >+ } catch (final NumberFormatException e) { >+ // >+ } >+ if (timeout <= 0) { >+ argError = "The timeout must be a valid positive integer: '" + value + "'"; >+ } > } else if (arg.equals("--help") || arg.equals("-h")) { > commands = Collections.singletonList("help"); > } else if (arg.startsWith("--properties=")) { >@@ -215,31 +231,31 @@ public class CliLauncher { > } > > if(version) { >- cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, connect); >+ cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, connect, timeout); > VersionHandler.INSTANCE.handle(cmdCtx); > return; > } > > if(file != null) { >- cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, connect); >+ cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, connect, timeout); > processFile(file, cmdCtx); > return; > } > > if(commands != null) { >- cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, connect); >+ cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, connect, timeout); > processCommands(commands, cmdCtx); > return; > } > > if (gui) { >- cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, true); >+ cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, false, true, timeout); > processGui(cmdCtx); > return; > } > > // Interactive mode >- cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, true, connect); >+ cmdCtx = initCommandContext(defaultControllerHost, defaultControllerPort, username, password, true, connect, timeout); > cmdCtx.interact(); > } catch(Throwable t) { > t.printStackTrace(); >@@ -255,8 +271,8 @@ public class CliLauncher { > System.exit(exitCode); > } > >- private static CommandContext initCommandContext(String defaultHost, int defaultPort, String username, char[] password, boolean initConsole, boolean connect) throws CliInitializationException { >- final CommandContext cmdCtx = CommandContextFactory.getInstance().newCommandContext(defaultHost, defaultPort, username, password, initConsole); >+ private static CommandContext initCommandContext(String defaultHost, int defaultPort, String username, char[] password, boolean initConsole, boolean connect, final int timeout) throws CliInitializationException { >+ final CommandContext cmdCtx = CommandContextFactory.getInstance().newCommandContext(defaultHost, defaultPort, username, password, initConsole, timeout); > if(connect) { > try { > cmdCtx.connectController(); >diff --git a/cli/src/main/java/org/jboss/as/cli/impl/CommandContextFactoryImpl.java b/cli/src/main/java/org/jboss/as/cli/impl/CommandContextFactoryImpl.java >index 35317f7..f9ab998 100644 >--- a/cli/src/main/java/org/jboss/as/cli/impl/CommandContextFactoryImpl.java >+++ b/cli/src/main/java/org/jboss/as/cli/impl/CommandContextFactoryImpl.java >@@ -56,14 +56,14 @@ public class CommandContextFactoryImpl extends CommandContextFactory { > public CommandContext newCommandContext(String controllerHost, > int controllerPort, String username, char[] password) > throws CliInitializationException { >- return newCommandContext(controllerHost, controllerPort, username, password, false); >+ return newCommandContext(controllerHost, controllerPort, username, password, false, -1); > } > > @Override > public CommandContext newCommandContext(String controllerHost, > int controllerPort, String username, char[] password, >- boolean initConsole) throws CliInitializationException { >- final CommandContext ctx = new CommandContextImpl(controllerHost, controllerPort, username, password, initConsole); >+ boolean initConsole, final int connectionTimeout) throws CliInitializationException { >+ final CommandContext ctx = new CommandContextImpl(controllerHost, controllerPort, username, password, initConsole, connectionTimeout); > addShutdownHook(ctx); > return ctx; > } >diff --git a/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java b/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java >index 1599049..d5e626c 100644 >--- a/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java >+++ b/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java >@@ -178,6 +178,8 @@ class CommandContextImpl implements CommandContext { > private char[] password; > /** The SSLContext when managed by the CLI */ > private SSLContext sslContext; >+ /** Operation timeout */ >+ private final int connectionTimeout; > /** The TrustManager in use by the SSLContext, a reference is kept to rejected certificates can be captured. */ > private LazyDelagatingTrustManager trustManager; > /** various key/value pairs */ >@@ -214,6 +216,7 @@ class CommandContextImpl implements CommandContext { > this.console = null; > this.operationCandidatesProvider = null; > this.cmdCompleter = null; >+ this.connectionTimeout = -1; > operationHandler = new OperationRequestHandler(); > initCommands(); > config = CliConfigImpl.load(this); >@@ -223,14 +226,14 @@ class CommandContextImpl implements CommandContext { > } > > CommandContextImpl(String username, char[] password) throws CliInitializationException { >- this(null, -1, username, password, false); >+ this(null, -1, username, password, false, -1); > } > > /** > * Default constructor used for both interactive and non-interactive mode. > * > */ >- CommandContextImpl(String defaultControllerHost, int defaultControllerPort, String username, char[] password, boolean initConsole) >+ CommandContextImpl(String defaultControllerHost, int defaultControllerPort, String username, char[] password, boolean initConsole, final int connectionTimeout) > throws CliInitializationException { > > config = CliConfigImpl.load(this); >@@ -239,6 +242,8 @@ class CommandContextImpl implements CommandContext { > > this.username = username; > this.password = password; >+ this.connectionTimeout = connectionTimeout; >+ > if (defaultControllerHost != null) { > this.defaultControllerHost = defaultControllerHost; > } else { >@@ -275,6 +280,8 @@ class CommandContextImpl implements CommandContext { > > this.username = username; > this.password = password; >+ this.connectionTimeout = -1; >+ > if (defaultControllerHost != null) { > this.defaultControllerHost = defaultControllerHost; > } else { >@@ -723,7 +730,7 @@ class CommandContextImpl implements CommandContext { > if(log.isDebugEnabled()) { > log.debug("connecting to " + host + ':' + port + " as " + username); > } >- ModelControllerClient tempClient = ModelControllerClient.Factory.create(host, port, cbh, sslContext); >+ ModelControllerClient tempClient = ModelControllerClient.Factory.create(host, port, cbh, sslContext, connectionTimeout); > retry = tryConnection(tempClient, host, port); > if(!retry) { > newClient = tempClient; >diff --git a/cli/src/main/resources/help/help.txt b/cli/src/main/resources/help/help.txt >index f6db345..781436d 100644 >--- a/cli/src/main/resources/help/help.txt >+++ b/cli/src/main/resources/help/help.txt >@@ -3,6 +3,7 @@ Usage: jboss-cli.sh/jboss-cli.bat [--help] [--version] [--controller=host:port] > [--commands=command_or_operation1,command_or_operation2...] > [--command=command_or_operation] > [--user=username --password=password] >+ [--timeout=timeout] > > --help (-h) - prints (this) basic description of the command line utility. > --version - prints the version info of the JBoss AS release, JVM and system environment. >@@ -11,7 +12,7 @@ Usage: jboss-cli.sh/jboss-cli.bat [--help] [--version] [--controller=host:port] > the arguments. The default controller host is localhost and the port is 9999. > --connect (-c) - instructs the CLI to connect to the controller on start-up (to avoid issuing > a separate connect command later). >- --gui - GUI built on top of the CLI, the only difference is that it brings up a GUI >+ --gui - GUI built on top of the CLI, the only difference is that it brings up a GUI > instead of a command line. In this mode, the CLI will automatically connect > during start-up. You can optionally specify --controller, if necessary. > --file - specifies a path to a file which contains commands and operations (one per line) >@@ -30,11 +31,13 @@ Usage: jboss-cli.sh/jboss-cli.bat [--help] [--version] [--controller=host:port] > at the end of the argument list will be assumed to be the list of commands and operations. > --user - if the controller requires user authentication, this argument can be used to specify the user name > as a command line argument. If the argument isn't specified and the authentication is required >- the user will be prompted to enter the user name when the connect command is issued. >+ the user will be prompted to enter the user name when the connect command is issued. > --password - specifies the password for authentication while connecting to the controller as > a command line argument. If the argument isn't specified and the authentication is required > the user will be prompted to enter the password when the connect command is issued. >- >+ --timeout - specifies home many milliseconds to wait for a given command to return. The value provided >+ must be a positive integer. Defaults to 5000 milliseconds when not provided. >+ > > During the command line session for a list of commands available in the current context execute > >diff --git a/cli/src/test/java/org/jboss/as/cli/completion/mock/MockCliConfig.java b/cli/src/test/java/org/jboss/as/cli/completion/mock/MockCliConfig.java >index ee7a779..53227a8 100644 >--- a/cli/src/test/java/org/jboss/as/cli/completion/mock/MockCliConfig.java >+++ b/cli/src/test/java/org/jboss/as/cli/completion/mock/MockCliConfig.java >@@ -21,12 +21,11 @@ > */ > package org.jboss.as.cli.completion.mock; > >- > import org.jboss.as.cli.CliConfig; > import org.jboss.as.cli.SSLConfig; > > /** >- * >+ * > * @author Alexey Loubyansky > */ > public class MockCliConfig implements CliConfig { >@@ -67,7 +66,13 @@ public class MockCliConfig implements CliConfig { > } > > @Override >+ public int getConnectionTimeout() { >+ return 5000; >+ } >+ >+ @Override > public boolean isValidateOperationRequests() { > return true; > } >+ > } >diff --git a/controller-client/src/main/java/org/jboss/as/controller/client/ModelControllerClient.java b/controller-client/src/main/java/org/jboss/as/controller/client/ModelControllerClient.java >index 80b71b1..aaddcc8 100644 >--- a/controller-client/src/main/java/org/jboss/as/controller/client/ModelControllerClient.java >+++ b/controller-client/src/main/java/org/jboss/as/controller/client/ModelControllerClient.java >@@ -190,6 +190,20 @@ public interface ModelControllerClient extends Closeable { > /** > * Create a client instance for a remote address and port and CallbackHandler. > * >+ * @param hostName the remote host >+ * @param port the port >+ * @param handler CallbackHandler to obtain authentication information for the call. >+ * @param sslContext a pre-initialised SSLContext >+ * @return A model controller client >+ * @throws UnknownHostException if the host cannot be found >+ */ >+ public static ModelControllerClient create(final String hostName, final int port, final CallbackHandler handler, final SSLContext sslContext, final int connectionTimeout) throws UnknownHostException { >+ return create(ClientConfigurationImpl.create(hostName, port, handler, sslContext, connectionTimeout)); >+ } >+ >+ /** >+ * Create a client instance for a remote address and port and CallbackHandler. >+ * > * @param hostName the remote host > * @param port the port > * @param handler CallbackHandler to obtain authentication information for the call. >diff --git a/controller-client/src/main/java/org/jboss/as/controller/client/impl/ClientConfigurationImpl.java b/controller-client/src/main/java/org/jboss/as/controller/client/impl/ClientConfigurationImpl.java >index 7e4cf48..ad6ec93 100644 >--- a/controller-client/src/main/java/org/jboss/as/controller/client/impl/ClientConfigurationImpl.java >+++ b/controller-client/src/main/java/org/jboss/as/controller/client/impl/ClientConfigurationImpl.java >@@ -45,13 +45,17 @@ import java.util.concurrent.atomic.AtomicInteger; > public class ClientConfigurationImpl implements ModelControllerClientConfiguration { > > private static final int DEFAULT_MAX_THREADS = getSystemProperty("org.jboss.as.controller.client.max-threads", 6); >+ private static final int DEFAULT_CONNECTION_TIMEOUT = 5000; > > // Global count of created pools > private static final AtomicInteger executorCount = new AtomicInteger(); >+ > static ExecutorService createDefaultExecutor() { > final ThreadGroup group = new ThreadGroup("management-client-thread"); >- final ThreadFactory threadFactory = new JBossThreadFactory(group, Boolean.FALSE, null, "%G " + executorCount.incrementAndGet() + "-%t", null, null, AccessController.getContext()); >- return new ThreadPoolExecutor(2, DEFAULT_MAX_THREADS, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory); >+ final ThreadFactory threadFactory = new JBossThreadFactory(group, Boolean.FALSE, null, "%G " >+ + executorCount.incrementAndGet() + "-%t", null, null, AccessController.getContext()); >+ return new ThreadPoolExecutor(2, DEFAULT_MAX_THREADS, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), >+ threadFactory); > } > > private final String address; >@@ -61,12 +65,20 @@ public class ClientConfigurationImpl implements ModelControllerClientConfigurati > private final SSLContext sslContext; > private final ExecutorService executorService; > private boolean shutdownExecutor; >+ private final int connectionTimeout; >+ >+ protected ClientConfigurationImpl(String address, int port, CallbackHandler handler, Map<String, String> saslOptions, >+ SSLContext sslContext, ExecutorService executorService) { >+ this(address, port, handler, saslOptions, sslContext, executorService, false, DEFAULT_CONNECTION_TIMEOUT); >+ } > >- protected ClientConfigurationImpl(String address, int port, CallbackHandler handler, Map<String, String> saslOptions, SSLContext sslContext, ExecutorService executorService) { >- this(address, port, handler, saslOptions, sslContext, executorService, false); >+ protected ClientConfigurationImpl(String address, int port, CallbackHandler handler, Map<String, String> saslOptions, >+ SSLContext sslContext, ExecutorService executorService, boolean shutdownExecutor) { >+ this(address, port, handler, saslOptions, sslContext, executorService, shutdownExecutor, DEFAULT_CONNECTION_TIMEOUT); > } > >- protected ClientConfigurationImpl(String address, int port, CallbackHandler handler, Map<String, String> saslOptions, SSLContext sslContext, ExecutorService executorService, boolean shutdownExecutor) { >+ protected ClientConfigurationImpl(String address, int port, CallbackHandler handler, Map<String, String> saslOptions, >+ SSLContext sslContext, ExecutorService executorService, boolean shutdownExecutor, final int connectionTimeout) { > this.address = address; > this.port = port; > this.handler = handler; >@@ -74,6 +86,7 @@ public class ClientConfigurationImpl implements ModelControllerClientConfigurati > this.sslContext = sslContext; > this.executorService = executorService; > this.shutdownExecutor = shutdownExecutor; >+ this.connectionTimeout = connectionTimeout > 0 ? connectionTimeout : DEFAULT_CONNECTION_TIMEOUT; > } > > @Override >@@ -103,7 +116,7 @@ public class ClientConfigurationImpl implements ModelControllerClientConfigurati > > @Override > public int getConnectionTimeout() { >- return 5000; >+ return connectionTimeout; > } > > @Override >@@ -113,7 +126,7 @@ public class ClientConfigurationImpl implements ModelControllerClientConfigurati > > @Override > public void close() { >- if(shutdownExecutor && executorService != null) { >+ if (shutdownExecutor && executorService != null) { > executorService.shutdown(); > } > } >@@ -122,33 +135,46 @@ public class ClientConfigurationImpl implements ModelControllerClientConfigurati > return new ClientConfigurationImpl(address.getHostName(), port, null, null, null, createDefaultExecutor(), true); > } > >- public static ModelControllerClientConfiguration create(final InetAddress address, final int port, final CallbackHandler handler){ >+ public static ModelControllerClientConfiguration create(final InetAddress address, final int port, >+ final CallbackHandler handler) { > return new ClientConfigurationImpl(address.getHostName(), port, handler, null, null, createDefaultExecutor(), true); > } > >- public static ModelControllerClientConfiguration create(final InetAddress address, final int port, final CallbackHandler handler, final Map<String, String> saslOptions){ >- return new ClientConfigurationImpl(address.getHostName(), port, handler, saslOptions, null, createDefaultExecutor(), true); >+ public static ModelControllerClientConfiguration create(final InetAddress address, final int port, >+ final CallbackHandler handler, final Map<String, String> saslOptions) { >+ return new ClientConfigurationImpl(address.getHostName(), port, handler, saslOptions, null, createDefaultExecutor(), >+ true); > } > > public static ModelControllerClientConfiguration create(final String hostName, final int port) throws UnknownHostException { > return new ClientConfigurationImpl(hostName, port, null, null, null, createDefaultExecutor(), true); > } > >- public static ModelControllerClientConfiguration create(final String hostName, final int port, final CallbackHandler handler) throws UnknownHostException { >+ public static ModelControllerClientConfiguration create(final String hostName, final int port, final CallbackHandler handler) >+ throws UnknownHostException { > return new ClientConfigurationImpl(hostName, port, handler, null, null, createDefaultExecutor(), true); > } > >- public static ModelControllerClientConfiguration create(final String hostName, final int port, final CallbackHandler handler, final SSLContext sslContext) throws UnknownHostException { >+ public static ModelControllerClientConfiguration create(final String hostName, final int port, >+ final CallbackHandler handler, final SSLContext sslContext) throws UnknownHostException { > return new ClientConfigurationImpl(hostName, port, handler, null, sslContext, createDefaultExecutor(), true); > } > >- public static ModelControllerClientConfiguration create(final String hostName, final int port, final CallbackHandler handler, final Map<String, String> saslOptions) throws UnknownHostException { >+ public static ModelControllerClientConfiguration create(final String hostName, final int port, >+ final CallbackHandler handler, final Map<String, String> saslOptions) throws UnknownHostException { > return new ClientConfigurationImpl(hostName, port, handler, saslOptions, null, createDefaultExecutor(), true); > } > >+ public static ModelControllerClientConfiguration create(final String hostName, final int port, >+ final CallbackHandler handler, final SSLContext sslContext, final int connectionTimeout) >+ throws UnknownHostException { >+ return new ClientConfigurationImpl(hostName, port, handler, null, sslContext, createDefaultExecutor(), true, >+ connectionTimeout); >+ } >+ > private static int getSystemProperty(final String name, final int defaultValue) { > final SecurityManager sm = System.getSecurityManager(); >- if(sm == null) { >+ if (sm == null) { > return Integer.getInteger(name, defaultValue); > } else { > return AccessController.doPrivileged(new PrivilegedAction<Integer>() { >@@ -160,5 +186,4 @@ public class ClientConfigurationImpl implements ModelControllerClientConfigurati > } > } > >- > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 901302
: 681939