use of org.talend.services.esb.locator.v1.LocatorService in project tesb-rt-se by Talend.
the class ContextListener method contextDestroyed.
/*
* This method is invoked when the Web Application has been removed and is
* no longer able to accept requests
*/
public void contextDestroyed(ServletContextEvent event) {
// Output a simple message to the server's console
System.out.println("The Simple Web App. Has Been Removed");
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/client.xml");
LocatorService client = (LocatorService) context.getBean("locatorService");
String serviceHost = this.context.getInitParameter("serviceHost");
try {
client.unregisterEndpoint(new QName("http://talend.org/esb/examples/", "GreeterService"), serviceHost);
} catch (InterruptedExceptionFault e) {
e.printStackTrace();
} catch (ServiceLocatorFault e) {
e.printStackTrace();
}
this.context = null;
}
use of org.talend.services.esb.locator.v1.LocatorService in project tesb-rt-se by Talend.
the class ContextListener method contextInitialized.
// This method is invoked when the Web Application
// is ready to service requests
public void contextInitialized(ServletContextEvent event) {
this.context = event.getServletContext();
// Output a simple message to the server's console
System.out.println("The Simple Web App. Is Ready");
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/client.xml");
LocatorService client = (LocatorService) context.getBean("locatorService");
String serviceHost = this.context.getInitParameter("serviceHost");
try {
client.registerEndpoint(new QName("http://talend.org/esb/examples/", "GreeterService"), serviceHost, BindingType.SOAP_11, TransportType.HTTP, null);
} catch (InterruptedExceptionFault e) {
e.printStackTrace();
} catch (ServiceLocatorFault e) {
e.printStackTrace();
}
}
Aggregations