net.javacrumbs.springws.test.simple
Class LimitingRequestProcessorWrapper
java.lang.Object
net.javacrumbs.springws.test.simple.LimitingRequestProcessorWrapper
- All Implemented Interfaces:
- RequestProcessor, LimitingRequestProcessor
public class LimitingRequestProcessorWrapper
- extends java.lang.Object
- implements RequestProcessor, LimitingRequestProcessor
Request processor wrapper that limits number of processRequest(URI, WebServiceMessageFactory, WebServiceMessage) calls.
If number of calls is higher then maxNumberOfProcessedRequests, wrapped processor is not called and null is returned.
If number of calls is lower then minNumberOfProcessedRequests and verify is called, WsTestException is thrown.
- Author:
- Lukas Krecan
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LimitingRequestProcessorWrapper
public LimitingRequestProcessorWrapper(RequestProcessor wrappedRequestProcessor,
java.lang.String requestProcessorDescription)
processRequest
public org.springframework.ws.WebServiceMessage processRequest(java.net.URI uri,
org.springframework.ws.WebServiceMessageFactory messageFactory,
org.springframework.ws.WebServiceMessage request)
throws java.io.IOException
- Description copied from interface:
RequestProcessor
- Processes the request. It can either validate the request or generate a response based on the request. Can return
null if it does not apply to given request or throw an
exception if appropriate.
- Specified by:
processRequest in interface RequestProcessor
- Returns:
-
- Throws:
java.io.IOException
getNumberOfProcessedRequests
public int getNumberOfProcessedRequests()
verify
public void verify()
throws WsTestException
- Description copied from interface:
LimitingRequestProcessor
- Request processor wrapper that checks number of
RequestProcessor.processRequest(URI, WebServiceMessageFactory, WebServiceMessage) calls.
If number of calls is higher then #maxNumberOfProcessedRequests null is returned.
If number of calls is lower then #minNumberOfProcessedRequests and verify is called, WsTestException is thrown.
- Specified by:
verify in interface LimitingRequestProcessor
- Throws:
WsTestException
getWrappedRequestProcessor
public RequestProcessor getWrappedRequestProcessor()
getMinNumberOfProcessedRequests
public int getMinNumberOfProcessedRequests()
- Specified by:
getMinNumberOfProcessedRequests in interface LimitingRequestProcessor
setMinNumberOfProcessedRequests
public void setMinNumberOfProcessedRequests(int minNumberOfProcessedRequests)
- Specified by:
setMinNumberOfProcessedRequests in interface LimitingRequestProcessor
getMaxNumberOfProcessedRequests
public int getMaxNumberOfProcessedRequests()
- Specified by:
getMaxNumberOfProcessedRequests in interface LimitingRequestProcessor
setMaxNumberOfProcessedRequests
public void setMaxNumberOfProcessedRequests(int maxNumberOfProcessedRequests)
- Specified by:
setMaxNumberOfProcessedRequests in interface LimitingRequestProcessor
setNumberOfProcessedRequests
public void setNumberOfProcessedRequests(int numberOfProcessedRequests)
Copyright © 2011. All Rights Reserved.