com.noelios.restlet.ext.jetty
Class JettyHandler
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.handler.AbstractHandler
com.noelios.restlet.ext.jetty.JettyHandler
- All Implemented Interfaces:
- org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler
public class JettyHandler
- extends org.mortbay.jetty.handler.AbstractHandler
Jetty handler that knows how to convert Jetty calls into Restlet calls. This
handler isn't a full server, if you use it you need to manually setup the
Jetty server connector and add this handler to a Jetty server.
- Author:
- Valdis Rigdon, Jerome Louvel
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle |
org.mortbay.component.LifeCycle.Listener |
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler |
_string |
Fields inherited from class org.mortbay.component.AbstractLifeCycle |
_listeners |
Fields inherited from interface org.mortbay.jetty.Handler |
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST |
Method Summary |
protected void |
doStart()
|
protected void |
doStop()
|
void |
handle(java.lang.String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
Handles a Jetty call by converting it to a Restlet call and giving it for
processing to the Restlet server. |
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler |
destroy, getServer, setServer, toString |
Methods inherited from class org.mortbay.component.AbstractLifeCycle |
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mortbay.component.LifeCycle |
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
JettyHandler
public JettyHandler(Server server)
- Constructor for HTTP server connectors.
- Parameters:
server
- Restlet HTTP server connector.
JettyHandler
public JettyHandler(Server server,
boolean secure)
- Constructor for HTTP server connectors.
- Parameters:
server
- Restlet server connector.secure
- Indicates if the server supports HTTP or HTTPS.
doStart
protected void doStart()
throws java.lang.Exception
- Overrides:
doStart
in class org.mortbay.jetty.handler.AbstractHandler
- Throws:
java.lang.Exception
doStop
protected void doStop()
throws java.lang.Exception
- Overrides:
doStop
in class org.mortbay.jetty.handler.AbstractHandler
- Throws:
java.lang.Exception
handle
public void handle(java.lang.String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
throws java.io.IOException,
ServletException
- Handles a Jetty call by converting it to a Restlet call and giving it for
processing to the Restlet server.
- Parameters:
target
- The target of the request, either a URI or a name.request
- The Jetty request.response
- The Jetty response.dispatch
- The Jetty dispatch mode.
- Throws:
java.io.IOException
ServletException
Copyright © 2005-2008 Noelios Technologies.