Search in sources :

Example 1 with LocatorService

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;
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) QName(javax.xml.namespace.QName) LocatorService(org.talend.services.esb.locator.v1.LocatorService) ServiceLocatorFault(org.talend.services.esb.locator.v1.ServiceLocatorFault) InterruptedExceptionFault(org.talend.services.esb.locator.v1.InterruptedExceptionFault)

Example 2 with LocatorService

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();
    }
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) QName(javax.xml.namespace.QName) LocatorService(org.talend.services.esb.locator.v1.LocatorService) ServiceLocatorFault(org.talend.services.esb.locator.v1.ServiceLocatorFault) InterruptedExceptionFault(org.talend.services.esb.locator.v1.InterruptedExceptionFault)

Aggregations

QName (javax.xml.namespace.QName)2 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)2 InterruptedExceptionFault (org.talend.services.esb.locator.v1.InterruptedExceptionFault)2 LocatorService (org.talend.services.esb.locator.v1.LocatorService)2 ServiceLocatorFault (org.talend.services.esb.locator.v1.ServiceLocatorFault)2