Package org.jboss.on.embedded.manager

Examples of org.jboss.on.embedded.manager.ResourceManager


        pcConfig.setInsideAgent(false);

        PC.setConfiguration(pcConfig);
        PC.initialize();

        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        resourceManager.discoverResources();
        LOG.info("Successfully initialized Plugin Container");
    }
View Full Code Here


        {
            LOG.info("Loaded Plugin: " + pluginEnvironment.getPluginName());
        }

        LOG.info("Discovering Services");
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        resourceManager.discoverResources();

        LOG.info("===============================================");
    }
View Full Code Here

        }
    }

    private void setResourceAttributes()
    {
        ResourceManager manager = getManager();
        ResourceType resourceType1 = manager.getResourceType("xa-datasource");

        // Find the datasource to be modified and ensure it's there
        Resource datasource1 = getResourceInstance(resourceType1, "RHQDS");

        assert datasource1 != null : "Test datasource could not be retrieved";

        // Rename the JNDI name for that resource

        Configuration configuration1 = manager.getResourceConfiguration(datasource1);
        resourceTypes[0] = resourceType1;
        resources[0] = datasource1;
        configurations[0] = configuration1;

        ResourceType resourceType2 = manager.getResourceType("jms-queue");

        // Find the Queue
        Resource queue2 = getResourceInstance(resourceType2, "EventQueue");

        assert queue2 != null : "Test queue could not be retrieved";

        // Setup the second array elements
        Configuration configuration2 = manager.getResourceConfiguration(queue2);
        resourceTypes[1] = resourceType2;
        resources[1] = queue2;
        configurations[1] = configuration2;

        ResourceType resourceType3 = manager.getResourceType("jms-topic");

        // Find the topic
        Resource topic3 = getResourceInstance(resourceType3, "InventoryTopic");
        assert topic3 != null : "Test topic could not be retrieved";

        Configuration configuration3 = manager.getResourceConfiguration(topic3);

        // Set the last elements in the array
        resourceTypes[2] = resourceType3;
        resources[2] = topic3;
        configurations[2] = configuration3;

        // Find the topic
        singleResourceType = resourceType3;
        singleResource = getResourceInstance(singleResourceType, "SingleTestTopic");
        assert singleResource != null : "Test singleResource topic could not be retrieved";

        singleConfiguration = manager.getResourceConfiguration(singleResource);

    }
View Full Code Here

    @NotNull
    ResourceListItem getCurrentResourceListItem()
    {
        ResourceListItem resourceListItem;
        Resource resource = getCurrentResource();
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        Availability availability = resourceManager.getAvailability(resource);
        resourceListItem = new ResourceListItem(resource, availability);
        return resourceListItem;
    }
View Full Code Here

        {
            throw new RuntimeException("Could not parse path [" + path + "] into a numeric Resource id.");
        }

        // we've got an id so lets go and retrieve the corresponding resource
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        Resource resource = resourceManager.getResource(resourceId);
        if (resource == null)
        {
            throw new IllegalStateException("Resource with id " + resourceId + " not found.");
        }
        return resource;
View Full Code Here

        implements ContentHistoryManager
{
    public ContentDiscoveryReport addContentHistory(ContentDiscoveryReport report)
    {
        int resourceId = report.getResourceId();
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();

        Resource resource = resourceManager.getResource(resourceId);
        if (resource != null)
        {
            ResourceType resourceType = resource.getResourceType();
            this.addToMaps(report, resource, resourceType);
        }
View Full Code Here

    public JONTreeNode getSelectedNode()
    {
        if (log.isTraceEnabled())
            log.trace("Finding node for path [" + getCurrentPath() + "]...");
        JONTreeNode selectedNode = getRootNode().findNode(getCurrentPath());
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        if (selectedNode == null)
        {
            log.debug("Unable to find node with path [" + this.currentPath + "]; defaulting to platform node...");
            // TODO (ccrouch): I'm seeing this on login now. Comment out for now.
//            String errorMsg = "Unable to find node with path [" + this.currentPath + "]; defaulting to platform node...";
//            LOG.error(errorMsg);
//            this.facesMessages.add(FacesMessage.SEVERITY_ERROR, errorMsg);
            this.currentPath = getResourcePath(resourceManager.getPlatform());
            selectedNode = getRootNode().findNode(this.currentPath);
        }
        return selectedNode;
    }
View Full Code Here

        {
            OperationHistory newOperationHistory = this.historyManager.addOperationHistory(operationDef.getName(),
                    this.selectedOperationParameters, this.currentResource, resourceType);
            // Null this out as soon as we're done with it, so it won't carry over to the next request.
            this.selectedOperationParameters = null;
            ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
            String jobId = newOperationHistory.getJobId().toString();
            try
            {
                resourceManager.invokeOperation(this.currentResource, operationDef, newOperationHistory.getParameters(),
                        jobId);
                this.facesMessages.add("The #0 operation has been invoked. See the operation history below for the results once the operation has completed.",
                        operationDef.getDisplayName());
            }
            catch (RuntimeException e)
View Full Code Here

        return resourceType;
    }

    private void initOperations()
    {
        ResourceManager resourceManager = ResourceManagerFactory.resourceManager();
        operations = resourceManager.getOperationsForResource(currentResource);
    }
View Full Code Here

     * @param resourceType
     * @return
     */
    private List<ResourceListItem> getResourceListByType(ResourceType resourceType, Resource parentResource)
    {
        ResourceManager manager = ResourceManagerFactory.resourceManager();
        Set<Resource> resources = manager.getResources(resourceType, parentResource);
        List<ResourceListItem> items = new ArrayList<ResourceListItem>();
        for (Resource r : resources)
        {
            Availability availability = manager.getAvailability(r);
            ResourceListItem item = new ResourceListItem(r, availability);
            items.add(item);
        }

        return items;
View Full Code Here

TOP

Related Classes of org.jboss.on.embedded.manager.ResourceManager

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.