private boolean attachDeploymentComposite(Contribution contribution, Reader xml, String location, boolean attached, ProcessorContext context) throws XMLStreamException, ContributionReadException { // Read the composite model Composite composite = deployer.loadXMLDocument(xml, context.getMonitor()); // Replace the deployable composites with the deployment composites // Clear the deployable composites if it's the first deployment composite deployer.attachDeploymentComposite(contribution, composite, attached); if (!attached) { attached = true; } return attached; }
/** * write the endpoint reference into an xml string */ public String toXMLString() throws IOException, XMLStreamException, ContributionWriteException { StringWriter writer = new StringWriter(); XMLStreamWriter streamWriter = xmlOutputFactory.createXMLStreamWriter(writer); staxProcessor.write(endpointReference, streamWriter, new ProcessorContext(registry)); return writer.toString(); }
public PythonImplementation read(final XMLStreamReader r, final ProcessorContext ctx) throws ContributionReadException, XMLStreamException { final String scr = r.getAttributeValue(null, "script"); while(r.hasNext() && !(r.next() == END_ELEMENT && QN.equals(r.getName()))) ; return new PythonImplementation(QN, scr, URI.create(ctx.getContribution().getLocation()).getPath(), contract); }
if (wsdlInterface != null && wsdlInterface.isUnresolved()) { ProcessorContext context = new ProcessorContext(monitor); resolver.addModel(wsdlInterface, context); } catch (InvalidInterfaceException e) { String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "InvalidInterface"); String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "WSDLDefinitionUnresolved");
Monitor monitor = context.getMonitor(); wsdlFileURI = new URI(wsdlInterfaceContract.getLocation()); } catch (Exception ex) { Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", for (Artifact artifact : context.getContribution().getArtifacts()) { if (artifact.getLocation().endsWith(wsdlInterfaceContract.getLocation())){ WSDLDefinition artifactWSDLDefinition = artifact.getModel(); Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", wsdlInterface = newWSDLInterface; } catch (InvalidInterfaceException e) { String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "InvalidInterface"); Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "IncompatibleCallbacks", intrinsicWSDLCallbackInterface.getName().toString(),
Callback callback = null; QName name = null; Monitor monitor = context.getMonitor(); Contribution contribution = context.getContribution(); try { context.setParentModel(contract); context.setParentModel(contract); context.setParentModel(callback);
URL resource = null; URI uri = URI.create(implementation.getLocation()); Artifact parent = context.getArtifact(); if (!uri.isAbsolute()) { if (parent != null && parent.getURI() != null) { error(context.getMonitor(), "ContributionResolveException", resolver, ce); } catch (MalformedURLException e) { ContributionResolveException ce = new ContributionResolveException(e); error(context.getMonitor(), "ContributionResolveException", resolver, ce); error(context.getMonitor(), "CouldNotResolveLocation", resolver, implementation.getLocation());
public WebServiceBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException { Monitor monitor = context.getMonitor(); if (context.getParentModel() instanceof Reference){ try { URI tmpURI = new URI(uri); if ((context.getParentModel() instanceof Callback) && (((Callback)context.getParentModel()).getParentContract() instanceof org.apache.tuscany.sca.assembly.Service)){ error(monitor, "URIFoundForServiceCallback", reader, uri); if (context.getParentModel() instanceof org.apache.tuscany.sca.assembly.Service){ error(monitor, "WSDLServiceOnService", reader, wsdlElement); if (wsdlElement != null && (wsdlElementIsBinding == null || !wsdlElementIsBinding)) { error(monitor, "MustUseWsdlBinding", reader, wsdlElement); String message = context.getMonitor().getMessageString(WebServiceBindingProcessor.class.getName(), "binding-wsxml-validation-messages", "MustUseWsdlBinding");
URI uri = URI.create(contextPath); if (!uri.isAbsolute()) { Artifact parent = context.getArtifact(); if (parent != null && parent.getURI() != null) { URI base = URI.create("/" + parent.getURI());
if (wsdlInterface != null && wsdlInterface.isUnresolved()) { ProcessorContext context = new ProcessorContext(monitor); resolver.addModel(wsdlInterface, context); } catch (InvalidInterfaceException e) { String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "InvalidInterface"); String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "WSDLDefinitionUnresolved");
Monitor monitor = context.getMonitor(); wsdlFileURI = new URI(wsdlInterfaceContract.getLocation()); } catch (Exception ex) { Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", for (Artifact artifact : context.getContribution().getArtifacts()) { if (artifact.getLocation().endsWith(wsdlInterfaceContract.getLocation())){ WSDLDefinition artifactWSDLDefinition = artifact.getModel(); Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", wsdlInterface = newWSDLInterface; } catch (InvalidInterfaceException e) { String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "InvalidInterface"); Monitor.error(context.getMonitor(), WSDLInterfaceProcessor.class.getName(), "interface-wsdlxml-validation-messages", "IncompatibleCallbacks", intrinsicWSDLCallbackInterface.getName().toString(),
Callback callback = null; QName name = null; Monitor monitor = context.getMonitor(); Contribution contribution = context.getContribution(); try { context.setParentModel(contract); context.setParentModel(contract); context.setParentModel(callback);
URL resource = null; URI uri = URI.create(implementation.getLocation()); Artifact parent = context.getArtifact(); if (!uri.isAbsolute()) { if (parent != null && parent.getURI() != null) { error(context.getMonitor(), "ContributionResolveException", resolver, ce); } catch (MalformedURLException e) { ContributionResolveException ce = new ContributionResolveException(e); error(context.getMonitor(), "ContributionResolveException", resolver, ce); error(context.getMonitor(), "CouldNotResolveLocation", resolver, implementation.getLocation());
public WebServiceBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException { Monitor monitor = context.getMonitor(); if (context.getParentModel() instanceof Reference){ try { URI tmpURI = new URI(uri); if ((context.getParentModel() instanceof Callback) && (((Callback)context.getParentModel()).getParentContract() instanceof org.apache.tuscany.sca.assembly.Service)){ error(monitor, "URIFoundForServiceCallback", reader, uri); if (context.getParentModel() instanceof org.apache.tuscany.sca.assembly.Service){ error(monitor, "WSDLServiceOnService", reader, wsdlElement); if (wsdlElement != null && (wsdlElementIsBinding == null || !wsdlElementIsBinding)) { error(monitor, "MustUseWsdlBinding", reader, wsdlElement); String message = context.getMonitor().getMessageString(WebServiceBindingProcessor.class.getName(), "binding-wsxml-validation-messages", "MustUseWsdlBinding");
public <M> M read(URL contributionURL, URI artifactURI, URL artifactUrl, ProcessorContext context, Class<M> type) throws ContributionReadException { Object mo = read(contributionURL, artifactURI, artifactUrl, context); if (type.isInstance(mo)) { return type.cast(mo); } else { UnrecognizedElementException e = new UnrecognizedElementException(null); e.setResourceURI(artifactURI.toString()); error(context.getMonitor(), "UnrecognizedElementException", processors, artifactURI.toString()); throw e; } }
public EndpointReference readEndpointReference(String xml) { try { XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml)); EndpointReference result = refProcessor.read(reader, new ProcessorContext(registry)); reader.close(); return result; } catch (Exception e) { throw new ServiceRuntimeException(e); } }
javaInterfaceContract.setNormalizedWSDLContract(wsdlInterfaceContract); ProcessorContext wsdlContext = new ProcessorContext(javaInterface.getContributionContainingClass(), context.getMonitor()); extensionProcessor.resolve(wsdlInterfaceContract, resolver, wsdlContext);
public void resolve(Composite composite, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { Monitor monitor = context.getMonitor(); try { monitor.pushContext("Composite: " + composite.getName()); composite.getIncludes().set(i, resolved); } else { String message = context.getMonitor().getMessageString(CompositeProcessor.class.getName(), Messages.RESOURCE_BUNDLE, "LocalAttibuteMissmatch"); String message = context.getMonitor().getMessageString(CompositeProcessor.class.getName(), Messages.RESOURCE_BUNDLE, "CompositeNotFound"); resolvePropertyType("composite " + composite.getName().toString(), property, context.getContribution(), context); context.getContribution(), context);
public <M> M read(URL contributionURL, URI artifactURI, URL artifactUrl, ProcessorContext context, Class<M> type) throws ContributionReadException { Object mo = read(contributionURL, artifactURI, artifactUrl, context); if (type.isInstance(mo)) { return type.cast(mo); } else { UnrecognizedElementException e = new UnrecognizedElementException(null); e.setResourceURI(artifactURI.toString()); error(context.getMonitor(), "UnrecognizedElementException", processors, artifactURI.toString()); throw e; } }
public String write(EndpointReference endpointReference) { StringWriter sw = new StringWriter(); try { XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw); refProcessor.write(endpointReference, writer, new ProcessorContext(registry)); writer.flush(); writer.close(); return sw.toString(); } catch (Exception e) { throw new ServiceRuntimeException(e); } } }