Package org.objectweb.celtix

Examples of org.objectweb.celtix.Bus


        assertEquals(1, urlList.size());
    }

    public void testInvokeWSDLToJava() throws Exception {
        properties.put("org.objectweb.celtix.BusId", "celtix2");
        Bus bus = Bus.init(null, properties);

        TestRouterManager rm = new TestRouterManager(bus);

        //maven doesn't set java.class.path while eclipse does.
        boolean isClassPathSet = javaClasspath != null
View Full Code Here


        }
    }
   
    public void testInit() throws Exception {
        properties.put("org.objectweb.celtix.BusId", "celtix2");
        Bus bus = Bus.init(null, properties);
       
        TestRouterManager rm = new TestRouterManager(bus);
       
        //maven doesn't set java.class.path while eclipse does.
        boolean isClassPathSet = javaClasspath != null
View Full Code Here

        return seiClassLoader;
    }
   
    public static void main(String[] args) {
        try {
            Bus bus = Bus.init(args);
            RouterManager rm = new RouterManager(bus);
            rm.init();
            bus.run();
        } catch (BusException be) {
            throw new WebServiceException("Could not initialize bus", be);
        }
    }
View Full Code Here

        System.out.println("Starting Server");
        implementor = new GreeterImpl();
        address = "http://localhost:9000/SoapContext/SoapPort";
        Endpoint.publish(address, implementor);
        //register to the bus MBServer       
        Bus bus = Bus.getCurrent();
        MBeanServer mbserver = bus.getInstrumentationManager().getMBeanServer();
        ObjectName name = new ObjectName("org.objectweb.celtix.instrumentation:type=ServerMBean,Bus="
                        + bus.getBusID() + ",name=ServerMBean");
        mbserver.registerMBean(this, name);
    }
View Full Code Here

    /*
     * Create the instrumentation component and register it to instrumentation manager
     */
    public GreeterImpl() {
        in = new GreeterInstrumentation(this);
        Bus bus = Bus.getCurrent();
        im = bus.getInstrumentationManager();
        im.register(in);
    }
View Full Code Here

    private Client() {
    }

    public static void main(String args[]) throws Exception {
       
        Bus bus = Bus.init();
       
        Object implementor = new CallbackImpl();
        String address = "http://localhost:9005/CallbackContext/CallbackPort";
        Endpoint.publish(address, implementor);
       
        if (args.length == 0) {
            System.out.println("please specify wsdl");
            System.exit(1);
        }

        URL wsdlURL;
        File wsdlFile = new File(args[0]);
        if (wsdlFile.exists()) {
            wsdlURL = wsdlFile.toURL();
        } else {
            wsdlURL = new URL(args[0]);
        }
       
        SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
        ServerPortType port = ss.getSOAPPort();
       
        EndpointReferenceType ref =
            EndpointReferenceUtils.getEndpointReference(new WSDLManagerImpl(bus), implementor);
       

        String resp = port.registerCallback(ref);

        System.out.println("Response from server: " + resp);
       
        bus.shutdown(true);
       
        System.exit(0);
    }
View Full Code Here

public class ServerImpl implements ServerPortType  {
   
