Package org.rhq.plugins.perftest.resource

Examples of org.rhq.plugins.perftest.resource.ResourceFactory


        ResourceDiscoveryContext context = new ResourceDiscoveryContext(resourceType, null, null, null, null, null,
            "test", PluginContainerDeployment.AGENT);

        // Test
        ScenarioManager manager = ScenarioManager.getInstance();
        ResourceFactory resourceFactory = manager.getResourceFactory("server-a");
        Set<DiscoveredResourceDetails> resources = resourceFactory.discoverResources(context);

        // Verify
        assert resources != null : "Null set of resources returned from resource factory";
        assert resources.size() == 10 : "Incorrect number of resources returned from resource factory. Expected: 10, Found: "
            + resources.size();
View Full Code Here


        ResourceDiscoveryContext context = new ResourceDiscoveryContext(resourceType, null, null, null, null, null,
            "test", PluginContainerDeployment.AGENT);

        // Test
        ScenarioManager manager = ScenarioManager.getInstance();
        ResourceFactory resourceFactory = manager.getResourceFactory("server-c");
        Set<DiscoveredResourceDetails> resources = resourceFactory.discoverResources(context);

        // Verify
        assert resources != null : "Null set of resources returned from resource factory";
        assert resources.size() == 0 : "Incorrect number of resources returned from resource factory. Expected: 0, Found: "
            + resources.size();
View Full Code Here

        ResourceDiscoveryContext context = new ResourceDiscoveryContext(resourceType, null, null, null, null, null,
            "test", PluginContainerDeployment.AGENT);

        // Test
        ScenarioManager manager = ScenarioManager.getInstance();
        ResourceFactory resourceFactory = manager.getResourceFactory("server-b");
        Set<DiscoveredResourceDetails> resources = resourceFactory.discoverResources(context);

        // Verify
        assert resources != null : "Null set of resources returned from resource factory";
        assert resources.size() == 20 : "Incorrect number of resources returned from resource factory. Expected: 20, Found: "
            + resources.size();
View Full Code Here

     *
     * @return resource factory instance to use to generate the discovery for resources of this type; this will never be
     *         <code>null</code>.
     */
    public ResourceFactory getResourceFactory(String resourceTypeName) {
        ResourceFactory resourceFactory = resourceFactories.get(resourceTypeName);

        // Lazy load the factory
        if (resourceFactory == null) {
            Resource resource = findResource(resourceTypeName);
            if (resource == null) {
View Full Code Here

        ResourceType resourceType = context.getResourceType();

        ScenarioManager manager = ScenarioManager.getInstance();
        Set<DiscoveredResourceDetails> allResourceDetails = null;
        if (manager.isEnabled()) {
            ResourceFactory resourceFactory = manager.getResourceFactory(resourceType.getName());
            allResourceDetails = resourceFactory.discoverResources(context);

            String value = System.getProperty(SYSPROP_DISCOVERY);
            if (value != null) {
                if (value.equalsIgnoreCase("error")) {
                    throw new Exception("The rogue discovery component was configured to throw this exception");
View Full Code Here

        ResourceType resourceType = context.getResourceType();

        ScenarioManager manager = ScenarioManager.getInstance();
        Set<DiscoveredResourceDetails> resourceDetails = null;
        if (manager.isEnabled()) {
            ResourceFactory resourceFactory = manager.getResourceFactory(resourceType.getName());
            if (resourceFactory==null)
                return Collections.emptySet();
           
            resourceDetails = resourceFactory.discoverResources(context);

            // If there is a plugin configuration factory defined, run it on each resource
            ConfigurationFactory configurationFactory = manager.getPluginConfigurationFactory(resourceType.getName());
            if (configurationFactory != null) {
                for (DiscoveredResourceDetails details : resourceDetails) {
View Full Code Here

TOP

Related Classes of org.rhq.plugins.perftest.resource.ResourceFactory

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.