|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread edu.sdsc.inca.Component edu.sdsc.inca.Server
Field Summary | |
static int |
ACCEPT_TIMEOUT
|
static int |
CLIENT_TIMEOUT
|
protected java.lang.String |
hostname
|
protected static org.apache.log4j.Logger |
logger
|
protected int |
port
|
static java.lang.String |
SERVER_OPTS
|
protected boolean |
shutdown
|
protected java.net.ServerSocket |
ssocket
|
protected java.lang.String |
tempPath
|
protected int |
workerCount
|
protected Worker[] |
workers
|
protected WorkQueue |
workQueue
|
Fields inherited from class edu.sdsc.inca.Component |
authenticate, cert, certPath, COMPONENT_OPTS, key, keyPath, logFile, password, trusted, trustedPath |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Server()
|
Method Summary | |
java.lang.String |
getHostname()
Returns the name of the host where this server is running. |
int |
getPort()
Returns the port associated with a Server Object. |
java.lang.String |
getTempPath()
Returns the path where the server stores temporary files. |
java.lang.String |
getUri()
Return the uri for the server. |
int |
getWorkerCount()
Returns the number of worker threads this server uses. |
boolean |
isReady()
Returns true iff the Server is ready to start accepting connections. |
static void |
main(java.lang.String[] args)
A main function to start a generic server. |
void |
run()
Start listening on the specified port for connections. |
void |
setConfiguration(java.util.Properties config)
A convenience function for setting multiple configuration properties at once. |
void |
setHostname(java.lang.String hostname)
Sets the name of the host where this server is running. |
void |
setPort(int port)
Set the port to bind to. |
void |
setTempPath(java.lang.String path)
Sets the directory path where the Server stores temporary files. |
void |
setWorkerCount(int count)
Sets the number of workers the Server uses to handle incoming messages. |
void |
shutdown()
Asks the Server to shutdown. |
Methods inherited from class edu.sdsc.inca.Component |
addTrustedCert, configComponent, createSocket, getAuthenticate, getCertificate, getCertificatePath, getKey, getKeyPath, getLogFile, getPassword, getTrustedCertificates, getTrustedPath, openResourceStream, readCredentials, readVersion, setAuthenticate, setCertificatePath, setKeyPath, setLogFile, setPassword, setTrustedPath |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ACCEPT_TIMEOUT
public static final int CLIENT_TIMEOUT
public static final java.lang.String SERVER_OPTS
protected static org.apache.log4j.Logger logger
protected java.lang.String hostname
protected int port
protected java.lang.String tempPath
protected int workerCount
protected boolean shutdown
protected java.net.ServerSocket ssocket
protected WorkQueue workQueue
protected Worker[] workers
Constructor Detail |
public Server()
Method Detail |
public java.lang.String getHostname()
public int getPort()
public java.lang.String getTempPath()
public java.lang.String getUri()
public int getWorkerCount()
public boolean isReady()
public void run()
public void setConfiguration(java.util.Properties config) throws ConfigurationException
setConfiguration
in class Component
config
- contains server configuration values
ConfigurationException
- on a faulty configuration property valuepublic void setHostname(java.lang.String hostname)
hostname
- A string containing the hostname of the serverpublic void setPort(int port)
port
- port numberpublic void setTempPath(java.lang.String path) throws ConfigurationException
path
- the temporary directory path
ConfigurationException
- if the path can't be read from the classpathpublic void setWorkerCount(int count)
count
- The (positive) worker countpublic void shutdown() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the shutdown is interruptedpublic static void main(java.lang.String[] args)
usage:java edu.sdsc.inca.Server
-a,--auth yes|no Authenticate the connection? -c,--certPath to the server certificate -h,--help Prints a short help and usage statement -i,--init Path to server configuration properties file. -k,--key Path to the server key -h,--hostname Hostname of server if different than what Java discovers -n,--numthreads # of worker threads that the server runs -p,--port The port for the server to listen on -P,--password yes|no Read encryption password from stdin -t,--trusted Path to a directory containing all of the trusted certificates. -T,--taskwait # milliseconds for timing out task I/O -v,--var The directory the server should use to save temp files. Must be an absolute path. -V,--version Print program version and exit. -w,--wait # millisecs between shutdown checks
args
- command line arguments, as above.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |