Examples of ResourceContext


Examples of org.rhq.core.pluginapi.inventory.ResourceContext

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void updateResourceConfigurationWithType() throws Exception {
        //tell the method story as it happens: mock or create dependencies and configure
        //those dependencies to get the method under test to completion.
        ResourceContext mockResourceContext = mock(ResourceContext.class);

        ResourceType mockResourceType = mock(ResourceType.class);
        when(mockResourceContext.getResourceType()).thenReturn(mockResourceType);

        ConfigurationDefinition mockConfigurationDefinition = mock(ConfigurationDefinition.class);
        when(mockResourceType.getResourceConfigurationDefinition()).thenReturn(mockConfigurationDefinition);

        ConfigurationDefinition mockConfigurationDefinitionCopy = mock(ConfigurationDefinition.class);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Test
    public void updateResourceConfigurationWithName() throws Exception {
        //tell the method story as it happens: mock or create dependencies and configure
        //those dependencies to get the method under test to completion.
        ResourceContext mockResourceContext = mock(ResourceContext.class);

        ResourceType mockResourceType = mock(ResourceType.class);
        when(mockResourceContext.getResourceType()).thenReturn(mockResourceType);

        ConfigurationDefinition mockConfigurationDefinition = mock(ConfigurationDefinition.class);
        when(mockResourceType.getResourceConfigurationDefinition()).thenReturn(mockConfigurationDefinition);

        ConfigurationDefinition mockConfigurationDefinitionCopy = mock(ConfigurationDefinition.class);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

    @Override
    public Set<DiscoveredResourceDetails> discoverResources(
            ResourceDiscoveryContext<BaseComponent<?>> context) throws Exception {

        ResourceContext parentContext = context.getParentResourceContext();


        if (!parentContext.getResourceType().getName().equals("Managed Server"))
            return super.discoverResources(context);

        PropertySimple pathProp = parentContext.getPluginConfiguration().getSimple("path");
        String path = pathProp.getStringValue();
        path = path.replaceAll("server-config=","server=");
        path = path + ",core-service=platform-mbean";

        Configuration config = new Configuration();
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

        rt.setName("Deployment");
        Resource resource = new Resource("deployment=" + TEST_WAR_FILE_NAME, TEST_WAR_FILE_NAME, rt); // TODO resource key?
        resource.setUuid(UUID.randomUUID().toString());
        StandaloneASComponent parentComponent = new StandaloneASComponent();
        parentComponent.setConnection(getDomainControllerASConnection());
        ResourceContext context = new ResourceContext(resource, parentComponent, null, null, null, null, null, null,
            null, null, null, null, null, null);
        bc.start(context);

        String bytes_value = uploadToAs(TEST_WAR_PATH);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

        rt.setName("Deployment");
        Resource resource = new Resource("server-group=main-server-group", TEST_WAR_FILE_NAME, rt);
        resource.setUuid(UUID.randomUUID().toString());
        StandaloneASComponent parentComponent = new StandaloneASComponent();
        parentComponent.setConnection(getDomainControllerASConnection());
        ResourceContext context = new ResourceContext(resource, parentComponent, null, null, null, null, null, null,
            null, null, null, null, null, null);
        bc.start(context);

        String bytes_value = uploadToAs(TEST_WAR_PATH);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

     * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
     */
    @Override
    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent<?>> context) {

        ResourceContext parentCtx = context.getParentResourceContext();

        if (!(parentCtx.getParentResourceComponent() instanceof JMXComponent)) {
            return Collections.emptySet();
        }

        JMXComponent<JBossASServerComponent<?>> gparentComponent = (JMXComponent<JBossASServerComponent<?>>) parentCtx.getParentResourceComponent();

        Set<DiscoveredResourceDetails> discovered = super.performDiscovery(context.getDefaultPluginConfiguration(), gparentComponent, context.getResourceType(), false);

        Set<DiscoveredResourceDetails> results = new HashSet<DiscoveredResourceDetails>(discovered.size());

View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

            ResourceDiscoveryComponent resourceDiscoveryComponent = new NothingDiscoveringDiscoveryComponent();
            EventContext eventContext = new EventContextImpl(resource, eventManager);
            AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
            InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
            ResourceContext context = new ResourceContext(resource, parentResourceComponent, parentResourceContext,
                resourceDiscoveryComponent, systemInfo, temporaryDirectory, dataDirectory, pluginContainerName,
                eventContext, operationContext, contentContext, availContext, inventoryContext,
                pluginContainerDeployment);
            component.start(context);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

        log.debug("rdc=" + rdc);

        EventContext eventContext = new EventContextImpl(resource, eventManager);
        AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
        InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
        ResourceContext context = new ResourceContext(resource, component, parentContext, resourceDiscoveryComponent,
            systemInfo, temporaryDirectory, dataDirectory, pluginContainerName, eventContext, operationContext,
            contentContext, availContext, inventoryContext, pluginContainerDeployment);
        ResourceDiscoveryContext resourceDiscoveryContext = new ResourceDiscoveryContext(resourceType, component,
            context, systemInfo, Collections.emptyList(), Collections.emptyList(), pluginContainerName,
            pluginContainerDeployment);
        Assert.assertNotNull(context.getEventContext());
        Set<DiscoveredResourceDetails> d = rdc.discoverResources(resourceDiscoveryContext);
        for (DiscoveredResourceDetails drd : d) {
            log.debug("discovered " + drd);
            createChild(drd, resource, configuration, component, context);
        }
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

        ResourceComponent component = (ResourceComponent) Class.forName(rclassname).newInstance();

        EventContext eventContext = new EventContextImpl(resource, eventManager);
        AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
        InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
        ResourceContext context = new ResourceContext(cresource, parentComponent, parentContext,
            resourceDiscoveryComponent, systemInfo, temporaryDirectory, dataDirectory, pluginContainerName,
            eventContext, operationContext, contentContext, availContext, inventoryContext, pluginContainerDeployment);

        component.start(context);
        components.put(component, cresource);
View Full Code Here

Examples of org.rhq.core.pluginapi.inventory.ResourceContext

        ResourceDiscoveryContext<ApplicationServerComponent<?>> discoveryContext)
        throws InvalidPluginConfigurationException {

        File path = new File(pluginConfig.getSimple(ScriptComponent.PATH_CONFIG_PROP).getStringValue());
        validatePath(path);
        ResourceContext parentResourceContext = discoveryContext.getParentResourceContext();
        File binDir = getServerBinDirectory(parentResourceContext);
        DiscoveredResourceDetails resource = createResourceDetails(discoveryContext, pluginConfig, binDir);
        log.debug("Manually added script service: " + resource);

        return resource;
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.