public InterfaceContract getComponentServiceInterfaceContract() { resolve(); if (interfaceContract == null && service != null) { interfaceContract = service.getInterfaceContract(); } return interfaceContract; }
/** * Generates the javascript proxy for a service. * * @param service * the service for which generation is performed */ public static void generateServiceProxy(final ComponentService service) { JavascriptGenerator.javascript.append(JavascriptGenerator.COMPONENT_CONTEXT + "." + service.getName() + " = new Object();\n"); }
boolean services() throws IOException { if (getNode() == null) { return true; } DomainRegistry reg = ((NodeImpl)getNode()).getEndpointRegistry(); for (Endpoint endpoint : reg.getEndpoints()) { out.println(endpoint.getComponent().getURI() + "/" + endpoint.getService().getName()); for (Binding b : endpoint.getService().getBindings()) { if (!SCABinding.TYPE.equals(b.getType())) { out.println(" " + b.getType().getLocalPart() + " " + b.getURI()); } } } return true; }
/** * Follow a service promotion chain down to the inner most (non composite) * component service. * * @param topCompositeService * @return */ public ComponentService getPromotedComponentService(CompositeService compositeService) { ComponentService componentService = compositeService.getPromotedService(); if (componentService != null) { Service service = componentService.getService(); if (componentService.getName() != null && service instanceof CompositeService) { // Continue to follow the service promotion chain return getPromotedComponentService((CompositeService)service); } else { // Found a non-composite service return componentService; } } else { // No promoted service return null; } }
if (componentService != component.getService(componentService.getName())){ Monitor.error(monitor, this, "DuplicateComponentServiceName", component.getName(), componentService.getName()); if (componentService.getService() != null || componentService.isForCallback()) { continue; Service service = component.getImplementation().getService(componentService.getName()); componentService.setService(service); } else { Monitor.error(monitor, "ServiceNotFoundForComponentService", component.getName(), componentService.getName());
/** * @param component */ public static ComponentService getSingleService(Component component) { ComponentService targetService; List<ComponentService> services = component.getServices(); List<ComponentService> regularServices = new ArrayList<ComponentService>(); for (ComponentService service : services) { if (service.isForCallback()) { continue; } String name = service.getName(); if (!name.startsWith("$") || name.startsWith("$dynamic$")) { regularServices.add(service); } } if (regularServices.size() == 0) { throw new ServiceRuntimeException("No service is declared on component " + component.getURI()); } if (regularServices.size() != 1) { throw new ServiceRuntimeException("More than one service is declared on component " + component.getURI() + ". Service name is required to get the service."); } targetService = regularServices.get(0); return targetService; }
ComponentService service = endpoint.getService(); ComponentReference componentReference = assemblyFactory.createComponentReference(); componentReference.setName("$sca.client$." + service.getName()); componentReference.setCallback(service.getCallback()); componentReference.getTargets().add(service); componentReference.getPolicySets().addAll(service.getPolicySets()); componentReference.getRequiredIntents().addAll(service.getRequiredIntents()); componentReference.getBindings().add(endpoint.getBinding()); InterfaceContract interfaceContract = service.getInterfaceContract(); Service componentTypeService = service.getService(); if (componentTypeService != null && componentTypeService.getInterfaceContract() != null) { interfaceContract = componentTypeService.getInterfaceContract();
if (service.getInterfaceContract() != null && // can be null in unit tests service.getInterfaceContract().getCallbackInterface() != null) { callbackReference.setName(service.getName()); InterfaceContract contract = (InterfaceContract)service.getInterfaceContract().clone(); contract.setInterface(contract.getCallbackInterface()); contract.setCallbackInterface(null); Service implService = service.getService(); if (implService != null) { if (((CompositeService)implService).getPromotedService().isUnresolved() == false){ String referenceName = ((CompositeService)implService).getPromotedService().getName(); ComponentReference promotedReference = ((CompositeService)implService).getPromotedComponent().getReference(referenceName); "PromotedCallbackReferenceNotFound", component.getName(), service.getName(), ((CompositeService)implService).getPromotedComponent().getName(), referenceName); if (service.getCallback() != null && service.getCallback().getBindings().size() > 0) { callbackReference.getBindings().addAll(service.getCallback().getBindings()); } else { List<Binding> serviceBindings = service.getBindings(); for ( Binding serviceBinding: serviceBindings ) { try {
String promote; if (promotedService != null) { if (promotedService.getName() != null) { promote = promotedComponent.getName() + '/' + promotedService.getName(); } else { promote = promotedComponent.getName(); writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), policyProcessor.writePolicies(service)); extensionProcessor.write(service.getInterfaceContract(), writer, context); for (Binding binding : service.getBindings()) { extensionProcessor.write(binding, writer, context); if (service.getCallback() != null) { Callback callback = service.getCallback(); writeStart(writer, CALLBACK, policyProcessor.writePolicies(callback)); .getName()), wire.isReplace() ? new XAttr(Constants.REPLACE, true) : null);
.getInterfaceContract(), targetComponentService.getInterfaceContract())) { if (intentsMatch(reference.getRequiredIntents(), targetComponentService.getRequiredIntents())) { EndpointReference endpointRef = createEndpointRef(component, reference, false); endpointRef.setTargetEndpoint(createEndpoint(targetComponent, targetComponentService, true)); composite.getName().toString(), component.getName(), reference.getName()); String targetName = getComponentServiceName(target.getName()); String bindingName = getBindingName(target.getName()); ComponentService targetComponentService = componentServices.get(targetName); .getInterfaceContract(), targetComponentService.getInterfaceContract())) { for (Binding tmp : targetComponentService.getBindings()) { if (tmp.getName().equals(bindingName)) { targetBinding = tmp; .getInterfaceContract(), targetComponentService.getInterfaceContract())) { if (bindingName != null) { for (Binding tmp : targetComponentService.getBindings()) { if (tmp.getName().equals(bindingName)) { targetBinding = tmp;
List<Endpoint> callbackEndpoints = reference.getCallbackService().getEndpoints(); if (!callbackEndpoints.isEmpty()) { for (EndpointReference endpointReference : reference.getEndpointReferences()){ if ((service.getInterfaceContract() != null) && (service.getInterfaceContract().getCallbackInterface() != null)) { if (reference.getName().equals(service.getName())) { for (Endpoint endpoint : service.getEndpoints()) { for ( EndpointReference callbackEndpointReference : reference.getEndpointReferences()){ if((endpoint.getBinding() == null) &&
monitor.pushContext("Service: " + service.getName()); asyncOperations = (List<Operation>) service.getInterfaceContract().getInterface().getAttributes().get("JAXWS-ASYNC-OPERATIONS"); }catch(Exception e) { "JaxWSClientAsyncMethodsNotAllowed", service, service.getName()); service.getEndpoints().clear(); for (Binding binding : service.getBindings()) { Endpoint endpoint = assemblyFactory.createEndpoint(); endpoint.setComponent(component); endpoint.setBinding(binding); endpoint.setUnresolved(false); service.getEndpoints().add(endpoint);
if (reference.getInterfaceContract() == null || interfaceContractMapper.isCompatibleSubset(reference.getInterfaceContract(), targetComponentService.getInterfaceContract())) { if (intentsMatch(reference.getRequiredIntents(), targetComponentService.getRequiredIntents())) { EndpointReference endpointRef = createEndpointRef(component, reference, false); endpointRef.setTargetEndpoint(createEndpoint(targetComponent, targetComponentService, true)); endpointRef.setTargetEndpoint(createEndpoint(component, target.getName())); endpointRef.setStatus(EndpointReference.Status.WIRED_TARGET_NOT_FOUND); reference.getEndpointReferences().add(endpointRef);
endpoint.getService().isForCallback()){ composite.setName(CALLBACK_ENDPOINT_QNAME); } else { ComponentService service = (ComponentService)endpoint.getService().clone(); component.getServices().add(service); service.getBindings().clear(); service.setInterfaceContract(endpoint.getComponentServiceInterfaceContract()); if (endpoint.getBinding() != null) { Binding binding = (Binding)endpoint.getBinding().clone(); service.getBindings().add(binding); if (service.getCallbackReference() != null) { Callback callback = service.getCallback(); if(callback == null){ callback = assemblyFactory.createCallback(); for (EndpointReference epr : service.getCallbackReference().getEndpointReferences()){ callback.getBindings().add(epr.getBinding()); service.setCallback(callback);
/** * Init the comet binding server-side infrastructure. */ @Override public void start() { String deployedURI = ServletFactory.registerServlet(this.servletHost); endpoint.setDeployedURI(deployedURI); final ComponentService service = this.endpoint.getService(); final Interface serviceInterface = service.getInterfaceContract().getInterface(); JavascriptGenerator.generateServiceProxy(service); for (final Operation operation : serviceInterface.getOperations()) { final String url = "/" + endpoint.getService().getName() + "/" + operation.getName(); CometEndpointManager.add(url, endpoint); CometOperationManager.add(url, operation); JavascriptGenerator.generateMethodProxy(service, operation); } }
reference.getInterfaceContract().getCallbackInterface() != null) { ComponentService callbackService = assemblyFactory.createComponentService(); callbackService.setForCallback(true); callbackService.setName(reference.getName()); try { InterfaceContract contract = (InterfaceContract)reference.getInterfaceContract().clone(); contract.setCallbackInterface(null); contract.setNormalizedWSDLContract(null); callbackService.setInterfaceContract(contract); } catch (CloneNotSupportedException e) { callbackService.setService(implService); if (callbackService.getBindings().isEmpty()) { if (reference.getCallback() != null && reference.getCallback().getBindings().size() > 0) { callbackService.getBindings().addAll(reference.getCallback().getBindings()); } else if (reference.getBindings().size() > 0) { callbackService.getBindings().add(clonedBinding); } catch (CloneNotSupportedException ex) {
List<Operation> opList = service.getService().getInterfaceContract().getInterface().getOperations(); if (service.getInterfaceContract() != null && !isAsIs()) { WebServiceBindingFactory wsFactory = registry.getExtensionPoint(WebServiceBindingFactory.class); WebServiceBinding wsBinding = wsFactory.createWebServiceBinding(); interfaceContract = service.getService().getInterfaceContract();
for (Endpoint ep : componentService.getEndpoints()) { for ( PolicySet ps : new ArrayList<PolicySet>(ep.getPolicySets()) ) { else if ( (componentService.getInterfaceContract() != null ) && (isApplicableToSubject(document, appliesToSubjects, topComposite, componentService.getInterfaceContract().getInterface(), ps))) continue; else if ( isApplicableToSubject(document, appliesToSubjects, topComposite, component, ps))
protected void configure(ComponentService componentService, BuilderContext context) { Service service = componentService.getService(); if (service != null) { configure(componentService, service, null, context); configureBindings(componentService, service, context); } }
for(Endpoint loopCallbackEndpoint : callbackService.getEndpoints()){ if(loopCallbackEndpoint.getBinding().getType().equals(endpointReference.getBinding().getType())){ callbackEndpoint = (RuntimeEndpoint)loopCallbackEndpoint; Callback serviceCallback = endpointReference.getTargetEndpoint().getService().getCallback(); ComponentReference callbackReference = endpointReference.getTargetEndpoint().getService().getCallbackReference(); for (Endpoint endpoint : callbackService.getEndpoints()){ if (endpoint.getBinding().getType().equals(SCABinding.TYPE)){ callbackBinding.setURI(endpoint.getBinding().getURI()); callbackService.getBindings().add(callbackBinding); callbackService.getEndpoints().add(callbackEndpoint);