Examples of ServerServices


Examples of org.rhq.core.pc.ServerServices

        }

        boolean errorSent = false;

        DiscoveryServerService serverService = null;
        ServerServices serverServices = this.configuration.getServerServices();
        if (serverServices != null) {
            serverService = serverServices.getDiscoveryServerService();
        }

        if (serverService != null) {
            try {
                // use light-weight proxy to Resource, so that the entire hierarchy doesn't get serialized
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

        NATIVE_SYSTEM_INFO_ENABLEMENT_PER_PC.put(arquillianContainerName, config.isNativeSystemInfoEnabled());
               
        if (config.getServerServicesImplementationClassName() != null) {
            try {
                Class<?> serverServicesClass = Class.forName(config.getServerServicesImplementationClassName());
                ServerServices serverServices = (ServerServices) serverServicesClass.newInstance();

                config.setServerServices(serverServices);
            } catch (Exception e) {
                throw new IllegalArgumentException("The serverServicesImplementationClassName property is invalid", e);
            }
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

    public void initTest() throws Exception {
        tmpDir = mkdir(basedir(), "tmp");

        pcConfig = new PluginContainerConfiguration();
        pluginManager = new PluginManager(pcConfig, new PluginLifecycleListenerManagerImpl());
        ServerServices serverServices = new ServerServices();
        driftServerService = new TestDriftServerService();
        serverServices.setDriftServerService(driftServerService);
        pcConfig.setServerServices(serverServices);
        pcConfig.setDataDirectory(basedir());
        pcConfig.setTemporaryDirectory(tmpDir);

        driftMgr = new TestDriftManager(pcConfig);
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

            ContentServerService contentServerService = factory.getRemotePojo(ContentServerService.class);
            EventServerService eventServerService = factory.getRemotePojo(EventServerService.class);
            BundleServerService bundleServerService = factory.getRemotePojo(BundleServerService.class);
            DriftServerService driftServerService = factory.getRemotePojo(DriftServerService.class);

            ServerServices serverServices = new ServerServices();
            serverServices.setCoreServerService(coreServerService);
            serverServices.setDiscoveryServerService(discoveryServerService);
            serverServices.setMeasurementServerService(measurementServerService);
            serverServices.setOperationServerService(operationServerService);
            serverServices.setConfigurationServerService(configurationServerService);
            serverServices.setResourceFactoryServerService(resourceFactoryServerSerfice);
            serverServices.setContentServerService(contentServerService);
            serverServices.setEventServerService(eventServerService);
            serverServices.setBundleServerService(bundleServerService);
            serverServices.setDriftServerService(driftServerService);

            pc_config.setServerServices(serverServices);
        } catch (Exception e) {
            LOG.error(e, AgentI18NResourceKeys.FAILED_TO_CREATE_PLUGIN_CONTAINER_SERVER_SERVICES, e);
            return false;
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

        RhqAgentPluginContainer rpc = rhqAgentPluginContainer.get();
        if (rpc == null) {
            throw new RuntimeException("To inject a ServerServices object, at least one RhqAgentPluginContainer must be configured.");
        }

        ServerServices serverServices = rpc.getConfiguration().getServerServices();
        if (serverServices == null) {
            throw new RuntimeException("To inject a ServerServices object, the \"serverServicesImplementationClassName\" property must be set in the container's configuration.");
        }

        return serverServices;
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

     * Returns the server service implementation used to notify of a task completion.
     *
     * @return server service if one is registered; <code>null</code> otherwise
     */
    ResourceFactoryServerService getServerService() {
        ServerServices serverServices = configuration.getServerServices();
        if (serverServices == null) {
            return null;
        }

        ResourceFactoryServerService resourceFactoryServerService = serverServices.getResourceFactoryServerService();
        return resourceFactoryServerService;
    }
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

     *
     * @return server service implementation if one is registered; <code>null</code> otherwise
     */
    ContentServerService getContentServerService() {
        ContentServerService serverService = null;
        ServerServices serverServices = configuration.getServerServices();
        if (serverServices != null) {
            serverService = serverServices.getContentServerService();
        }
        return serverService;
    }
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

    private static final String BUNDLE_CONFIG_LOCATION_RC = getPath("/resourceconfig/base/dir");
    private static final String BUNDLE_CONFIG_LOCATION_MT = getPath("/trait/base/dir");

    @BeforeMethod
    public void beforeMethod() {
        ServerServices serverServices = new ServerServices();
        serverServices.setBundleServerService(new MockBundleServerService());

        PluginLifecycleListenerManager pluginLifecycleListenerManager = new PluginLifecycleListenerManagerImpl();
        pcConfig = new PluginContainerConfiguration();
        pcConfig.setStartManagementBean(false);
        pcConfig.setServerServices(serverServices);
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

        conf.setEventSenderInitialDelay(Long.MAX_VALUE);
        conf.setMeasurementCollectionInitialDelay(Long.MAX_VALUE);
        conf.setServerDiscoveryInitialDelay(Long.MAX_VALUE);
        conf.setServiceDiscoveryInitialDelay(Long.MAX_VALUE);

        ServerServices serverServices = new ServerServices();
        serverServices.setBundleServerService(context.mock(BundleServerService.class));
        serverServices.setConfigurationServerService(context.mock(ConfigurationServerService.class));
        serverServices.setContentServerService(context.mock(ContentServerService.class));
        serverServices.setCoreServerService(context.mock(CoreServerService.class));
        serverServices.setDiscoveryServerService(context.mock(DiscoveryServerService.class));
        serverServices.setEventServerService(context.mock(EventServerService.class));
        serverServices.setMeasurementServerService(context.mock(MeasurementServerService.class));
        serverServices.setOperationServerService(context.mock(OperationServerService.class));
        serverServices.setResourceFactoryServerService(context.mock(ResourceFactoryServerService.class));
        serverServices.setDriftServerService(context.mock(DriftServerService.class));

        conf.setServerServices(serverServices);

        return conf;
    }
View Full Code Here

Examples of org.rhq.core.pc.ServerServices

        return this;
    }

    @SuppressWarnings("unchecked")
    public void addDefaultExpectations(Expectations expectations) throws Exception {
        ServerServices ss = PluginContainerTest.getCurrentPluginContainerConfiguration().getServerServices();

        //only import the apache servers we actually care about - we can't assume another apache won't be present
        //on the machine running the test...
        final ResourceType serverResourceType = apacheResourceTypes.findByName("Apache HTTP Server");
        expectations.allowing(ss.getDiscoveryServerService()).mergeInventoryReport(
            expectations.with(Expectations.any(InventoryReport.class)));
        expectations.will(fakeInventory.mergeInventoryReport(new FakeServerInventory.InventoryStatusJudge() {
            @Override
            public InventoryStatus judge(Resource resource) {
                if (serverResourceType.equals(resource.getResourceType())) {
                    return deploymentConfig.serverRoot.equals(resource.getPluginConfiguration().getSimpleValue(
                        ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT)) ? InventoryStatus.COMMITTED
                        : InventoryStatus.IGNORED;
                } else {
                    return InventoryStatus.COMMITTED;
                }
            }
        }));

        expectations.allowing(ss.getDiscoveryServerService()).getResourceSyncInfo(
            expectations.with(Expectations.any(Integer.class)));
        expectations.will(fakeInventory.getResourceSyncInfo());

        expectations.allowing(ss.getDiscoveryServerService()).upgradeResources(
            expectations.with(Expectations.any(Set.class)));
        expectations.will(fakeInventory.upgradeResources());

        expectations.allowing(ss.getDiscoveryServerService()).getResources(
            expectations.with(Expectations.any(Set.class)), expectations.with(Expectations.any(boolean.class)));
        expectations.will(fakeInventory.getResources());

        expectations.allowing(ss.getDiscoveryServerService()).setResourceError(expectations.with(Expectations.any(ResourceError.class)));
        expectations.will(fakeInventory.setResourceError());

        expectations.allowing(ss.getDiscoveryServerService()).mergeAvailabilityReport(
            expectations.with(Expectations.any(AvailabilityReport.class)));

        expectations.allowing(ss.getDiscoveryServerService()).postProcessNewlyCommittedResources(
            expectations.with(Expectations.any(Set.class)));

        expectations.allowing(ss.getDiscoveryServerService()).clearResourceConfigError(
            expectations.with(Expectations.any(int.class)));

        expectations.allowing(ss.getDiscoveryServerService()).setResourceEnablement(
            expectations.with(Expectations.any(int.class)), expectations.with(Expectations.any(boolean.class)));

        expectations.allowing(ss.getDiscoveryServerService()).updateResourceVersion(
            expectations.with(Expectations.any(int.class)), expectations.with(Expectations.any(String.class)));

        expectations.allowing(ss.getDriftServerService()).getDriftDefinitions(expectations.with(Expectations.any(Set.class)));
        expectations.will(Expectations.returnValue(Collections.emptyMap()));

        expectations.allowing(ss.getDiscoveryServerService()).getResourcesAsList(expectations.with(Expectations.any(Integer[].class)));
        expectations.will(fakeInventory.getResourcesAsList());

        expectations.ignoring(ss.getBundleServerService());
        expectations.ignoring(ss.getConfigurationServerService());
        expectations.ignoring(ss.getContentServerService());
        expectations.ignoring(ss.getCoreServerService());
        expectations.ignoring(ss.getEventServerService());
        expectations.ignoring(ss.getMeasurementServerService());
        expectations.ignoring(ss.getOperationServerService());
        expectations.ignoring(ss.getResourceFactoryServerService());
    }
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.