use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.
the class HandlerChainTester method testHandlersOnReportPort3.
public void testHandlersOnReportPort3() {
Service service = Service.create(WSDL_LOCATION, TESTSERVICE);
ReportService testStub = service.getPort(REPORTSERVICEPORT, ReportService.class);
Binding testBinding = ((BindingProvider) testStub).getBinding();
List<Handler> chain = testBinding.getHandlerChain();
// System.out.println(chain.size());
assertEquals(0, chain.size());
}
use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.
the class HandlerChainTester method testHandlersOnTestPort1.
public void testHandlersOnTestPort1() {
Service service = Service.create(WSDL_LOCATION, TESTSERVICE);
TestService testStub = service.getPort(TestService.class);
Binding testBinding = ((BindingProvider) testStub).getBinding();
List<Handler> chain = testBinding.getHandlerChain();
// System.out.println(chain.size());
assertEquals(0, chain.size());
}
use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.
the class HandlerChainTester method testHandlersOnReportPort.
public void testHandlersOnReportPort() {
TestService_Service service = getService();
ReportService testStub = service.getReportServicePort();
Binding testBinding = ((BindingProvider) testStub).getBinding();
List<Handler> chain = testBinding.getHandlerChain();
// System.out.println(chain.size());
assertEquals(2, chain.size());
}
use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.
the class WSEndpointImpl method dispose.
@Override
public synchronized void dispose() {
if (disposed) {
return;
}
disposed = true;
masterTubeline.preDestroy();
for (Handler handler : binding.getHandlerChain()) {
for (Method method : handler.getClass().getMethods()) {
if (method.getAnnotation(PreDestroy.class) == null) {
continue;
}
try {
method.invoke(handler);
} catch (Exception e) {
logger.log(Level.WARNING, HandlerMessages.HANDLER_PREDESTROY_IGNORE(e.getMessage()), e);
}
break;
}
}
closeManagedObjectManager();
LazyMOMProvider.INSTANCE.unregisterEndpoint(this);
}
use of jakarta.xml.ws.handler.Handler in project metro-jax-ws by eclipse-ee4j.
the class BindingTester method testBinding1.
/*
* test the binding objects for the right number of handlers
*/
public void testBinding1() throws Exception {
TestService_Service service = getService();
TestService testStub = getTestStub(service);
ReportService reportStub = getReportStub(service);
// get the bindings
Binding testBinding = ((BindingProvider) testStub).getBinding();
Binding reportBinding = ((BindingProvider) reportStub).getBinding();
assertNotNull("Binding object should not be null", testBinding);
assertNotNull("Binding object should not be null", reportBinding);
// check the handlers
List<Handler> testHandlers = testBinding.getHandlerChain();
List<Handler> reportHandlers = reportBinding.getHandlerChain();
assertNotNull("Handler list should not be null", testHandlers);
assertNotNull("Handler list should not be null", reportHandlers);
// check number of handlers
assertEquals("got wrong number of handlers in test binding", SERVICE_HANDLERS + TEST_PORT_HANDLERS + PROTOCOL_HANDLERS, testHandlers.size());
assertEquals("got wrong number of handlers in report binding", SERVICE_HANDLERS + REPORT_PORT_HANDLERS + PROTOCOL_HANDLERS, reportHandlers.size());
// check handler names -- see config file for order
int[] testNames = { 4, 0, 5, 1, 7, 3 };
int[] reportNames = { 4, 0, 2, 6, 7, 3 };
String foundName = null;
for (int i = 0; i < testNames.length; i++) {
foundName = ((HasName) testHandlers.get(i)).getName();
assertEquals("found unexpected handler in chain", CLIENT_PREFIX + testNames[i], foundName);
}
for (int i = 0; i < reportNames.length; i++) {
foundName = ((HasName) reportHandlers.get(i)).getName();
assertEquals("found unexpected handler in chain", CLIENT_PREFIX + reportNames[i], foundName);
}
}
Aggregations