Create socket factories for newly resolved addresses. Default
implementation returns a LazySocketFactory wrapping a
PooledSocketFactory wrapping a PlainSocketFactory.
438539
protected SocketFactory createSocketFactory(InetAddress address,
                                                int port,
                                                InetAddress localAddr,
                                                int localPort,
                                                long timeout)
    {
        SocketFactory factory;
        factory = new PlainSocketFactory
            (address, port, localAddr, localPort, timeout);
        factory = new PooledSocketFactory(factory);
        factory = new LazySocketFactory(factory);
        return factory;
    }
818537
public static MfClientHttpRequestFactory createFactoryWrapper(
            final MfClientHttpRequestFactory requestFactory,
            final UriMatchers matchers, final Map<String, List<String>> headers) {
        return new AbstractMfClientHttpRequestFactoryWrapper(requestFactory, matchers, false) {
            @Override
            protected ClientHttpRequest createRequest(
                    final URI uri,
                    final HttpMethod httpMethod,
                    final MfClientHttpRequestFactory requestFactory) throws IOException {
                final ClientHttpRequest request = requestFactory.createRequest(uri, httpMethod);
                request.getHeaders().putAll(headers);
                return request;
            }
        };
    }
525399
public synchronized void buildThriftSocketPool(ClientSocketPoolParameters parameters) {
		if (!ServerUtil.checkHostAndPort(parameters.getHost(), parameters.getPort()))
			throw new IllegalArgumentException("Server host or port is null !");
		SimpleSocketPoolImpl self = selfMap.get(parameters.getKey());
		if (self == null)
			self = init(parameters);
		try {
			for (byte i = 0; i < size; i++) {
				self.socketPool.put(new Byte(i), parameters.buildClientThriftSocket());
				self.socketStatusArray[i] = Boolean.FALSE;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
1060898
function createPlatformFactory(parentPlatformFactory, name, providers) {
    if (providers === void 0) { providers = []; }
    var /** @type {?} */ marker = new InjectionToken("Platform: " + name);
    return function (extraProviders) {
        if (extraProviders === void 0) { extraProviders = []; }
        var /** @type {?} */ platform = getPlatform();
        if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
            if (parentPlatformFactory) {
                parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
            }
            else {
                createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));
            }
        }
        return assertPlatform(marker);
    };
}
895741
public static DefaultConnectionFactory newConnectionFactory(final AbstractLdapProperties l) {
        final ConnectionConfig cc = newConnectionConfig(l);
        final DefaultConnectionFactory bindCf = new DefaultConnectionFactory(cc);
        if (l.getProviderClass() != null) {
            try {
                final Constructor<? extends Provider> constructor = CommonHelper.getConstructor(l.getProviderClass());
                bindCf.setProvider(constructor.newInstance());
            } catch (final Exception e) {
                LOGGER.error(e.getMessage(), e);
            }
        }
        return bindCf;
    }
1069830
private SSLSocketFactory buildSslSocketFactory() {
        try {
            KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
            keyStore.load(null, null);
            keyStore.setCertificateEntry("ca", generateCertificate());

            TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
            tmf.init(keyStore);

            SSLContext context = SSLContext.getInstance("TLSv1.2");
            context.init(null, tmf.getTrustManagers(), null);
            return context.getSocketFactory();

        } catch (Exception e) {
            throw new KubernetesClientException("Failure in generating SSLSocketFactory", e);
        }
    }
424974
@Override
  public final FctBnProcessors<RS>
    lazyGetFctBnProcessors() throws Exception {
    String beanName = getFctBnProcessorsName();
    @SuppressWarnings("unchecked")
    FctBnProcessors<RS> fctBnProcessors = (FctBnProcessors<RS>)
      this.factoryAppBeans.getBeansMap().get(beanName);
    if (fctBnProcessors == null) {
      fctBnProcessors = new FctBnProcessors<RS>();
      SrvEntitiesPage<RS> srvEp = new SrvEntitiesPage<RS>();
      srvEp.setHlpEntitiesPage(this.factoryAppBeans.lazyGetHlpEntitiesPage());
      srvEp.setLogger(this.factoryAppBeans.lazyGetLogger());
      fctBnProcessors.setSrvEntitiesPage(srvEp);
      fctBnProcessors.setSrvOrm(this.factoryAppBeans.lazyGetSrvOrm());
      fctBnProcessors.setI18nRequestHandler(this.factoryAppBeans
        .lazyGetHndlI18nRequest());
      this.factoryAppBeans.getBeansMap().put(beanName, fctBnProcessors);
    }
    return fctBnProcessors;
  }
485704
public static String getDefaultSSLSocketFactory() {
        if (defaultSSLSocketFactory == null) {
            defaultSSLSocketFactory = AccessController.doPrivileged(new PrivilegedAction<String>() {
                @Override
                public String run() {
                    return Security.getProperty("ssl.SocketFactory.provider");
                }
            });
        }

        return defaultSSLSocketFactory;
    }
1104832
public static PooledConnectionFactory newLdaptivePooledConnectionFactory(final AbstractLdapProperties l) {
        val cp = newLdaptiveBlockingConnectionPool(l);
        return new PooledConnectionFactory(cp);
    }
