Examples of ResourceContainer


Examples of flex2.compiler.ResourceContainer

            // create a SourceList...
            data.sourceList = new SourceList(array[1], asClasspath, null, WebTierAPI.getSourceListMimeTypes(), false);
           
            // create a ResourceContainer...
            data.resources = new ResourceContainer();

            // create a ResourceBundlePath...
            data.bundlePath = new ResourceBundlePath(compilerConfig, null);

            // clear these...
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.container.ResourceContainer

  }
 
  private void loadResources(String filename)
  throws FileNotFoundException, IOException {
    try {
      ResourceContainer resources = new ResourceContainer(model);
      StringTokenizer tokenizer = this.openFile(filename);
     
      //ignore header fields
      tokenizer.nextToken();
      tokenizer.nextToken();
     
      while (tokenizer.hasMoreTokens()) {
        Resource resource = new Resource();
        int id = Integer.parseInt(tokenizer.nextToken());
        resource.setId(id);
        int fare = Integer.parseInt(tokenizer.nextToken());
        resource.setFare(fare);
       
        resources.putResource(id, resource);
      }
     
      model.setResourceContainer(resources);
    }
    catch (FileNotFoundException e) {
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

            if (inventoryBinaryFile == null) {
                if (dumpTypesOnly) {
                    Set<ResourceType> rootTypes = pc.getPluginManager().getMetadataManager().getRootTypes();
                    InventoryPrinter.outputAllResourceTypes(exportWriter, dumpXml, rootTypes);
                } else {
                    ResourceContainer rc = null;
                    if (id != null) {
                        rc = pc.getInventoryManager().getResourceContainer(id);
                        if (rc == null) {
                            out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_INVALID_RESOURCE_ID, id));
                            return;
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

                for (AvailabilityReport.Datum avail : avails) {
                    boolean isUp = avail.getAvailabilityType() == AvailabilityType.UP;

                    // lookup the heavy-weight resource object
                    int resourceId = avail.getResourceId();
                    ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceId);
                    Resource resource = resourceContainer.getResource();

                    PropertyMap map = new PropertyMap("resourceAvailability");
                    map.put(new PropertySimple("resourceId", Integer.valueOf(resource.getId())));
                    map.put(new PropertySimple("resourceName", resource.getName()));
                    map.put(new PropertySimple("isAvailable", Boolean.valueOf(isUp)));
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

                if (resourceId == null) {
                    discovery(pcName, out, pluginName, resourceTypeName, verbose);
                } else {
                    // specifying a resource ID implies we must ignore -r and -p (since type/plugin is determined by the resource)
                    InventoryManager im = PluginContainer.getInstance().getInventoryManager();
                    ResourceContainer resourceContainer = im.getResourceContainer(resourceId);
                    if (resourceContainer != null) {
                        Resource resource = resourceContainer.getResource();
                        PluginContainerConfiguration pcc = agentConfig.getPluginContainerConfiguration();
                        RuntimeDiscoveryExecutor scanner = new RuntimeDiscoveryExecutor(im, pcc, resource);
                        InventoryReport report = scanner.call();
                        out.println(MSG.getMsg(AgentI18NResourceKeys.DISCOVERY_RESOURCE_SERVICES, resource.getName()));
                        printInventoryReport(report, out, verbose);
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

                }
            }

            PluginComponentFactory componentFactory = PluginContainer.getInstance().getPluginComponentFactory();
            InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
            ResourceContainer platformContainer = inventoryManager.getResourceContainer(inventoryManager.getPlatform());
            ResourceComponent platformComponent = inventoryManager.getResourceComponent(inventoryManager.getPlatform());
            ResourceDiscoveryComponent discoveryComponent = componentFactory.getDiscoveryComponent(resourceType,
                platformContainer);

            ResourceDiscoveryContext context = new ResourceDiscoveryContext(resourceType, platformComponent,
                platformContainer.getResourceContext(), systemInfo, scanResults, Collections.EMPTY_LIST, pcName,
                PluginContainerDeployment.AGENT);

            Set<DiscoveredResourceDetails> discoveredResources;
            discoveredResources = inventoryManager.invokeDiscoveryComponent(platformContainer, discoveryComponent, context);
            if (discoveredResources != null) {
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

        }

        int resourceId = resource.getId();

        if (resourceId != 0) {
            ResourceContainer container = this.inventoryManager.getResourceContainer(resourceId);
            if (container != null) {
                Set<MeasurementScheduleRequest> schedules = container.getMeasurementSchedule();
                if (schedules != null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Rescheduling: " + resource.getId());
                    }
                    scheduleCollection(resourceId, schedules);
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

     * @param scheduleRequests
     */
    @Override
    public synchronized void updateCollection(Set<ResourceMeasurementScheduleRequest> scheduleRequests) {
        for (ResourceMeasurementScheduleRequest resourceRequest : scheduleRequests) {
            ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceRequest.getResourceId());
            if (resourceContainer != null) {
                // Update (not overwrite) measurement schedule data ...
                resourceContainer.updateMeasurementSchedule(resourceRequest.getMeasurementSchedules());
                // ... and then reschedule collection
                scheduleCollection(resourceRequest.getResourceId(), resourceRequest.getMeasurementSchedules());
                if (resourceRequest.getAvailabilitySchedule() != null) {
                    // Set availability schedule data  if present
                    // This method also triggers a reschedule of availability check
                    resourceContainer.setAvailabilitySchedule(resourceRequest.getAvailabilitySchedule());
                }
            } else {
                // This will happen when the server sends down schedules to an agent with a cleaned inventory
                // Its ok to skip these because the agent will request a reschedule once its been able to synchronize
                // and add these to inventory
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

     * @param scheduleRequests
     */
    @Override
    public synchronized void scheduleCollection(Set<ResourceMeasurementScheduleRequest> scheduleRequests) {
        for (ResourceMeasurementScheduleRequest resourceRequest : scheduleRequests) {
            ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceRequest.getResourceId());
            if (resourceContainer != null) {
                // Set measurement schedule data ...
                resourceContainer.setMeasurementSchedule(resourceRequest.getMeasurementSchedules());
                // ... and then reschedule collection
                scheduleCollection(resourceRequest.getResourceId(), resourceRequest.getMeasurementSchedules());
                // Set availability schedule data
                // This method also triggers a reschedule of availability check
                resourceContainer.setAvailabilitySchedule(resourceRequest.getAvailabilitySchedule());
            } else {
                // This will happen when the server sends down schedules to an agent with a cleaned inventory
                // It's ok to skip these because the agent will request a reschedule once its been able to synchronize
                // and add these to inventory
                LOG.debug("Resource container was null, could not schedule collection for resource "
View Full Code Here

Examples of org.rhq.core.pc.inventory.ResourceContainer

        if (requests.size() == 0) {
            // There's no need to even call getValues() on the ResourceComponent if the list of metric names is empty.
            return Collections.emptySet();
        }
        MeasurementFacet measurementFacet;
        ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceId);
        if (resourceContainer == null) {
            LOG.warn("Can not get resource container for resource with id " + resourceId);
            return Collections.emptySet();
        }
        Resource resource = resourceContainer.getResource();
        ResourceType resourceType = resource.getResourceType();
        if (resourceType.getMetricDefinitions().isEmpty())
            return Collections.emptySet();

        try {
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.