    public String registerCallback(EndpointReferenceType callback) {
       
        try {
            Bus bus = Bus.init();
            WSDLManager manager = new WSDLManagerImpl(bus);
       
            QName interfaceName = EndpointReferenceUtils.getInterfaceName(callback);
            String wsdlLocation = EndpointReferenceUtils.getWSDLLocation(callback);
            QName serviceName = EndpointReferenceUtils.getServiceName(callback);
            String portString = EndpointReferenceUtils.getPortName(callback);
           
            QName portName = new QName(serviceName.getNamespaceURI(), portString);
           
            StringBuffer seiName = new StringBuffer();
            seiName.append(JAXBUtils.namespaceURIToPackage(interfaceName.getNamespaceURI()));
            seiName.append(".");
            seiName.append(JAXBUtils.nameToIdentifier(interfaceName.getLocalPart(),
                                                      JAXBUtils.IdentifierType.INTERFACE));
           
            Class<?> sei = null;   
            try {
                sei = Class.forName(seiName.toString(),
                                    true, manager.getClass().getClassLoader());
            } catch (ClassNotFoundException ex) {
                ex.printStackTrace();
            }
           
            URL wsdlURL = new URL(wsdlLocation);           
           
            Service service = Service.create(wsdlURL, serviceName);
            CallbackPortType port =  (CallbackPortType)service.getPort(portName, sei);

            System.out.println("Invoking on callback object");
            String resp = port.serverSayHi(System.getProperty("user.name"));
            System.out.println("Response from callback object: " + resp);
 
            bus.shutdown(true);
           
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
View Full Code Here

        for (String p : params) {
            System.out.print(" " + p);           
        }
        System.out.println();
       
        Bus bus = Bus.init();
       
        URL url = GreeterClient.class.getResource("/wsdl/hello_world.wsdl");
        assert null != url;
       
        QName serviceName = new QName("http://objectweb.org/hello_world_soap_http", "SOAPService");
        SOAPService ss = new SOAPService(url, serviceName);
        Greeter port = ss.getSoapPort();
       
        if ("sayHi".equals(operationName)) {
            System.out.println("Invoking sayHi...");
            System.out.println("server responded with: " + port.sayHi());
        } else if ("greetMe".equals(operationName) && params != null && params.length > 0) {
            System.out.println("Invoking greetMe...");
            System.out.println("server responded with: " + port.greetMe(params[0]));
        } else if ("greetMeOneWay".equals(operationName) && params != null && params.length > 0) {
            System.out.println("Invoking greetMeOneWay...");
            port.greetMeOneWay(params[0]);
            System.out.println("no response from server as method is OneWay");
        } else {
            System.err.println("No such operation");
        }
       
       
        bus.shutdown(true);
    }
View Full Code Here

        /**
         * Creation of the endpoint could be part of the bus initialisation
         * based on configuration. For now, do it manually.
         */

        Bus bus = Bus.init(args);
        Runtime.getRuntime().addShutdownHook(
            new Thread(new GreeterServerMain().new TerminationHandler(bus, true)));
        Object implementor = new AnnotatedGreeterImpl();
        String address = "http://loalhost:8080/hello_world_soap_http";
        Endpoint.publish(address, implementor);
        bus.run();
    }
View Full Code Here

    public EndpointReferenceUtilsTest(String arg0) {
        super(arg0);
    }

    public void testGetWSDLDefinitionFromImplementation() throws Exception {
        Bus bus = Bus.init();

        // This implementor is not derived from an SEI and does not implement
        // the Remote interface. It is however annotated with a WebService
        // annotation
        // in which the wsdl location attribute is not set.
        Object implementor = new AnnotatedGreeterNoOverloadImpl();
        WSDLManager manager = bus.getWSDLManager();
        EndpointReferenceType ref = EndpointReferenceUtils
                .getEndpointReference(manager, implementor);

        Definition def = EndpointReferenceUtils.getWSDLDefinition(manager, ref);
        assertNotNull("Could not generate wsdl", def);

        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), ref);
        // FIXME - a soap binding and service/port should have been
        // generated
        // negative test case
        // fail("Did not expect a port to be found. Did someone fix this?");

        assertNotNull("Expected to find a port", port);

        // This implementor is annotated with a WebService annotation that has
        // no
        // wsdl location specified but it is derived from an interface that is
        // annotated with a WebService annotation in which the attribute IS set
        // -
        // to a url that can be resolved because the interface was generated as
        // part
        // of the test build.
        implementor = new DerivedGreeterImpl();
        ref = EndpointReferenceUtils.getEndpointReference(manager, implementor);
        def = EndpointReferenceUtils.getWSDLDefinition(manager, ref);
        assertNotNull("Could not load wsdl", def);

        port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), ref);
        // FIXME - a soap binding and service/port should have been generated
        // negative test case

        // fail("Did not expect a port to be found. Did someone fix this?");

        assertNotNull("Could not find port", port);
        bus.shutdown(true);
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.Bus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.