Sets the {@link SocketConnector} to be used for connections
to the proxy server.

@param connector the connector to use
960646
private void setConnector(final SocketConnector connector) {
        if (connector == null) {
            throw new NullPointerException("connector cannot be null");
        }

        this.connector = connector;
        String className = ProxyFilter.class.getName();

        // Removes an old ProxyFilter instance from the chain
        if (connector.getFilterChain().contains(className)) {
            connector.getFilterChain().remove(className);
        }

        // Insert the ProxyFilter as the first filter in the filter chain builder        
        connector.getFilterChain().addFirst(className, proxyFilter);
    }
1000941
private ServerConnector configureConnector() {
        ServerConnector connector = null;
        if (m_tls) {
            connector = createSSLConnector();
        } else {
            // Unsecured connector
            connector = new ServerConnector(m_jettyServer);
        }
        if (m_restaddr != null) {
            connector.setHost(m_restaddr);
        }
        connector.setPort(m_restport);
        connector.setIdleTimeout(SOCKET_TIMEOUT_MILLIS);
        connector.addBean(new ConnListener());  // invokes registered callbacks, if any
        return connector;
    }
90294
public static void setConnectionFactory(final ConnectionFactory connectionFactory) {
    if (connectionFactory == null)
      CONNECTION_FACTORY = ConnectionFactory.DEFAULT;
    else
      CONNECTION_FACTORY = connectionFactory;
  }
565870
protected B connection(Http2Connection connection) {
        enforceConstraint("connection", "maxReservedStreams", maxReservedStreams);
        enforceConstraint("connection", "server", isServer);
        enforceConstraint("connection", "codec", decoder);
        enforceConstraint("connection", "codec", encoder);

        this.connection = checkNotNull(connection, "connection");

        return self();
    }
295979
@Override
    public void setConnection(RTMPConnection conn) {
        log.trace("Adding connection: {}", conn);
        int id = conn.getId();
        if (id == -1) {
            log.debug("Connection has unsupported id, using session id hash");
            id = conn.getSessionId().hashCode();
        }
        log.debug("Connection id: {} session id hash: {}", conn.getId(), conn.getSessionId().hashCode());
    }
715204
public void setProxy(Proxy proxy)
    {
        if(proxy != null)
        {
            java.net.Proxy p = new java.net.Proxy(java.net.Proxy.Type.HTTP,
                    new InetSocketAddress(proxy.getHost(), proxy.getPort()));
            client.setProxy(p);
        }
        else
            client.setProxy(java.net.Proxy.NO_PROXY);
    }
739350
public void setConnectionNameList(java.util.Collection<String> connectionNameList) {
        if (connectionNameList == null) {
            this.connectionNameList = null;
            return;
        }

        this.connectionNameList = new java.util.ArrayList<String>(connectionNameList);
    }
1294601
public void setConnectionFactory(XAConnectionFactory connectionFactory) {
		this.connectionFactory = connectionFactory;
		setClassName(DirectXAConnectionFactory.class.getName());
		setDriverProperties(new Properties());
	}
1177961
public void setSocket(Socket socket) {
	    if (socket != null)
	    {
	      m_remoteAddress = socket.getInetAddress();
	      this.port = socket.getPort();
	      m_controlThread = new DebugControlConnectionThread(socket, this);
	      m_controlThread.start();
	      executeStartupCommands();
	      m_controlThread.sendMessage("getsettings");

	      m_controlThread.sendMessage("[out-network");
	      //m_controlThread.sendMessage("[out-network-true");
	      String networkTracePortStr = m_controlThread.getMessage();
	      int networkTracePort = Integer.parseInt(networkTracePortStr);
	      if (LOG.isDebugEnabled()) LOG.debug("Received network trace port [" + networkTracePort + "]");
	      
	      try
	      {
	        INetworkOutputConfig config = new INetworkOutputConfig()
	        {
		          @Override
		          public boolean isNetOutputEnabled()
		          {
		            return m_settingsData.netOutEnabled;
		          }

				@Override
				public boolean isGzipEnabled() {
					return m_settingsData.gzipEnabled;
				}
	        };
	        	        
	        m_networkTraceThread2 = new NetworkDataReceiverThread2(
	        							m_remoteAddress,
	        							networkTracePort, 
	        							config
	        							);
	        m_networkTraceThread2.start();
		      setConnectState(ConnectState.CONNECTED);
		      setConnectionStatusMsg(DefaultFactory.getFactory().getMessages().getConnected());
	        
	      } catch (IOException ex)
	      {
	    	  m_traceEvents.add(
	    			  	TraceFactory.createExceptionTraceEvent(
	    			  			org.headlessintrace.rcp.ClientStrings.TRACE_CREATION_ERROR, 
	    			  			ex, 
	    			  			m_remoteAddress, 
	    			  			networkTracePortStr));
	      }
	      
	    } else
	    {
	      setConnectState(ConnectState.DISCONNECTED_ERR);
	    }
	}
274278
protected void removeConnection(ConnectionImpl connection) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "removeConnection", connection);

        synchronized (_connections) {
            _connections.remove(connection);
        }

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "removeConnection");
    }
333372
protected boolean setConnector() {
    if (this.host == null) {
      log.error("No host value set, cannot set up socket connector.");
      return false;
    }
    if (this.port < 0 || this.port > 65535) {
      log.error("Port value is invalid {}.", Integer.valueOf(this.port));
      return false;
    }

    // Disconnect if already connected
    if (this.connector != null) {
      boolean tmp = this.stayConnected;
      this.stayConnected = false;
      this._disconnect();
      this.stayConnected = tmp;
    }

    this.executors = new ExecutorFilter(1);

    this.connector = new NioSocketConnector();
    this.connector.getSessionConfig().setTcpNoDelay(true);
    if (!this.connector.getFilterChain().contains(
        AggregatorSensorProtocolCodecFactory.CODEC_NAME)) {
      this.connector.getFilterChain().addLast(
          AggregatorSensorProtocolCodecFactory.CODEC_NAME,
          new ProtocolCodecFilter(new AggregatorSensorProtocolCodecFactory(
              false)));
    }
    this.connector.getFilterChain().addLast("ExecutorPool", this.executors);

    this.connector.setHandler(this.ioHandler);
    log.debug("Connector set up successfully.");
    return true;
  }
999817
public static void setConnectionLocal(IConnection connection) {
        if (log.isDebugEnabled()) {
            log.debug("Set connection: {} with thread: {}", (connection != null ? connection.getSessionId() : null), Thread.currentThread().getName());
            try {
                StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
                StackTraceElement stackTraceElement = stackTraceElements[2];
                log.debug("Caller: {}.{} #{}", stackTraceElement.getClassName(), stackTraceElement.getMethodName(), stackTraceElement.getLineNumber());
            } catch (Exception e) {
            }
        }
        if (connection != null) {
            connThreadLocal.set(new WeakReference<IConnection>(connection));
            IScope scope = connection.getScope();
            if (scope != null) {
                Thread.currentThread().setContextClassLoader(scope.getClassLoader());
            }
        } else {
            // use null to clear the value
            connThreadLocal.remove();
        }
    }
557841
protected boolean setConnector() {
		if (this.host == null) {
			log.error("No host value set, cannot set up socket connector.");
			return false;
		}
		if (this.port < 0 || this.port > 65535) {
			log.error("Port value is invalid {}.", Integer.valueOf(this.port));
			return false;
		}
		if (this.executors == null) {
			this.executors = new ExecutorFilter(1);
		}
		this.connector = new NioSocketConnector();
		this.connector.getSessionConfig().setWriterIdleTime(
				SolverWorldModelInterface.TIMEOUT_PERIOD /2);
		this.connector.getSessionConfig().setReaderIdleTime(
				(int) Math.ceil(TIMEOUT_PERIOD * 1.1));
		if (!this.connector.getFilterChain().contains(
				WorldModelSolverProtocolCodecFactory.CODEC_NAME)) {
			this.connector.getFilterChain().addLast(
					WorldModelSolverProtocolCodecFactory.CODEC_NAME,
					new ProtocolCodecFilter(
							new WorldModelSolverProtocolCodecFactory(true)));
		}
		this.connector.getFilterChain().addLast("ExecutorPool", this.executors);
		this.connector.setHandler(this.ioHandler);
		log.debug("Connector set up successful.");
		return true;
	}
1020365
@Override
    public void associateConnection( Object connection ) throws ResourceException {
        JcrSessionHandle handle = (JcrSessionHandle)connection;
        if (handle.getManagedConnection() != this) {
            handle.getManagedConnection().removeHandle(handle);
            handle.setManagedConnection(this);
            addHandle(handle);
        }
    }
826984
public void setConnectors(java.util.Collection<Connector> connectors) {
        if (connectors == null) {
            this.connectors = null;
            return;
        }

        this.connectors = new java.util.ArrayList<Connector>(connectors);
    }
143574
public void setConnectorList(java.util.Collection<Connector> connectorList) {
        if (connectorList == null) {
            this.connectorList = null;
            return;
        }

        this.connectorList = new java.util.ArrayList<Connector>(connectorList);
    }
234965
def on_connect(self, connection):
        
        self._sock = connection._sock
        self._buffer = SocketBuffer(self._sock, self.socket_read_size)        
        if connection.decode_responses:
            self.encoding = connection.encoding