JettyAxisServerpublic class JettyAxisServer extends Object
Fields Summary |
---|
protected static Log | log | org.mortbay.http.HttpServer | serverJetty HTTP Server * | org.mortbay.http.SocketListener | listenerSocket Listener * | org.mortbay.http.HttpContext | contextHTTP Context |
Constructors Summary |
---|
public JettyAxisServer()
// Create a context
context.setContextPath("/axis/*");
server.addContext(context);
// Create a servlet container
ServletHandler servlets = new ServletHandler();
context.addHandler(servlets);
// Map a servlet onto the container
servlets.addServlet("AdminServlet", "/servlet/AdminServlet",
"org.apache.axis.transport.http.AdminServlet");
servlets.addServlet("AxisServlet", "/servlet/AxisServlet",
"org.apache.axis.transport.http.AxisServlet");
servlets.addServlet("AxisServlet", "/services/*",
"org.apache.axis.transport.http.AxisServlet");
servlets.addServlet("AxisServlet", "*.jws",
"org.apache.axis.transport.http.AxisServlet");
context.addHandler(new ResourceHandler());
|
Methods Summary |
---|
public static void | main(java.lang.String[] args)
Options opts = null;
try {
opts = new Options(args);
} catch (MalformedURLException e) {
log.error(Messages.getMessage("malformedURLException00"), e);
return;
}
JettyAxisServer server = new JettyAxisServer();
server.setPort(opts.getPort());
String dir = opts.isValueSet('d");
if (dir == null) {
// Serve static content from the context
dir = System.getProperty("jetty.home", ".") + "/webapps/axis/";
}
server.setResourceBase(dir);
// Start the http server
try {
server.start();
} catch (Exception e) {
log.error(Messages.getMessage("exception00"), e);
}
| public void | setPort(int port)Set the port
listener.setPort(port);
server.addListener(listener);
| public void | setResourceBase(java.lang.String dir)Set the resource base
context.setResourceBase(dir);
| public void | start()Start the server
server.start();
log.info(
Messages.getMessage("start00", "JettyAxisServer",
new Integer(listener.getServerSocket().getLocalPort()).toString()));
|
|