nl.surfnet.coin.mock
Class MockHandler

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.util.component.AggregateLifeCycle
          extended by org.eclipse.jetty.server.handler.AbstractHandler
              extended by nl.surfnet.coin.mock.MockHandler
All Implemented Interfaces:
org.eclipse.jetty.server.Handler, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle

public class MockHandler
extends org.eclipse.jetty.server.handler.AbstractHandler

MockHandler is a very simple AbstractHandler that returns content based on the configuration in the test classes. This class is NOT thread safe.

Author:
oharsta

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Constructor Summary
MockHandler(org.eclipse.jetty.server.Server server)
          Constructor
 
Method Summary
protected  InputStream getResponseInputStream(String requestURI)
          Return the result of next call
 void handle(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void setResponseResource(org.springframework.core.io.Resource responseResource)
          Set the Resource which contents will be returned as a SOAP response on the next call
 void setResponseResource(org.springframework.core.io.Resource[] responseResource)
           
 
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
destroy, doStart, doStop, dumpThis, getServer, setServer
 
Methods inherited from class org.eclipse.jetty.util.component.AggregateLifeCycle
addBean, dump, dump, dump, dump, dump, dumpStdErr, getBean, getBeans, getBeans, removeBean, removeBeans
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Constructor Detail

MockHandler

public MockHandler(org.eclipse.jetty.server.Server server)
Constructor

Parameters:
server - the Server
Method Detail

getResponseInputStream

protected InputStream getResponseInputStream(String requestURI)
                                      throws IOException
Return the result of next call

Throws:
IOException

setResponseResource

public void setResponseResource(org.springframework.core.io.Resource responseResource)
Set the Resource which contents will be returned as a SOAP response on the next call

Parameters:
responseResource - the responseResource

setResponseResource

public void setResponseResource(org.springframework.core.io.Resource[] responseResource)
Parameters:
responseResource -

handle

public void handle(String target,
                   org.eclipse.jetty.server.Request baseRequest,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws IOException,
                   javax.servlet.ServletException
Throws:
IOException
javax.servlet.ServletException


Copyright © 2012. All Rights Reserved.