public abstract class ConnectorServer extends Object
Constructor and Description |
---|
ConnectorServer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
awaitStop()
Waits for the server to stop.
|
ClassLoader |
getBundleParentClassLoader()
Gets the class loader that will be used as the parent of the bundle class
loaders.
|
List<URL> |
getBundleURLs()
Gets the bundle URLs for connectors to expose by this server.
|
InetAddress |
getIfAddress()
Returns the network interface address to bind to.
|
String |
getKeyHash()
Returns the base-64 encoded SHA1 hash of the key.
|
List<KeyManager> |
getKeyManagers()
Returns the key managers to use for the SSL connection.
|
int |
getMaxConnections()
Returns the max connections to queue.
|
int |
getMaxWorkers()
Returns the max worker threads to allow.
|
int |
getMinWorkers()
Returns the min worker threads to allow.
|
int |
getPort()
Returns the port to listen on.
|
abstract Long |
getStartTime()
Gets the time when the servers was started last time.
|
boolean |
getUseSSL()
Returns true if we are to use SSL.
|
abstract boolean |
isStarted()
Return true if the server is started.
|
static ConnectorServer |
newInstance()
Get the singleton instance of the
ConnectorServer . |
void |
setBundleParentClassLoader(ClassLoader bundleParentClassLoader)
Sets the class loader that will be used as the parent of the bundle class
loaders.
|
void |
setBundleURLs(List<URL> urls)
Sets the bundle URLs for connectors to expose by this server.
|
void |
setIfAddress(InetAddress addr)
Sets the interface address to bind to.
|
void |
setKeyHash(String hash)
Sets the base-64 encoded SHA1 hash of the key.
|
void |
setKeyManagers(List<KeyManager> keyManagers)
Sets the key managers to use for the SSL connection.
|
void |
setMaxConnections(int max)
Sets the max connections to queue.
|
void |
setMaxWorkers(int maxWorkers)
Sets the max worker thread to allow.
|
void |
setMinWorkers(int minWorkers)
Sets the min worker thread to allow.
|
void |
setPort(int port)
Sets the port to listen on.
|
void |
setUseSSL(boolean ssl)
Sets whether we should use ssl.
|
abstract void |
start()
Starts the server.
|
abstract void |
stop()
Stops the server gracefully.
|
public static ConnectorServer newInstance()
ConnectorServer
.public int getPort()
public void setPort(int port)
port
- The port to listen onpublic int getMaxConnections()
public void setMaxConnections(int max)
max
- The max connections to queue.public int getMaxWorkers()
public void setMaxWorkers(int maxWorkers)
maxWorkers
- The max worker threads to allow.public int getMinWorkers()
public void setMinWorkers(int minWorkers)
minWorkers
- The min worker threads to allow.public InetAddress getIfAddress()
public void setIfAddress(InetAddress addr)
addr
- The network interface address to bind to or null.public boolean getUseSSL()
public void setUseSSL(boolean ssl)
ssl
- true if we are to use SSL.public String getKeyHash()
public void setKeyHash(String hash)
hash
- the base-64 encoded SHA1 hash of the key.public List<KeyManager> getKeyManagers()
public void setKeyManagers(List<KeyManager> keyManagers)
keyManagers
- the key managers to use for the SSL connection. If null or
empty, uses the JVM default.public List<URL> getBundleURLs()
public void setBundleURLs(List<URL> urls)
urls
- The bundle URLs for connectors to expose by this server.public ClassLoader getBundleParentClassLoader()
public void setBundleParentClassLoader(ClassLoader bundleParentClassLoader)
bundleParentClassLoader
- the class loader that will be used as the parent of the bundle
class loaders.public abstract Long getStartTime()
System.currentTimeMillis()
public abstract void start()
public abstract void stop()
public abstract boolean isStarted()
public abstract void awaitStop() throws InterruptedException
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.InterruptedException
- if the waiting thread is interrupted.Copyright © 2022. All rights reserved.