public HTTPBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException,XMLStreamException { HTTPBinding httpBinding = httpBindingFactory.createHTTPBinding();
/** * Utility methods */ private void addService(WidgetImplementation implementation) { Service widgetService = null; // Resource implementation always provide a single service exposing // the Resource interface, and have no references and properties widgetService = assemblyFactory.createService(); widgetService.setName("Widget"); // Create the Java interface contract for the Resource service JavaInterface javaInterface; try { javaInterface = javaInterfaceFactory.createJavaInterface(Widget.class); } catch (InvalidInterfaceException e) { throw new IllegalArgumentException(e); } JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract(); interfaceContract.setInterface(javaInterface); widgetService.setInterfaceContract(interfaceContract); HTTPBinding binding = httpBindingFactory.createHTTPBinding(); binding.setURI(implementation.getWidgetUri()); widgetService.getBindings().add(binding); implementation.getServices().add(widgetService); }
/** * Utility methods */ private void addService(WidgetImplementation implementation) { Service widgetService = null; // Resource implementation always provide a single service exposing // the Resource interface, and have no references and properties widgetService = assemblyFactory.createService(); widgetService.setName("Widget"); // Create the Java interface contract for the Resource service JavaInterface javaInterface; try { javaInterface = javaInterfaceFactory.createJavaInterface(Widget.class); } catch (InvalidInterfaceException e) { throw new IllegalArgumentException(e); } JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract(); interfaceContract.setInterface(javaInterface); widgetService.setInterfaceContract(interfaceContract); HTTPBinding binding = httpBindingFactory.createHTTPBinding(); binding.setURI(implementation.getWidgetUri()); widgetService.getBindings().add(binding); implementation.getServices().add(widgetService); }