Package org.apache.tuscany.sca.monitor

Examples of org.apache.tuscany.sca.monitor.Monitor


    public void testInstalledContribution() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException {
        TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
        Node node = tuscanyRuntime.createNode("myDomain");
       
        Deployer deployer = tuscanyRuntime.getDeployer();
        Monitor monitor = deployer.createMonitor();
        Contribution contribution = deployer.loadContribution(URI.create("foo"), new File("src/test/resources/sample-helloworld-nodeployable.jar").toURI().toURL(), monitor);
        monitor.analyzeProblems();
       
        node.installContribution(contribution, null, true);
        List<String> ics = node.getInstalledContributionURIs();
        Assert.assertEquals(1, ics.size());
        Assert.assertEquals("foo", ics.get(0));
View Full Code Here


        Node node = tuscanyRuntime.createNode("myDomain");
       
        node.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);

        Deployer deployer = tuscanyRuntime.getDeployer();
        Monitor monitor = deployer.createMonitor();
        Composite composite = deployer.loadXMLDocument(new File("src/test/resources/helloworld2.composite").toURI().toURL(), monitor);
        monitor.analyzeProblems();
        composite.setURI("helloworld2.composite");
        node.start("foo", composite);
        List<String> dcs = node.getStartedCompositeURIs("foo");
        Assert.assertEquals(1, dcs.size());
        Assert.assertEquals("helloworld2.composite", dcs.get(0));
View Full Code Here

        List<Contribution> contribution = new ArrayList<Contribution>();
        contribution.add(installedContribution.getContribution());
        contribution.get(0).getDeployables().clear();
        contribution.get(0).getDeployables().add(composite);
       
        Monitor monitor = deployer.createMonitor();
// TODO: is the ContextMonitor neccessary here?        
//        Monitor tcm = monitorFactory.setContextMonitor(monitor);
//        try {
           
            domainComposite = deployer.build(contribution, dependedOnContributions, new HashMap<QName, List<String>>(), monitor);
            monitor.analyzeProblems();

//        } finally {
//            monitorFactory.setContextMonitor(tcm);
//        }
       
View Full Code Here

            monitor.problem(problem);
        }
    }

    public Object read(XMLStreamReader source, ProcessorContext context) throws ContributionReadException, XMLStreamException {
        Monitor monitor = context.getMonitor();
        // Delegate to the processor associated with the element QName
        int event = source.getEventType();
        if (event == XMLStreamConstants.START_DOCUMENT) {
            source.nextTag();
        }
View Full Code Here

     * @param context TODO
     * @return The model
     * @throws ContributionReadException
     */
    public <M> M read(InputStream is, Class<M> type, ProcessorContext context) throws ContributionReadException {
        Monitor monitor = context.getMonitor();
        try {
            XMLStreamReader reader;
            try {
                reader = inputFactory.createXMLStreamReader(is);
                try {
View Full Code Here

            monitor.problem(problem);
        }       
    }

    public WebServiceBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
        Monitor monitor = context.getMonitor();
        // Read a <binding.ws>
        WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
        /*ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
        bindingType.setName(getArtifactType());
        bindingType.setUnresolved(true);
View Full Code Here

    public void resolve(WebServiceBinding model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
       
      if (model == null || !model.isUnresolved())
        return;
      Monitor monitor = context.getMonitor()
      WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
        wsdlDefinition.setUnresolved(true);
        wsdlDefinition.setNamespace(model.getNamespace());
        wsdlDefinition.setNameOfBindingToResolve(model.getBindingName());
        wsdlDefinition.setNameOfServiceToResolve(model.getServiceName());
View Full Code Here

        }
    }

    public void resolve(WSDLDefinition model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
        if (model == null) return;
        Monitor monitor = context.getMonitor();
        Definition definition = model.getDefinition();
        if (definition != null) {
            for (Object imports : definition.getImports().values()) {
                List importList = (List)imports;
                for (Object i : importList) {
View Full Code Here

        return inputFactory.createXMLEventReader(arg0);
    }

    @Override
    public XMLStreamReader createXMLStreamReader(InputStream arg0, String arg1) throws XMLStreamException {
        Monitor monitor = monitorFactory.getContextMonitor();
        initializeSchemas(monitor);
        if (hasSchemas) {
            return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0, arg1), aggregatedSchema, monitor);
        }else {
            return inputFactory.createXMLStreamReader(arg0, arg1);
View Full Code Here

        }
    }

    @Override
    public XMLStreamReader createXMLStreamReader(InputStream arg0) throws XMLStreamException {
        Monitor monitor = monitorFactory.getContextMonitor();
        initializeSchemas(monitor);
        if (hasSchemas) {
            return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0), aggregatedSchema, monitor);
        } else {
            return inputFactory.createXMLStreamReader(arg0);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.monitor.Monitor

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.