Class ConnectorServer

  • Direct Known Subclasses:
    ConnectorServerImpl

    public abstract class ConnectorServer
    extends Object
    Connector server interface.
    • Constructor Detail

      • ConnectorServer

        public ConnectorServer()
    • Method Detail

      • getPort

        public int getPort()
        Returns the port to listen on.
        Returns:
        The port to listen on.
      • setPort

        public void setPort​(int port)
        Sets the port to listen on.
        Parameters:
        port - The port to listen on
      • getMaxConnections

        public int getMaxConnections()
        Returns the max connections to queue.
        Returns:
        The max connections to queue
      • setMaxConnections

        public void setMaxConnections​(int max)
        Sets the max connections to queue.
        Parameters:
        max - The max connections to queue.
      • getMaxWorkers

        public int getMaxWorkers()
        Returns the max worker threads to allow.
        Returns:
        The max worker threads to allow.
      • setMaxWorkers

        public void setMaxWorkers​(int maxWorkers)
        Sets the max worker thread to allow.
        Parameters:
        maxWorkers - The max worker threads to allow.
      • getMinWorkers

        public int getMinWorkers()
        Returns the min worker threads to allow.
        Returns:
        The min worker threads to allow.
      • setMinWorkers

        public void setMinWorkers​(int minWorkers)
        Sets the min worker thread to allow.
        Parameters:
        minWorkers - The min worker threads to allow.
      • getIfAddress

        public InetAddress getIfAddress()
        Returns the network interface address to bind to. May be null.
        Returns:
        The network interface address to bind to or null.
      • setIfAddress

        public void setIfAddress​(InetAddress addr)
        Sets the interface address to bind to.
        Parameters:
        addr - The network interface address to bind to or null.
      • getUseSSL

        public boolean getUseSSL()
        Returns true if we are to use SSL.
        Returns:
        true if we are to use SSL.
      • setUseSSL

        public void setUseSSL​(boolean ssl)
        Sets whether we should use ssl.
        Parameters:
        ssl - true if we are to use SSL.
      • getKeyHash

        public String getKeyHash()
        Returns the base-64 encoded SHA1 hash of the key.
        Returns:
        the base-64 encoded SHA1 hash of the key.
      • setKeyHash

        public void setKeyHash​(String hash)
        Sets the base-64 encoded SHA1 hash of the key.
        Parameters:
        hash - the base-64 encoded SHA1 hash of the key.
      • getKeyManagers

        public List<KeyManager> getKeyManagers()
        Returns the key managers to use for the SSL connection. If empty, use the JVM default.
        Returns:
        the key managers to use for the SSL connection.
      • setKeyManagers

        public void setKeyManagers​(List<KeyManager> keyManagers)
        Sets the key managers to use for the SSL connection.
        Parameters:
        keyManagers - the key managers to use for the SSL connection. If null or empty, uses the JVM default.
      • getBundleURLs

        public List<URL> getBundleURLs()
        Gets the bundle URLs for connectors to expose by this server.
        Returns:
        The bundle URLs for connectors to expose by this server.
      • setBundleURLs

        public void setBundleURLs​(List<URL> urls)
        Sets the bundle URLs for connectors to expose by this server.
        Parameters:
        urls - The bundle URLs for connectors to expose by this server.
      • getBundleParentClassLoader

        public ClassLoader getBundleParentClassLoader()
        Gets the class loader that will be used as the parent of the bundle class loaders.
        Returns:
        the class loader that will be used as the parent of the bundle class loaders.
      • setBundleParentClassLoader

        public void setBundleParentClassLoader​(ClassLoader bundleParentClassLoader)
        Sets the class loader that will be used as the parent of the bundle class loaders.
        Parameters:
        bundleParentClassLoader - the class loader that will be used as the parent of the bundle class loaders.
      • getStartTime

        public abstract Long getStartTime()
        Gets the time when the servers was started last time.

        System.currentTimeMillis()

        Returns:
        last start dateTime in milliseconds
      • stop

        public abstract void stop()
        Stops the server gracefully. Returns when all in-progress connections have been serviced.
      • isStarted

        public abstract boolean isStarted()
        Return true if the server is started. Note that started is a logical state (start method has been called). It does not necessarily reflect the health of the server
        Returns:
        true if the server is started.
      • awaitStop

        public abstract void awaitStop()
                                throws InterruptedException
        Waits for the server to stop. Similarly to the isStarted() method, this method depends on the server's logical state. The trigger that wakes up waiting threads is a call to the stop() method, not the health of the server.
        Throws:
        InterruptedException - if the waiting thread is interrupted.