Author: ffang
Date: Wed Jun 13 20:46:46 2007
New Revision: 547104
URL: http://svn.apache.org/viewvc?view=rev&rev=547104
Log:
[CXF-729] WS_RM samples failed
Modified:
incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
Modified:
incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java?view=diff&rev=547104&r1=547103&r2=547104
==============================================================================
---
incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
(original)
+++
incubator/cxf/trunk/distribution/src/main/release/samples/ws_rm/src/demo/ws_rm/common/MessageLossSimulator.java
Wed Jun 13 20:46:46 2007
@@ -36,7 +36,6 @@
import org.apache.cxf.phase.PhaseInterceptor;
import org.apache.cxf.ws.addressing.AddressingProperties;
import org.apache.cxf.ws.rm.RMContextUtils;
-import org.apache.cxf.ws.rm.RMProperties;
/**
*
@@ -47,8 +46,7 @@
private int appMessageCount;
public MessageLossSimulator() {
- super();
- setPhase(Phase.PREPARE_SEND);
+ super(Phase.PREPARE_SEND);
addBefore(MessageSenderInterceptor.class.getName());
}
@@ -88,39 +86,24 @@
private class WrappedOutputStream extends AbstractWrappedOutputStream {
- public WrappedOutputStream(Message m) {
- super(m);
- // TODO Auto-generated constructor stub
- }
+ private Message outMessage;
- @Override
- protected void doClose() throws IOException {
- // TODO Auto-generated method stub
-
+ public WrappedOutputStream(Message m) {
+ this.outMessage = m;
}
@Override
- protected void doFlush() throws IOException {
- boolean af = alreadyFlushed();
- if (!af) {
- if (LOG.isLoggable(Level.INFO)) {
- RMProperties props =
RMContextUtils.retrieveRMProperties(outMessage, true);
- if (props != null && props.getSequence() != null) {
- BigInteger nr = props.getSequence().getMessageNumber();
- LOG.info("Losing message " + nr);
- }
- }
- resetOut(new DummyOutputStream(), true);
+ protected void onFirstWrite() throws IOException {
+ if (LOG.isLoggable(Level.FINE)) {
+ BigInteger nr =
RMContextUtils.retrieveRMProperties(outMessage, true)
+ .getSequence().getMessageNumber();
+ LOG.fine("Losing message " + nr);
}
+ wrappedStream = new DummyOutputStream();
}
+ }
- @Override
- protected void onWrite() throws IOException {
- // TODO Auto-generated method stub
- }
-
- }
private class DummyOutputStream extends OutputStream {