componentType.getReferences().add(ref); } else if ("provide".equals(name.getLocalPart())) { Service service = factory.createService(); String interfaceName = reader.getAttributeValue(null, "interface"); InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
private void addService(JAXRSImplementation implementation, Class<?> rootResourceClass) { Service service = assemblyFactory.createService(); JavaInterfaceContract contract = javaInterfaceFactory.createJavaInterfaceContract(); JavaInterface javaInterface; try { javaInterface = javaInterfaceFactory.createJavaInterface(rootResourceClass); } catch (InvalidInterfaceException e) { throw new ServiceRuntimeException(e); } contract.setInterface(javaInterface); service.setInterfaceContract(contract); RESTBinding binding = restBindingFactory.createRESTBinding(); // FIXME: The @ApplicationPath is available for JAX-RS 1.1 // binding.setURI("/"); Path path = rootResourceClass.getAnnotation(Path.class); if (path != null) { binding.setURI(path.value()); } service.getBindings().add(binding); service.setName(rootResourceClass.getSimpleName()); implementation.getServices().add(service); }
componentType.getReferences().add(ref); } else if ("service".equals(name.getLocalPart())) { Service service = factory.createService(); String interfaceName = reader.getAttributeValue(null, "interface"); InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
/** * 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); }
public Service createService(Class<?> clazz, Class<?> interfaze, String name) throws InvalidInterfaceException { Service service = assemblyFactory.createService(); JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract(); service.setInterfaceContract(interfaceContract);
service = assemblyFactory.createService(); contract = service; service.setName(getString(reader, Constants.NAME));
service = assemblyFactory.createService(); contract = service; service.setName(getString(reader, Constants.NAME));
javaImplementation.getServices().add(assemblyFactory.createService());
private org.apache.tuscany.sca.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException { org.apache.tuscany.sca.assembly.Service service = assemblyFactory.createService(); service.setName(interfaze.getSimpleName()); JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract(); service.setInterfaceContract(interfaceContract); JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze); service.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass()); service.getInterfaceContract().setCallbackInterface(callbackInterface); } Interface javaInterface = service.getInterfaceContract().getInterface(); javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null); service.getInterfaceContract().setInterface(javaInterface); return service; }
private Service createService(JavaImplementation type, Class<?> clazz, String serviceName, String javaInterfaceName, String wsdlFileName, boolean replace) throws InvalidInterfaceException, IntrospectionException { Service service = assemblyFactory.createService();
PortType partnerRolePT, Collection<WSDLInterface> theInterfaces, Monitor monitor ) throws ContributionResolveException { Service service = assemblyFactory.createService(); WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract(); service.setInterfaceContract(interfaceContract);
PortType partnerRolePT, Collection<WSDLInterface> theInterfaces, Monitor monitor ) throws ContributionResolveException { Service service = assemblyFactory.createService(); WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract(); service.setInterfaceContract(interfaceContract);
/** * Creates a Service for the component type based on its name and Java interface */ public Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException { Service service = assemblyFactory.createService(); JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract(); service.setInterfaceContract(interfaceContract); // Set the name for the service service.setName(name); // Set the call interface and, if present, the callback interface JavaInterface callInterface = javaFactory.createJavaInterface(interfaze); service.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass()); service.getInterfaceContract().setCallbackInterface(callbackInterface); } return service; } // end method createService
implService = assemblyFactory.createService();
implService = assemblyFactory.createService();