252718
public ClientFactoryBuilder addressResolverGroupFactory(
            Function<? super EventLoopGroup,
                     ? extends AddressResolverGroup<? extends InetSocketAddress>> addressResolverGroupFactory) {
        requireNonNull(addressResolverGroupFactory, "addressResolverGroupFactory");
        checkState(domainNameResolverCustomizers == null,
                   "addressResolverGroupFactory() and domainNameResolverCustomizer() are mutually exclusive.");
        this.addressResolverGroupFactory = addressResolverGroupFactory;
        return this;
    }
214096
private GrpcChannelFactory getChannelFactory() {
        if (this.channelFactory == null) {
            final GrpcChannelFactory factory = this.applicationContext.getBean(GrpcChannelFactory.class);
            this.channelFactory = factory;
            return factory;
        }
        return this.channelFactory;
    }
750465
function createFactory(type) {
    const ret = createElement.bind(null, type);
    ret.type = type;

    return ret;
}
1129430
private AbstractConnectionFactory getCachingConnectionFactory(String queueName,
            List<String> processList) throws RabbitmqCommunicateException
    {
        AbstractConnectionFactory connectionFactory = null;
        try
        {
            connectionFactory = (AbstractConnectionFactory) getContextBuilder().getConnectionFactory(
                    queueName);
        }
        catch (Exception ex)
        {
            throw new RabbitmqCommunicateException(ex);
        }

        String adresses = StringUtils.join(processList, ',');
        connectionFactory.setAddresses(adresses);
        return connectionFactory;
    }
131973
private Socket createSimulatedSocket(SSLSocket socket) {
        SimulatedSocketFactory.configure(socket);
        socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name() } );
        //socket.setEnabledCipherSuites(new String[] { "SSL_RSA_WITH_RC4_128_MD5" });
        return new SimulatedSSLSocket(socket, streamManager);
    }
270704
public SSLSocketFactory createSslSocketFactory() {
        try {
            SSLContext sslContext = SSLContext.getInstance("TLS");
            sslContext.init(null, new TrustManager[]{this}, null);
            return sslContext.getSocketFactory();
        } catch (NoSuchAlgorithmException | KeyManagementException e) {
            throw new AssertionError(e);
        }
    }
785368
@Override
	public DatagramSocket makeObject(SocketAddress socketAddress) throws Exception {
		DatagramSocket datagramSocket = new DatagramSocket();
		datagramSocket.connect(socketAddress);
		return datagramSocket;
	}
866808
@Override
    public java.net.Socket createSocket() throws IOException {
        // This is the code to support outbound ssl config for an unconnected socket.
        // To make this code work, the caller side needs to set either sslProperties by using setSSLPropertiesOnThread
        // or outbound connection info with host/port information by using setOutboundConnectionInfo.
        // Either case, the thread attached information needs to be cleared after creating a socket.
        if (tc.isEntryEnabled())
            Tr.entry(tc, "createSocket");
        javax.net.ssl.SSLSocketFactory currentFactory = default_factory;
        javax.net.ssl.SSLSocket socket = null;
        java.util.Properties sslProps = props;
        if (default_constructor) {
            try {
                java.util.Properties sslPropsOnThread = getSSLPropertiesOnThread();
                java.util.Map<String, Object> currentConnectionInfo = JSSEHelper.getInstance().getOutboundConnectionInfo();
                if ((sslPropsOnThread != null) || (currentConnectionInfo != null)) {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "either SSLProperties on thread or connectionInfo is available.");
                    if (currentConnectionInfo == null) {
                        currentConnectionInfo = new HashMap<String, Object>();
                        currentConnectionInfo.put(Constants.CONNECTION_INFO_DIRECTION, Constants.DIRECTION_OUTBOUND);
                    }
                    sslProps = getProperties(null, currentConnectionInfo, null);
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "Getting SSLSocketFactory");
                    currentFactory = getSSLSocketFactory(currentConnectionInfo, sslProps);
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "Got SSLSocketFactory", new Object[] { currentFactory });
                } else {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "Neither SSLProperties nor outboundConnectionInfo is set and this is an unconnected socket so create a WSSocket.");
                    java.net.Socket ws_socket = (Socket) AccessController.doPrivileged(new PrivilegedAction<Object>() {
                        @Override
                        public Object run() {

                            return (new com.ibm.ws.ssl.config.WSSocket(new java.net.Socket()));
                        }
                    });
                    if (tc.isEntryEnabled())
                        Tr.exit(tc, "createSocket");
                    return ws_socket;
                }

            } catch (Exception e) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Exception getting SSLSocketFactory. Fall back to the default SSLSocketFactory", new Object[] { e });
                FFDCFilter.processException(e, getClass().getName(), "createSocket", this);
                currentFactory = default_factory;
            }
        } else {
            if (tc.isDebugEnabled())
                Tr.debug(tc, "Use default SSLSocketFactory - the default constructor was not used");
        }
        if (currentFactory != null) {
            socket = (javax.net.ssl.SSLSocket) currentFactory.createSocket();
            socket = SSLConfigManager.getInstance().setCipherListOnSocket(sslProps, socket);
        } else
            throw new javax.net.ssl.SSLException("SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a socket and javax.net.ssl.* properties are not set.");

        if (tc.isEntryEnabled())
            Tr.exit(tc, "createSocket");
        return socket;
    }