Examples of PluginContainer


Examples of org.rhq.core.pc.PluginContainer

    // Private  --------------------------------------------

    private Resource discoverPlatform()
            throws Exception
    {
        PluginContainer pc = PluginContainer.getInstance();

        DiscoveryAgentService discovery = pc.getDiscoveryAgentService();

        discovery.executeServerScanImmediately();
        discovery.executeServiceScanImmediately();

        return discovery.getPlatform();
View Full Code Here

Examples of org.rhq.core.pc.PluginContainer

    private void createDatasource(String dsName, String min, String max)
            throws Exception
    {
        LOG.info("########################  Running testCreateService()");
        PluginContainer pc = PluginContainer.getInstance();
        ResourceFactoryAgentService resourceFactoryAgentService = pc.getResourceFactoryAgentService();

        Resource platform = discoverPlatform();
        // There should only be one server.
        Resource as5Server = findServer(SERVER_NAME, platform);
        ResourceType dsType =
                pc.getPluginManager().getMetadataManager().getType("Local Transaction", ResourceCategory.SERVICE);

        //Puts a String, Long String, Integer, Boolean, and Map into the DS config
        Configuration config = new Configuration();
        config.put(new PropertySimple("jndi-name", dsName));
        config.put(new PropertySimple("connection-url", "jdbc:hsqldb:."));
        config.put(new PropertySimple("user-name", "userJoe"));
        config.put(new PropertySimple("password", "password"));
        // Min and Max are not being put into the xml file.
        config.put(new PropertySimple("min-pool-size", min));
        config.put(new PropertySimple("max-pool-size", max));
        config.put(new PropertySimple("driver-class", "org.hsqldb.jdbcDriver"));
        config.put(new PropertySimple("share-prepared-statements", false));
        config.put(new PropertySimple("prepared-statement-cache-size", max));
        config.put(new PropertySimple("new-connection-sql", "Select count(*) from dual;"));

        PropertyMap connectionProperies = new PropertyMap("connectionProperties");
        PropertySimple simple1 = new PropertySimple("ConnProp1", "FirstValue");
        PropertySimple simple2 = new PropertySimple("ConnProp2", "SecondValue");
        connectionProperies.put(simple1);
        connectionProperies.put(simple2);
        config.put(connectionProperies);

        CreateResourceRequest request = new CreateResourceRequest(1, as5Server.getId(), "newResource", dsType.getName(), dsType.getPlugin(), null, config);

        resourceFactoryAgentService.executeCreateResourceImmediately(request);

        platform = discoverPlatform();

        Resource testDs = findService(dsName, SERVER_NAME, platform);

        pc = PluginContainer.getInstance();
        ConfigurationAgentService configService = pc.getConfigurationAgentService();

        Configuration configuration = configService.loadResourceConfiguration(testDs.getId());

        assert configuration.getSimple("jndi-name").getStringValue().equals(dsName) : "Property jndi-name was incorrect";
        assert configuration.getSimple("connection-url").getStringValue().equals("jdbc:hsqldb:hsql://${jboss.bind.address}:1701")
View Full Code Here

Examples of org.rhq.core.pc.PluginContainer

        Resource platform = discoverPlatform();
        Resource deleteMe = findService(dsName, SERVER_NAME, platform);

        assert deleteMe != null : "Could not find datasource to be deleted";

        PluginContainer pc = PluginContainer.getInstance();
        ResourceFactoryAgentService resourceFactoryAgentService = pc.getResourceFactoryAgentService();

        DeleteResourceRequest deleteRequest = new DeleteResourceRequest(1, deleteMe.getId());

        try
        {
            resourceFactoryAgentService.executeDeleteResourceImmediately(deleteRequest);
        }
        catch (PluginContainerException e)
        {
            fail();
        }

        InventoryManager inventoryManager = pc.getInventoryManager();
        assert inventoryManager.getResourceComponent(deleteMe) == null : "Resource component was not deleted from inventory manager";

        Resource deleteMe2 = findService(dsName, SERVER_NAME, platform);

        assert deleteMe2 == null : "found datasource that was supposed to be deleted";
View Full Code Here

Examples of org.rhq.core.pc.PluginContainer

    File pluginDir = new File("target/itest/plugins");
    PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
    pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
    pcConfig.setPluginDirectory(pluginDir);
    pcConfig.setInsideAgent(false);
    PluginContainer container = PluginContainer.getInstance();
    PluginContainer.getInstance().setConfiguration(pcConfig);
    System.out.println("Starting PC...");
    PluginContainer.getInstance().initialize();
    Set<String> pluginNames = PluginContainer.getInstance()
        .getPluginManager().getMetadataManager().getPluginNames();
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.