use of org.apache.cxf.phase.Phase in project cxf by apache.
the class PhaseManagerImpl method createOutPhases.
final void createOutPhases() {
outPhases = new SortedArraySet<Phase>();
int i = 0;
outPhases.add(new Phase(Phase.SETUP, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_LOGICAL, ++i * 1000));
outPhases.add(new Phase(Phase.USER_LOGICAL, ++i * 1000));
outPhases.add(new Phase(Phase.POST_LOGICAL, ++i * 1000));
outPhases.add(new Phase(Phase.PREPARE_SEND, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_STREAM, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_PROTOCOL, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_PROTOCOL_FRONTEND, ++i * 1000));
outPhases.add(new Phase(Phase.WRITE, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_MARSHAL, ++i * 1000));
outPhases.add(new Phase(Phase.MARSHAL, ++i * 1000));
outPhases.add(new Phase(Phase.POST_MARSHAL, ++i * 1000));
outPhases.add(new Phase(Phase.USER_PROTOCOL, ++i * 1000));
outPhases.add(new Phase(Phase.PROTOCOL, ++i * 1000));
outPhases.add(new Phase(Phase.POST_PROTOCOL, ++i * 1000));
outPhases.add(new Phase(Phase.USER_STREAM, ++i * 1000));
outPhases.add(new Phase(Phase.POST_STREAM, ++i * 1000));
outPhases.add(new Phase(Phase.SEND, ++i * 1000));
// Make sure ending interceptors are put in positions symmetric
// to their starting interceptors
outPhases.add(new Phase(Phase.SEND_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.POST_STREAM_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.USER_STREAM_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.POST_PROTOCOL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.USER_PROTOCOL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.MARSHAL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.WRITE_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_PROTOCOL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_STREAM_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.PREPARE_SEND_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.POST_LOGICAL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.USER_LOGICAL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.PRE_LOGICAL_ENDING, ++i * 1000));
outPhases.add(new Phase(Phase.SETUP_ENDING, ++i * 1000));
}
use of org.apache.cxf.phase.Phase in project cxf by apache.
the class PhaseManagerImpl method createInPhases.
final void createInPhases() {
int i = 0;
inPhases = new SortedArraySet<Phase>();
inPhases.add(new Phase(Phase.RECEIVE, ++i * 1000));
inPhases.add(new Phase(Phase.PRE_STREAM, ++i * 1000));
inPhases.add(new Phase(Phase.USER_STREAM, ++i * 1000));
inPhases.add(new Phase(Phase.POST_STREAM, ++i * 1000));
inPhases.add(new Phase(Phase.READ, ++i * 1000));
inPhases.add(new Phase(Phase.PRE_PROTOCOL, ++i * 1000));
inPhases.add(new Phase(Phase.PRE_PROTOCOL_FRONTEND, ++i * 1000));
inPhases.add(new Phase(Phase.USER_PROTOCOL, ++i * 1000));
inPhases.add(new Phase(Phase.PROTOCOL, ++i * 1000));
inPhases.add(new Phase(Phase.POST_PROTOCOL, ++i * 1000));
inPhases.add(new Phase(Phase.PRE_UNMARSHAL, ++i * 1000));
inPhases.add(new Phase(Phase.UNMARSHAL, ++i * 1000));
inPhases.add(new Phase(Phase.POST_UNMARSHAL, ++i * 1000));
inPhases.add(new Phase(Phase.PRE_LOGICAL, ++i * 1000));
inPhases.add(new Phase(Phase.USER_LOGICAL, ++i * 1000));
inPhases.add(new Phase(Phase.POST_LOGICAL, ++i * 1000));
inPhases.add(new Phase(Phase.PRE_INVOKE, ++i * 1000));
inPhases.add(new Phase(Phase.INVOKE, ++i * 1000));
inPhases.add(new Phase(Phase.POST_INVOKE, ++i * 1000));
}
use of org.apache.cxf.phase.Phase in project cxf by apache.
the class SpringBusFactoryTest method testPhases.
@Test
public void testPhases() {
Bus bus = new SpringBusFactory().createBus();
PhaseManager cxfPM = bus.getExtension(PhaseManager.class);
PhaseManager defaultPM = new PhaseManagerImpl();
SortedSet<Phase> cxfPhases = cxfPM.getInPhases();
SortedSet<Phase> defaultPhases = defaultPM.getInPhases();
assertEquals(defaultPhases.size(), cxfPhases.size());
assertTrue(cxfPhases.equals(defaultPhases));
cxfPhases = cxfPM.getOutPhases();
defaultPhases = defaultPM.getOutPhases();
assertEquals(defaultPhases.size(), cxfPhases.size());
assertTrue(cxfPhases.equals(defaultPhases));
}
use of org.apache.cxf.phase.Phase in project cxf by apache.
the class OutgoingChainInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
control = EasyMock.createNiceControl();
phases = new ArrayList<>();
phases.add(new Phase(Phase.SEND, 1000));
empty = new ArrayList<Interceptor<? extends Message>>();
bus = control.createMock(Bus.class);
PhaseManager pm = new PhaseManagerImpl();
EasyMock.expect(bus.getExtension(PhaseManager.class)).andReturn(pm).anyTimes();
service = control.createMock(Service.class);
endpoint = control.createMock(Endpoint.class);
binding = control.createMock(Binding.class);
EasyMock.expect(endpoint.getBinding()).andStubReturn(binding);
MessageImpl m = new MessageImpl();
EasyMock.expect(binding.createMessage()).andStubReturn(m);
EasyMock.expect(endpoint.getService()).andReturn(service).anyTimes();
EasyMock.expect(endpoint.getOutInterceptors()).andReturn(empty);
EasyMock.expect(service.getOutInterceptors()).andReturn(empty);
EasyMock.expect(bus.getOutInterceptors()).andReturn(empty);
bopInfo = control.createMock(BindingOperationInfo.class);
opInfo = control.createMock(OperationInfo.class);
mInfo = control.createMock(MessageInfo.class);
bmInfo = control.createMock(BindingMessageInfo.class);
EasyMock.expect(bopInfo.getOperationInfo()).andReturn(opInfo).times(3);
EasyMock.expect(opInfo.getOutput()).andReturn(mInfo);
EasyMock.expect(opInfo.isOneWay()).andReturn(false);
EasyMock.expect(bopInfo.getOutput()).andReturn(bmInfo);
control.replay();
}
use of org.apache.cxf.phase.Phase in project cxf by apache.
the class TestBase method setUp.
@Before
public void setUp() throws Exception {
SortedSet<Phase> phases = new TreeSet<Phase>();
Phase phase1 = new Phase("phase1", 1);
Phase phase2 = new Phase("phase2", 2);
Phase phase3 = new Phase("phase3", 3);
Phase phase4 = new Phase(Phase.WRITE_ENDING, 4);
phases.add(phase1);
phases.add(phase2);
phases.add(phase3);
phases.add(phase4);
phases.add(new Phase(Phase.POST_LOGICAL, 5));
phases.add(new Phase(Phase.INVOKE, 6));
chain = new PhaseInterceptorChain(phases);
soapMessage = TestUtil.createEmptySoapMessage(Soap11.getInstance(), chain);
}
Aggregations