Examples of MonitorFactory


Examples of org.apache.tuscany.common.monitor.MonitorFactory

    public static final void main(String[] args) throws Exception {
       
        // Setup Tuscany monitoring to use java.util.logging
        LogManager.getLogManager().readConfiguration(SupplyChainClient.class.getResourceAsStream("/logging.properties"));
        Properties levels = new Properties();
        MonitorFactory monitorFactory = new JavaLoggingMonitorFactory(levels, Level.FINEST, "MonitorMessages");

        // Obtain Tuscany runtime
        TuscanyRuntime tuscany = new TuscanyRuntime("supplychain", null, monitorFactory);

        // Associate the application module component with this thread
View Full Code Here

Examples of org.apache.tuscany.host.MonitorFactory

     * @param mfc class of the desired MonitorFactory type
     * @param props collection of initialization properties
     * @return a configured MonitorFactory instance, or null if the factory could not be instantiated.
     */
    public static MonitorFactory createMonitorFactory(Class<? extends MonitorFactory> mfc, Map<String, Object> props) {
        MonitorFactory mf;
        try {
            mf = mfc.newInstance();
            mf.initialize(props);
        } catch (InstantiationException e) {
            throw new AssertionError(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
        }
View Full Code Here

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

    private boolean loaded = false;
   
    public DefaultJavascriptProxyFactoryExtensionPoint(ExtensionPointRegistry extensionPoints) {
        this.registry = extensionPoints;
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        if (monitorFactory != null) {
                this.monitor = monitorFactory.createMonitor();
        }
    }
View Full Code Here

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

    public DefaultComponentJavaScriptGeneratorExtensionPoint(ExtensionPointRegistry extensionPoints) {
        this.extensionPoints = extensionPoints;
       
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        if (monitorFactory != null) {
                this.monitor = monitorFactory.createMonitor();
        }
    }
View Full Code Here

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

    }

    public void testCalculator() throws Exception {
        ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        Monitor monitor = monitorFactory.createMonitor();
        Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
       
        assertNotNull(problem);
        assertEquals("ReferenceNotFound", problem.getMessageId());
View Full Code Here

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

      // Create extension point registry
        ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
       
        // Create a monitor
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        monitor = monitorFactory.createMonitor();
       
        // Initialize the Tuscany module activators
        ModuleActivatorExtensionPoint moduleActivators = extensionPoints.getExtensionPoint(ModuleActivatorExtensionPoint.class);
        for (ModuleActivator activator: moduleActivators.getModuleActivators()) {
            activator.start(extensionPoints);
View Full Code Here

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

            throw new ServiceRuntimeException(e);
        }
       
        ExtensionPointRegistry registry = runtime.getExtensionPointRegistry();
        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        monitor = monitorFactory.createMonitor();

        // Contribute the given contribution to an in-memory repository
        ContributionService contributionService = runtime.getContributionService();
        URL contributionURL;
        try {
View Full Code Here

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

        this.extensionPoints = extensionPoints;
        this.modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
        XMLInputFactory inputFactory = modelFactories.getFactory(XMLInputFactory.class);
        XMLOutputFactory outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
        UtilityExtensionPoint utilities = this.extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        if (monitorFactory != null)
          this.monitor = monitorFactory.createMonitor();
        this.extensibleStAXProcessor = new ExtensibleStAXArtifactProcessor(this, inputFactory, outputFactory, this.monitor);
    }
View Full Code Here

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

     * @return
     */
    private static Monitor monitor(ExtensionPointRegistry extensionPoints) {
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        if (utilities != null) {
            MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
            if (monitorFactory != null) {
                return monitorFactory.createMonitor();
            }
        }
        return null;
    }
View Full Code Here

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

        // Save the composite activator
        compositeActivator = runtime.getCompositeActivator();

        // save the monitor
        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        monitor = monitorFactory.createMonitor();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.