|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.w3c.jigsaw.http.httpd
The server main class. This class can be used either through its main method, to run a full httpd server, or simply by importing it into your app. This latter possibility allows you to export some of your application state through http.
The server itself uses this to report about memory consumption, running threads, etc.
Field Summary | |
static java.lang.String |
CHECKURL_P
Name of the property indicating the URL of Jigsaw's chekpointer. |
static java.lang.String |
CLIENT_BUFSIZE_P
Nam eof the property giving the client output buffer size. |
static java.lang.String |
CLIENT_DEBUG_P
Name of the property indicating wether client should be debuged. |
static java.lang.String |
CLIENT_FACTORY_P
Name of the property indicating the client factory class. |
static java.lang.String |
CLIENT_PRIORITY_P
Name of the client thread priority property. |
static java.lang.String |
CONFIG_P
Name of the property giving the server's config directory. |
static boolean |
debug
debug flag |
static java.lang.String |
DOCURL_P
Name of the property indicating the URL of Jigsaw's help. |
static java.lang.String |
EDIT_ROOT_P
Name of the property that indicates the root resource for edit. |
static java.lang.String |
FS_SENSITIVITY
Name of the property indicating if the file-system is case sensitive. |
protected java.lang.String |
host
FIXME check The server host name. |
static java.lang.String |
HOST_P
Name of the server host property. |
protected int[] |
instances
|
static java.lang.String |
KEEP_ALIVE_P
Name of the server's keep alive flag. |
static java.lang.String |
KEEP_TIMEOUT_P
Name of the server's connection time out property. |
static java.lang.String |
LOGGER_P
Name of property indicating the logger class to use. |
static int |
MAX_LOADED_STORE
|
static java.lang.String |
MAX_LOADED_STORE_P
Max number of store loaded in memory. |
protected int |
port
FIXME check The server port. |
static java.lang.String |
PORT_P
Name of the server port property. |
protected ObservableProperties |
props
This server set of properties. |
static java.lang.String |
PROPS_P
Name of the property giving the path of the property file. |
static java.lang.String |
PUBLIC_P
Name of the property indicating the public methods allowed on that server. |
static java.lang.String |
REQUEST_TIMEOUT_P
Name of the server's request time out property. |
FramedResource |
root
This server root entity. |
static java.lang.String |
ROOT_CLASS_P
|
static java.lang.String |
ROOT_NAME_P
Name of the property giving the name of the root resource. |
static java.lang.String |
ROOT_P
Name of the property giving the server root directory. |
static java.lang.String |
SERVER_GROUP_P
UNIX - Name of the property that indicates the server group. |
static java.lang.String |
SERVER_SOFTWARE_P
Name of the server software property. |
static java.lang.String |
SERVER_USER_P
UNIX - Name of the property that indicates the server user. |
static java.lang.String |
SHUFFLER_PATH_P
Name of the property giving the shuffler path. |
static java.lang.String |
SPACE_P
Name of the property giving the server space directory. |
java.lang.Thread |
thread
|
EventManager |
timer
|
static java.lang.String |
TRACE_P
Name of the server's trace property. |
static java.lang.String |
TRASHDIR_P
Name of the property indicating the trash directory. |
protected java.net.URL |
url
FIXME check for clones This server URL. |
static java.lang.String |
USE_SM_P
Name of property that indicates if some security manager is required. |
static int |
verscount
The current internal version counter of Jigsaw. |
static java.lang.String |
VERSCOUNT_P
|
static java.lang.String |
version
The current displayed version of Jigsaw. |
Constructor Summary | |
httpd()
Create a new server instance in this process. |
Method Summary | |
boolean |
checkFileSystemSensitivity()
Is the underlying file-system case sensitive ? |
void |
checkpoint()
Checkpoint all cached data, by saving them to disk. |
protected void |
cleanup(boolean restart)
Cleanup the resources associated with this server context. |
ServerHandler |
clone(ServerHandlerManager shm,
java.lang.String id,
ObservableProperties props)
clone this server |
void |
debug(boolean onoff)
Turn debugging on/off for this instance of httpd server. |
java.util.Enumeration |
enumeratePropertySet()
Enumerate all the registered property sets |
void |
errlog(Client client,
java.lang.String msg)
Emit a server error on behalf of some client object. |
void |
errlog(java.lang.Object from,
java.lang.String msg)
The prefered form for reporting errors. |
void |
errlog(Resource from,
java.lang.String msg)
Another nice way of reporting errors from an HTTPResource. |
void |
errlog(java.lang.String msg)
Emit an error on behalf of the server. |
void |
fatal(java.lang.Exception e,
java.lang.String msg)
Emit a fatal error. |
void |
fatal(java.lang.String msg)
Emit a fatal error. |
java.io.File |
getAuthDirectory()
Get this server authentication directory. |
protected java.lang.String |
getBanner()
|
int |
getClientBufferSize()
Get the client's buffer size. |
boolean |
getClientDebug()
Get the client's debug flags from the properties. |
boolean |
getClientKeepConnection()
Does this server wants clients to try keeping connections alive ? |
int |
getClientThreadPriority()
Get the client's threads priority from the properties. |
java.io.File |
getConfigDirectory()
Get this server config directory. |
ResourceReference |
getConfigResource()
get this server config resource |
int |
getConnectionTimeOut()
Get the connection allowed idle time from the properties. |
ResourceContext |
getDefaultContext()
Get the default resource context for that server. |
java.lang.String |
getDocumentationURL()
Get the full URL of Jigsaw's documentation. |
ResourceReference |
getEditRoot()
Get the server's edit root resource. |
java.lang.String |
getHost()
Get this server host name. |
java.lang.String |
getIdentifier()
Get this server identifier. |
java.io.File |
getIndexerDirectory()
Get this server index directory |
IndexersCatalog |
getIndexersCatalog()
get the indexer catalog of this server |
java.net.InetAddress |
getInetAddress()
Get the server inet address |
int |
getLocalPort()
Get the server local port |
Logger |
getLogger()
Get the logger for that server. |
int |
getPort()
Get this server port number. |
ObservableProperties |
getProperties()
Get this server properties. |
Resource |
getPropertySet(java.lang.String name)
Get a property set matching a specific name |
RealmsCatalog |
getRealmsCatalog()
Get this server realm catalog. |
int |
getRequestTimeOut()
Get the request allowed time slice from the properties. |
ResourceSpace |
getResourceSpace()
Get this server resource space |
ResourceStoreManager |
getResourceStoreManager()
Get this server resourcestore manager. |
FramedResource |
getRoot()
Get the server current root resource. |
java.io.File |
getRootDirectory()
Get this server root directory. |
ResourceReference |
getRootReference()
get the resource reference of the root resource of the server |
Shuffler |
getShuffler(Client client)
Get a shuffler for this server's client. |
java.lang.String |
getSoftware()
Get the server software string. |
java.io.File |
getSpaceDir()
Get this server space diretory |
httpdStatistics |
getStatistics()
Get this server statistics. |
java.io.File |
getStoreDirectory()
Get this server store directory. |
java.lang.String |
getTrashDirectory()
Get the tracsh directory |
java.net.URL |
getURL()
Get the server URL. |
void |
initialize(ServerHandlerManager shm,
java.lang.String identifier,
ObservableProperties props)
Initialize a new HTTP server. |
protected void |
initializeProperties()
FIXME protected for now to handle clones Initialize some of the servers instance values from properties. |
protected void |
initializePropertySets()
|
ResourceReference |
loadResource(java.lang.String name)
Lookup the root store for some resource. |
ResourceReference |
loadRoot(java.lang.String name)
Dynamically change the root resource for the server. |
void |
log(Client client,
Request request,
Reply reply,
int nbytes,
long duration)
Emit a log entry. |
void |
log(java.lang.String msg)
Emit a log message. |
static void |
main(java.lang.String[] args)
debugging main |
ReplyInterface |
perform(RequestInterface req)
Perform the given request on behalf of this server. |
boolean |
propertyChanged(java.lang.String name)
The property monitoring implementation. |
void |
registerPropertySet(PropertySet set)
Register a property set to the server. |
void |
restart()
Restart the server properly. |
void |
run()
|
void |
shutdown()
Shutdown the server properly. |
void |
startCheckpoint()
start the automatic checkpoint |
void |
trace(Client client,
java.lang.String msg)
Emit a server trace. |
void |
trace(java.lang.String msg)
Emit a server trace, on behalf of the server itself. |
static void |
usage()
this server's usage |
void |
warning(java.lang.Exception e,
java.lang.String msg)
Emit a warning. |
void |
warning(java.lang.String msg)
Emit a warning. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String version
public static final int verscount
public static final boolean debug
public static final java.lang.String VERSCOUNT_P
public static final java.lang.String SERVER_SOFTWARE_P
This property defaults to Jigsaw/1.0a.
public static final java.lang.String HOST_P
This property defaults to the local host name, although if you want directory listing to work propertly, you might need to provide the full host name (including its domain).
public static final java.lang.String ROOT_P
The server root directory is used to deduce a bunch of defaults properties, when they don't have any specific values.
This property has no defaults.
public static final java.lang.String CONFIG_P
public static final java.lang.String SPACE_P
This property defaults to
public static final java.lang.String PORT_P
This property defaults to 8888
.
public static final java.lang.String TRACE_P
This property defaults to false.
public static final java.lang.String KEEP_ALIVE_P
This property defaults to true.
public static final java.lang.String KEEP_TIMEOUT_P
This property defaults to 10000
milliseconds.
public static final java.lang.String REQUEST_TIMEOUT_P
This property defaults to 60000
.
public static final java.lang.String CLIENT_PRIORITY_P
This property defaults to Thread.NORM_PRIORITY
.
public static final java.lang.String CLIENT_BUFSIZE_P
This property defaults to 8192
.
public static final java.lang.String CLIENT_DEBUG_P
This property defaults to false.
public static final java.lang.String USE_SM_P
This property defaults to
public static final java.lang.String LOGGER_P
org.w3c.jigsaw.core.CommonLogger
, which implements the
common log format.
Property defaults to org.w3c.jigsaw.core.CommonLogger
public static final java.lang.String CLIENT_FACTORY_P
public static final java.lang.String SHUFFLER_PATH_P
This should be an absloute path.
This property has no defaults.
public static final java.lang.String ROOT_NAME_P
This property defaults to root
.
public static final java.lang.String ROOT_CLASS_P
public static final java.lang.String MAX_LOADED_STORE_P
public static final int MAX_LOADED_STORE
public static final java.lang.String PROPS_P
This property defaults to config/httpd.props
.
public static final java.lang.String FS_SENSITIVITY
For obvious security reasons, this property defaults to true.
public static java.lang.String DOCURL_P
public static java.lang.String TRASHDIR_P
public static java.lang.String CHECKURL_P
public static java.lang.String PUBLIC_P
|
separated list of
methods available on that server.
This property defaults to: GET | HEAD | PUT | POST | OPTIONS | DELETE | LINK | UNLINK | TRACE.
public static java.lang.String EDIT_ROOT_P
public static java.lang.String SERVER_USER_P
This property has no default value.
public static java.lang.String SERVER_GROUP_P
This property has no default value.
public java.lang.Thread thread
public EventManager timer
protected int[] instances
protected ObservableProperties props
protected java.lang.String host
protected int port
public FramedResource root
protected java.net.URL url
Constructor Detail |
public httpd()
identifier
- The server's identifier.props
- The server properties.Method Detail |
public boolean propertyChanged(java.lang.String name)
name
- The name of the property that has changed.public ResourceReference loadResource(java.lang.String name)
name
- The name of the resource to lookup in the root store.public void startCheckpoint()
public void checkpoint()
public ResourceReference loadRoot(java.lang.String name)
name
- The name of the new root resource, to be found in the
root resource store.protected void initializeProperties() throws ServerHandlerInitException
public void registerPropertySet(PropertySet set)
propSet
- The property set to register.public java.util.Enumeration enumeratePropertySet()
public Resource getPropertySet(java.lang.String name)
protected void initializePropertySets()
public httpdStatistics getStatistics()
public ObservableProperties getProperties()
public boolean checkFileSystemSensitivity()
public java.lang.String getDocumentationURL()
public java.lang.String getTrashDirectory()
public final boolean getClientDebug()
public final boolean getClientKeepConnection()
public final int getRequestTimeOut()
public final int getConnectionTimeOut()
public final int getClientThreadPriority()
public final int getClientBufferSize()
public java.lang.String getHost()
public int getPort()
public FramedResource getRoot()
public ResourceReference getRootReference()
public Logger getLogger()
public ResourceReference getEditRoot()
public java.net.URL getURL()
public java.lang.String getSoftware()
public int getLocalPort()
public java.lang.String getIdentifier()
public java.net.InetAddress getInetAddress()
public java.io.File getRootDirectory()
public java.io.File getSpaceDir()
public java.io.File getConfigDirectory()
public java.io.File getAuthDirectory()
public java.io.File getStoreDirectory()
public java.io.File getIndexerDirectory()
public IndexersCatalog getIndexersCatalog()
public RealmsCatalog getRealmsCatalog()
public ResourceStoreManager getResourceStoreManager()
public ResourceSpace getResourceSpace()
public ResourceContext getDefaultContext()
protected void cleanup(boolean restart)
restart
- If true the server is restarted
(reinitialized) straight away.public void shutdown()
cleanup(boolean)
public void restart()
reload_properties
- Should we reload the properties from the
property file, or should we just reinitialize from the current set
of properties.cleanup(boolean)
public void debug(boolean onoff)
A
- boolean, true turns debugging on, flase turns it off.public void trace(Client client, java.lang.String msg)
client
- The client object which wants to report the trace.msg
- The trace message.httpd#error
,
log(org.w3c.jigsaw.http.Client, org.w3c.jigsaw.http.Request, org.w3c.jigsaw.http.Reply, int, long)
public void trace(java.lang.String msg)
msg
- The trace the server wants to emit.public void log(Client client, Request request, Reply reply, int nbytes, long duration)
client
- The client whose request is to be logged.request
- The request that has been handled.reply
- The emitted reply.nbytes
- The number of bytes emitted back to the client.duration
- The time it took to process the request.public void log(java.lang.String msg)
msg
- The message to log.public void errlog(Client client, java.lang.String msg)
client
- The client.msg
- The error message.public void errlog(java.lang.String msg)
msg
- The error message.public void errlog(java.lang.Object from, java.lang.String msg)
from
- The object that emited the error.msg
- The error message.public void errlog(Resource from, java.lang.String msg)
from
- The resource that trigered the error.msg
- The error message.public void fatal(java.lang.Exception e, java.lang.String msg)
e
- Any exception that caused the error.msg
- Any additional message.public void fatal(java.lang.String msg)
msg
- Any error messagepublic void warning(java.lang.String msg)
msg
- The warning message.public void warning(java.lang.Exception e, java.lang.String msg)
e
- Any exception.msg
- Any message.public Shuffler getShuffler(Client client)
Shuffler
protected java.lang.String getBanner()
public void run()
public ReplyInterface perform(RequestInterface req) throws ProtocolException, ResourceException
request
- The request to perform.public void initialize(ServerHandlerManager shm, java.lang.String identifier, ObservableProperties props) throws ServerHandlerInitException
identifier
- The string identifying this server's occurence.props
- A set of properties to initialize from.public ServerHandler clone(ServerHandlerManager shm, java.lang.String id, ObservableProperties props) throws ServerHandlerInitException
public ResourceReference getConfigResource()
public static void usage()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |