public class MockAtomicRequestService extends MockEventfulStandardService {
private boolean doRollback = false;
public void action(Path path, InputData input, OutputData output) throws Exception {
super.action(path, input, output);
ServletAtomicResponseOutputExtension are =
(ServletAtomicResponseOutputExtension)output.narrow(ServletAtomicResponseOutputExtension.class);
ServletOutputData out = (ServletOutputData)output;
out.getResponse().getOutputStream().write(new byte[] {1});
out.getResponse().getWriter().write("Hello, Word!");
if (doRollback) {
are.rollback();
}
}