public class ResinEmbed
extends java.lang.Object
ResinEmbed resin = new ResinEmbed();
HttpEmbed http = new HttpEmbed(8080);
resin.addPort(http);
WebAppEmbed webApp = new WebAppEmbed("/foo", "/home/ferg/ws/foo");
resin.addWebApp(webApp);
resin.start();
resin.join();
Constructor and Description |
---|
ResinEmbed()
Creates a new resin server.
|
ResinEmbed(java.lang.String configFile)
Creates a new resin server.
|
Modifier and Type | Method and Description |
---|---|
void |
addBean(BeanEmbed bean)
Adds a web bean.
|
void |
addPort(PortEmbed port)
Adds a port to the server, e.g.
|
void |
addScanRoot() |
void |
addWebApp(WebAppEmbed webApplication)
Adds a web-app to the server.
|
void |
close() |
void |
destroy()
Destroys the embedded server
|
protected void |
finalize() |
void |
initializeEnvironment()
Initialize the Resin environment
|
void |
join()
Waits for the Resin process to exit.
|
static void |
main(java.lang.String[] args)
Basic embedding server.
|
void |
removeWebApp(WebAppEmbed webApplication) |
void |
request(java.io.InputStream is,
java.io.OutputStream os)
Sends a HTTP request to the embedded server for testing.
|
java.lang.String |
request(java.lang.String httpRequest)
Sends a HTTP request to the embedded server for testing.
|
void |
request(java.lang.String httpRequest,
java.io.OutputStream os)
Sends a HTTP request to the embedded server for testing.
|
void |
resetLogManager()
Set log handler
|
void |
setConfig(java.lang.String configFile)
Sets the config file
|
void |
setDevelopmentMode(boolean isDevelopment) |
void |
setIgnoreClientDisconnect(boolean isIgnore) |
void |
setIgnoreLock(boolean isIgnoreLock) |
void |
setPorts(PortEmbed[] ports)
Sets a list of ports.
|
void |
setRootDirectory(java.lang.String rootUrl)
Sets the root directory
|
void |
setServerHeader(java.lang.String serverName)
Sets the server header
|
void |
setServerId(java.lang.String id)
Sets the root directory
|
void |
setWebApps(WebAppEmbed[] webApps)
Sets a list of webapps
|
void |
start()
Starts the embedded server
|
void |
stop()
Stops the embedded server
|
public ResinEmbed()
public ResinEmbed(java.lang.String configFile)
public void setRootDirectory(java.lang.String rootUrl)
public void setServerId(java.lang.String id)
public void setConfig(java.lang.String configFile)
public void addPort(PortEmbed port)
port
- the embedded port to add to the serverpublic void setPorts(PortEmbed[] ports)
public void setServerHeader(java.lang.String serverName)
public void addWebApp(WebAppEmbed webApplication)
public void removeWebApp(WebAppEmbed webApplication)
public void setWebApps(WebAppEmbed[] webApps)
public void addBean(BeanEmbed bean)
public void setDevelopmentMode(boolean isDevelopment)
public void setIgnoreClientDisconnect(boolean isIgnore)
public void initializeEnvironment()
public void resetLogManager()
public void addScanRoot()
public void setIgnoreLock(boolean isIgnoreLock)
b
- public void start()
public void stop()
public void join()
public void destroy()
public void close()
public void request(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
is
- input stream containing the HTTP requestos
- output stream to receive the requestjava.io.IOException
public void request(java.lang.String httpRequest, java.io.OutputStream os) throws java.io.IOException
httpRequest
- HTTP request string, e.g. "GET /test.jsp"os
- output stream to receive the requestjava.io.IOException
public java.lang.String request(java.lang.String httpRequest) throws java.io.IOException
httpRequest
- HTTP request string, e.g. "GET /test.jsp"java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception