Returns the connectors used by this ServletContainer.

@param server interval server instance.
@return the connectors used by this servletContainer. Default implementaion retuns a default HTTP connector running on port 8080
487474
protected Connector[] getConnectors(Server server) {
        ServerConnector http = new ServerConnector(server);
        http.setPort(DEFAULT_HTTP_PORT);
        return new Connector[] { http };
    }
1082761
@Override
    protected com.ibm.ws.webcontainer.srt.SRTConnectionContext getConnectionContext() {
        // SRTConnectionContext srt = _threadLocal.get();
        // if (srt == null) {
        // srt = new SRTConnectionContext();
        // _threadLocal.set(srt);
        // }
        // return srt;

        /*
         * TODO: Investigate performance impact of removing thread locals and
         * instead creating a new connection context each time. The threadlocal
         * approach causes problems for requests that go async as a subsequent
         * request may use the same thread and therefore get the same
         * SRTServletRequest instance from the SRTConnectionContext.
         */

        // return new SRTConnectionContext();
        return connContextPool.get();
    }
1047
public static String getServer() {
        final StringBuilder serverBuilder = new StringBuilder(getServerScheme()).append("://").append(getServerHost());
        final String port = getServerPort();
        if (StringUtils.isNotBlank(port) && !"80".equals(port) && !"443".equals(port)) {
            serverBuilder.append(':').append(port);
        }

        return serverBuilder.toString();
    }
887487
private Server __buildServer() {
        Server mServer = new Server();

        // Connectors...
        Connector[] connectors = getConnectors(mServer);
        if (connectors == null || connectors.length == 0)
            throw new RuntimeException("Missing connectors");

        for (Connector connector : connectors) {
            mServer.addConnector(connector);
        }

        ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
        handler.setContextPath("/");
        handler.setResourceBase(System.getProperty("java.io.tmpdir"));

        // Filters...
        for (Map.Entry<String, List<Class<? extends Filter>>> filterEntry : filterMap.entrySet()) {
            for (Class<? extends Filter> filterClass : filterEntry.getValue()) {
                handler.addFilter(filterClass, filterEntry.getKey(), EnumSet.of(DispatcherType.REQUEST));
            }
        }

        // Servlets...
        for (Map.Entry<String, Class<? extends HttpServlet>> servletEntry : servletMap.entrySet()) {
            handler.addServlet(servletEntry.getValue(), servletEntry.getKey());
        }

        // Event listeners...
        for (Class<? extends EventListener> eventListenerClass : servletContextListenerSet) {
            try {
                EventListener eventListener = eventListenerClass.newInstance();
                handler.addEventListener(eventListener);
            } catch (IllegalAccessException | InstantiationException ex) {
                throw new RuntimeException(ex);
            }
        }

        // Error handler...
        if (errorHandler != null)
            handler.setErrorHandler(errorHandler);

        mServer.setHandler(handler);
        return mServer;
    }
667832
public List<String> buildUrls() {
        if (exported) {
            List<ServerConfig> servers = providerConfig.getServer();
            if (servers != null && !servers.isEmpty()) {
                List<String> urls = new ArrayList<String>();
                for (ServerConfig server : servers) {
                    StringBuilder sb = new StringBuilder(200);
                    sb.append(server.getProtocol()).append("://").append(server.getHost())
                        .append(":").append(server.getPort()).append(server.getContextPath())
                        .append(providerConfig.getInterfaceId())
                        .append("?uniqueId=").append(providerConfig.getUniqueId())
                        .append(getKeyPairs("version", "1.0"))
                        .append(getKeyPairs("delay", providerConfig.getDelay()))
                        .append(getKeyPairs("weight", providerConfig.getWeight()))
                        .append(getKeyPairs("register", providerConfig.isRegister()))
                        .append(getKeyPairs("maxThreads", server.getMaxThreads()))
                        .append(getKeyPairs("ioThreads", server.getIoThreads()))
                        .append(getKeyPairs("threadPoolType", server.getThreadPoolType()))
                        .append(getKeyPairs("accepts", server.getAccepts()))
                        .append(getKeyPairs("dynamic", providerConfig.isDynamic()))
                        .append(getKeyPairs(RpcConstants.CONFIG_KEY_RPC_VERSION, Version.RPC_VERSION));
                    urls.add(sb.toString());
                }
                return urls;
            }
        }
        return null;
    }
1045100
public static synchronized PortRange getTcpSourceInstance() {
        if (tcpSourcePortRange == null) {
            tcpSourcePortRange = new PortRange();
            tcpSourcePortRange.init(
                  CoGProperties.getDefault().getTcpSourcePortRange());
        }
        return tcpSourcePortRange;
    }
701629
@Override
    public void connect(String server, int port, Map<String, Object> connectionParams) {
        log.debug("connect server: {} port {} connectionParams {}", new Object[] { server, port, connectionParams });
        connect(server, port, connectionParams, null);
    }
462020
@SuppressWarnings("unused")
    private static MBeanServerConnection getServerConnection(int pid) {

        try {
            JMXServiceURL serviceURL = new JMXServiceURL(connectorAddress(pid));
            return JMXConnectorFactory.connect(serviceURL).getMBeanServerConnection();
        } catch (MalformedURLException ex) {
            throw failed("JMX connection failed", ex);
        } catch (IOException ex) {
            throw failed("JMX connection failed", ex);
        }

    }
43263
public List<ConnectionFactoryResourceType<WebAppType<T>>> getAllConnectionFactory()
   {
      List<ConnectionFactoryResourceType<WebAppType<T>>> list = new ArrayList<ConnectionFactoryResourceType<WebAppType<T>>>();
      List<Node> nodeList = childNode.get("connection-factory");
      for(Node node: nodeList)
      {
         ConnectionFactoryResourceType<WebAppType<T>>  type = new ConnectionFactoryResourceTypeImpl<WebAppType<T>>(this, "connection-factory", childNode, node);
         list.add(type);
      }
      return list;
   }
231275
public static Client getClient(ClientConfig config, String[] servers,
            int port) throws Exception {
        config.setTopologyChangeAware(true); // Set client to be topology-aware
        final Client client = ClientFactory.createClient(config);
        for (String server : servers) {
            // Try connecting servers one by one until we have a success
            try {
                client.createConnection(server.trim(), port);
                break;
            } catch(IOException e) {
                // Only swallow the exceptions from Java network or connection problems
                // Unresolved hostname exceptions will be thrown
            }
        }
        if (client.getConnectedHostList().isEmpty()) {
            throw new Exception("Unable to connect to any servers.");
        }
        return client;
    }
1363185
public static LoadBalancer getDefault(String urls) {
        String[] endpoints = new String[0];
        if (urls != null) {
            endpoints = urls.split(URL_SEP);
        }
        return getDefault(Arrays.asList(endpoints));
    }
525503
public HttpServerActionBuilder server(String httpServer) {
		Assert.notNull(applicationContext, "Citrus application context is not initialized!");
		HttpServerActionBuilder serverAction = new HttpServerActionBuilder(action, applicationContext.getBean(httpServer, Endpoint.class))
				.withApplicationContext(applicationContext);
		return serverAction;
	}
229338
private List<Class<?>> getListenerInterfaces() {
        List<Class<?>> listenerInterfaces = 
            new ArrayList<Class<?>>(Arrays.asList(SERVLET30_LISTENER_INTERFACES));            

        // Condition the HTTP ID Listener on Servlet 3.1 enablement.
    
        if (com.ibm.ws.webcontainer.osgi.WebContainer.getServletContainerSpecLevel() <
            com.ibm.ws.webcontainer.osgi.WebContainer.SPEC_LEVEL_31) {
            return listenerInterfaces;
        }

        // Use reflection for referenced Servlet 3.1 classes.  Those won't load unless
        // Servlet 3.1 is enabled.
            
        Class<?> httpIDListenerInterface;           
        
        try {
            httpIDListenerInterface = Class.forName(HTTP_ID_LISTENER_CLASS_NAME);
        } catch (ClassNotFoundException e) {
            httpIDListenerInterface = null;
        }
            
        if (httpIDListenerInterface != null) {
            listenerInterfaces.add(httpIDListenerInterface);
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Servlet 3.1 is enabled but failed to find the HTTP ID Listener class [ " + HTTP_ID_LISTENER_CLASS_NAME + " ]");
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Supported listener interfaces: " + listenerInterfaces);
        }
               
        return listenerInterfaces;                
    }
800514
public int getPort() {
    final Connector[] connectors = this.server.getConnectors();
    checkState(connectors.length >= 1, "Server must have at least 1 connector");

    // The first connector is created upon initializing the server. That's the one that has the port.
    return connectors[0].getLocalPort();
  }
1234916
static PortComponent getPortComponentByServletLink(String servletLink, Adaptable containerToAdapt) throws UnableToAdaptException {
        return getHighLevelElementByServiceImplBean(servletLink, containerToAdapt, PortComponent.class, LinkType.SERVLET);
    }
1156458
protected ServerSocket getServerSocket() throws SFException
  {
    try
    {
      return new ServerSocket(
          0, // free port
          0, // default number of connections
          InetAddress.getByName("localhost"));
    }
    catch (IOException ex)
    {
      throw new SFException(ex, ErrorCode.NETWORK_ERROR, ex.getMessage());
    }
  }
1102366
public final List<String> getServersDescription() {
    final List<String> result = new ArrayList<String>();
    for (Session session : this.connector.getSessionSet()) {
      InetSocketAddress socketAddress = session.getRemoteSocketAddress();
      int weight = ((MemcachedSession) session).getInetSocketAddressWrapper().getWeight();
      result.add(SystemUtils.getRawAddress(socketAddress) + ":" + socketAddress.getPort()
          + "(weight=" + weight + ")");
    }
    return result;
  }