本文整理汇总了Java中net.lightbody.bmp.proxy.ProxyServer.setResponseVolatile方法的典型用法代码示例。如果您正苦于以下问题:Java ProxyServer.setResponseVolatile方法的具体用法?Java ProxyServer.setResponseVolatile怎么用?Java ProxyServer.setResponseVolatile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.lightbody.bmp.proxy.ProxyServer
的用法示例。
在下文中一共展示了ProxyServer.setResponseVolatile方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Override
public void start() {
try {
getProperties();
server.setPort(proxyPort);
server.start(requestTimeout);
ProxyServer.setResponseVolatile(responseVolatile);
ProxyServer.setShouldKeepSslConnectionAlive(shouldKeepSslConnectionAlive);
server.setCaptureContent(true);
server.setCaptureBinaryContent(true);
server.addRequestInterceptor(requestInterceptor);
server.addResponseInterceptor(responseInterceptor);
} catch (Exception e) {
throw new ProxyCannotBeStartedException("Starting the proxy server failed.", e);
}
}
示例2: doGetShouldWriteJsonMessage
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Test
public void doGetShouldWriteJsonMessage() throws ServletException, IOException {
//GIVEN request and response
given(resp.getWriter()).willReturn(printWriter);
ProxyServer.setResponseVolatile(true);
//WHEN
underTest.doGet(req, resp);
//THEN
verify(resp).setContentType("application/json");
verify(printWriter).write("{\"responseVolatility\":true}");
}
示例3: doPostShouldCallDoGet
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Test
public void doPostShouldCallDoGet() throws ServletException, IOException {
//GIVEN request and response
given(resp.getWriter()).willReturn(printWriter);
ProxyServer.setResponseVolatile(true);
//WHEN
underTest.doPost(req, resp);
//THEN
verify(resp).setContentType("application/json");
verify(printWriter).write("{\"responseVolatility\":true}");
}
示例4: testDoGetShouldTurnResponseVolatilityOff
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Test
public final void testDoGetShouldTurnResponseVolatilityOff() throws ServletException, IOException {
// GIVEN in setup
ProxyServer.setResponseVolatile(true);
// WHEN
underTest.doGet(request, response);
// THEN
Assert.assertTrue(!ProxyServer.getResponseVolatile());
}
示例5: testDoGetShouldTurnResponseVolatilityOn
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Test
public final void testDoGetShouldTurnResponseVolatilityOn() throws ServletException, IOException {
// GIVEN in setup
ProxyServer.setResponseVolatile(false);
// WHEN
underTest.doGet(request, response);
// THEN
Assert.assertTrue(ProxyServer.getResponseVolatile());
}
示例6: doGet
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Override
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
logger.info(urlAccessLogMessageAssembler.assembleMessage(req, "Response Message Volatility: OFF"));
ProxyServer.setResponseVolatile(false);
}
示例7: doGet
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
@Override
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
logger.info(urlAccessLogMessageAssembler.assembleMessage(req, "Response Message Volatility: ON"));
ProxyServer.setResponseVolatile(true);
}
示例8: setResponseVolatile
import net.lightbody.bmp.proxy.ProxyServer; //导入方法依赖的package包/类
/**
* Global setter of the proxy behaviour. When it is volatile=true,
* the response of the messages will be volatile (can be changed), otherwise not.
* Note1: Requests are always volatile.
* Note2: This global setting can be overwritten per message base, using the request interceptors.
*
* @param responseVolatility must be either true (volatile) or false (not volatile).
*/
public static void setResponseVolatile(boolean responseVolatility) {
ProxyServer.setResponseVolatile(responseVolatility);
}