Initializes the MetricQueryService.

@param rpcService RpcService to create the MetricQueryService on
@param resourceID resource ID used to disambiguate the actor name
8650
public void startQueryService(RpcService rpcService, ResourceID resourceID) {
		synchronized (lock) {
			Preconditions.checkState(!isShutdown(), "The metric registry has already been shut down.");

			try {
				metricQueryServiceRpcService = rpcService;
				queryService = MetricQueryService.createMetricQueryService(rpcService, resourceID, maximumFramesize);
				queryService.start();
			} catch (Exception e) {
				LOG.warn("Could not start MetricDumpActor. No metrics will be submitted to the WebInterface.", e);
			}
		}
	}
883416
public void setResourceAdaptorContext(javax.slee.resource.ResourceAdaptorContext raContext) {
		this.raContext = raContext; 
		this.tracer = raContext.getTracer("XCAPClientResourceAdaptor");
		sbbInterface = new XCAPClientResourceAdaptorSbbInterfaceImpl(this);
        this.sleeEndpoint = raContext.getSleeEndpoint();
        this.eventLookupFacility = raContext.getEventLookupFacility();

        try {
        	this.getResponseEvent = eventLookupFacility.getFireableEventType(new EventTypeID("GetResponseEvent", "org.restcomm", "2.0"));
        	this.putResponseEvent = eventLookupFacility.getFireableEventType(new EventTypeID("PutResponseEvent", "org.restcomm", "2.0"));
        	this.deleteResponseEvent = eventLookupFacility.getFireableEventType(new EventTypeID("DeleteResponseEvent", "org.restcomm", "2.0"));
        }
        catch(Exception e) {
        	if(tracer.isWarningEnabled())
        		tracer.warning("Could not look up Response Event",e);
        }	
	}
347771
public void setResourceId(String resourceId) {

        try {
            if (!m_resourceBuilder.isFolder()) {
                m_resourceBuilder.setResourceId(new CmsUUID(resourceId));
            } else {
                m_resourceBuilder.setResourceId(new CmsUUID());
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
395294
private MultiThreadedServiceFactory<AuthDataStore> createDataStoreServiceFactory(String cluster, MetricRegistry metricRegistry) {
        HttpClientConfiguration clientConfig = new HttpClientConfiguration();
        clientConfig.setKeepAlive(Duration.seconds(1));
        clientConfig.setConnectionTimeout(Duration.seconds(10));
        clientConfig.setTimeout(Duration.minutes(5));

        return DataStoreClientFactory.forClusterAndHttpConfiguration(cluster, clientConfig, metricRegistry);
    }
1262760
private synchronized void initResourceType(
        I_CmsResourceType resourceType,
        CmsResourceManagerConfiguration configuration) {

        // add the loader to the internal list of loaders
        configuration.addResourceType(resourceType);
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_ADD_RESTYPE_3,
                    resourceType.getTypeName(),
                    new Integer(resourceType.getTypeId()),
                    resourceType.getClass().getName()));
        }

        // add the mappings
        List<String> mappings = resourceType.getConfiguredMappings();
        Iterator<String> i = mappings.iterator();
        while (i.hasNext()) {
            String mapping = i.next();
            // only add this mapping if a mapping with this file extension does not
            // exist already
            if (!configuration.m_extensionMappings.containsKey(mapping)) {
                configuration.m_extensionMappings.put(mapping, resourceType.getTypeName());
                if (CmsLog.INIT.isInfoEnabled()) {
                    CmsLog.INIT.info(
                        Messages.get().getBundle().key(
                            Messages.INIT_MAP_RESTYPE_2,
                            mapping,
                            resourceType.getTypeName()));
                }
            }
        }
    }
1316112
public void setResourceRegion(java.util.Collection<StringFilter> resourceRegion) {
        if (resourceRegion == null) {
            this.resourceRegion = null;
            return;
        }

        this.resourceRegion = new java.util.ArrayList<StringFilter>(resourceRegion);
    }
600121
private void queryMetrics(final MetricQueryServiceGateway queryServiceGateway) {
		LOG.debug("Query metrics for {}.", queryServiceGateway.getAddress());

		queryServiceGateway
			.queryMetrics(timeout)
			.whenCompleteAsync(
				(MetricDumpSerialization.MetricSerializationResult result, Throwable t) -> {
					if (t != null) {
						LOG.debug("Fetching metrics failed.", t);
					} else {
						metrics.addAll(deserializer.deserialize(result));
					}
				},
				executor);
	}
845854
public void setResourceId(java.util.Collection<StringFilter> resourceId) {
        if (resourceId == null) {
            this.resourceId = null;
            return;
        }

        this.resourceId = new java.util.ArrayList<StringFilter>(resourceId);
    }
615898
public Observable<PolicyEventsQueryResultsInner> listQueryResultsForResourceAsync(String resourceId) {
        return listQueryResultsForResourceWithServiceResponseAsync(resourceId).map(new Func1<ServiceResponse<PolicyEventsQueryResultsInner>, PolicyEventsQueryResultsInner>() {
            @Override
            public PolicyEventsQueryResultsInner call(ServiceResponse<PolicyEventsQueryResultsInner> response) {
                return response.body();
            }
        });
    }
686024
@Override
  public void initialize(HttpRequest httpRequest) throws IOException {
    // Do not throw if execute fails, since Axis will handle unmarshalling the
    // fault.
    httpRequest.setThrowExceptionOnExecuteError(false);

    // For consistency with the default Axis HTTPSender and CommonsHTTPSender, do not
    // follow redirects.
    httpRequest.setFollowRedirects(false);

    // Retry should be handled by the client.
    httpRequest.setNumberOfRetries(0);
  }
1070515
@SuppressWarnings("unchecked")
   protected void associateResourceAdapter(javax.resource.spi.ResourceAdapter resourceAdapter, Object object)
      throws DeployException
   {
      if (resourceAdapter != null && object != null && object instanceof ResourceAdapterAssociation)
      {
         try
         {
            ResourceAdapterAssociation raa = (ResourceAdapterAssociation)object;
            raa.setResourceAdapter(resourceAdapter);
         }
         catch (Throwable t)
         {
            throw new DeployException(bundle.unableToAssociate(object.getClass().getName()), t);
         }
      }
   }
922881
@Override
    public Slf4jMetricReporter init(ConfigurationProperties configurationProperties, MetricRegistry metricRegistry) {
        metricLogReporterMillis = configurationProperties.getMetricLogReporterMillis();
        if (metricLogReporterMillis > 0) {
            this.slf4jReporter = Slf4jReporter
                    .forRegistry(metricRegistry)
                    .outputTo(LOGGER)
                    .build();
        }
        return this;
    }
573145
private synchronized void init(MasterInquireClient masterInquireClient) {
    mMasterInquireClient = masterInquireClient;
    mFileSystemMasterClientPool =
        new FileSystemMasterClientPool(mClientContext, mMasterInquireClient);
    mBlockMasterClientPool = new BlockMasterClientPool(mClientContext, mMasterInquireClient);
    mClosed.set(false);

    if (mClientContext.getConf().getBoolean(PropertyKey.USER_METRICS_COLLECTION_ENABLED)) {
      // setup metrics master client sync
      mMetricsMasterClient = new MetricsMasterClient(MasterClientContext
          .newBuilder(mClientContext)
          .setMasterInquireClient(mMasterInquireClient)
          .build());
      mClientMasterSync = new ClientMasterSync(mMetricsMasterClient, mAppId);
      mExecutorService = Executors.newFixedThreadPool(1,
          ThreadFactoryUtils.build("metrics-master-heartbeat-%d", true));
      mExecutorService
          .submit(new HeartbeatThread(HeartbeatContext.MASTER_METRICS_SYNC, mClientMasterSync,
              (int) mClientContext.getConf().getMs(PropertyKey.USER_METRICS_HEARTBEAT_INTERVAL_MS),
              mClientContext.getConf()));
      // register the shutdown hook
      try {
        Runtime.getRuntime().addShutdownHook(new MetricsMasterSyncShutDownHook());
      } catch (IllegalStateException e) {
        // this exception is thrown when the system is already in the process of shutting down. In
        // such a situation, we are about to shutdown anyway and there is no need to register this
        // shutdown hook
      } catch (SecurityException e) {
        LOG.info("Not registering metrics shutdown hook due to security exception. Regular "
            + "heartbeats will still be performed to collect metrics data, but no final heartbeat "
            + "will be performed on JVM exit. Security exception: {}", e.toString());
      }
    }
  }
21093
public void setResourceLocalService(
		com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
		this.resourceLocalService = resourceLocalService;
	}
287513
@SuppressFBWarnings("PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS")
    public void initServiceRegistryIfNecessary() {
        val size = this.serviceRegistry.size();
        LOGGER.trace("Service registry contains [{}] service definition(s)", size);

        LOGGER.warn("Service registry [{}] will be auto-initialized from JSON service definitions. "
            + "This behavior is only useful for testing purposes and MAY NOT be appropriate for production. "
            + "Consider turning off this behavior via the setting [cas.serviceRegistry.initFromJson=false] "
            + "and explicitly register definitions in the services registry.", this.serviceRegistry.getName());

        val servicesLoaded = this.jsonServiceRegistry.load();
        LOGGER.debug("Loaded JSON services are [{}]", servicesLoaded.stream().map(RegisteredService::getName).collect(Collectors.joining(",")));

        servicesLoaded
            .forEach(r -> {
                if (!findExistingMatchForService(r)) {
                    LOGGER.debug("Initializing service registry with the [{}] JSON service definition...", r.getName());
                    this.serviceRegistry.save(r);
                }
            });
        this.servicesManager.load();
        LOGGER.info("Service registry [{}] contains [{}] service definitions", this.serviceRegistry.getName(), this.servicesManager.count());

    }
1208867
public Observable<ServiceResponse<SummarizeResultsInner>> summarizeForResourceWithServiceResponseAsync(String resourceId) {
        if (resourceId == null) {
            throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        final String policyStatesSummaryResource = "latest";
        final QueryOptions queryOptions = null;
        Integer top = null;
        DateTime from = null;
        DateTime to = null;
        String filter = null;
        return service.summarizeForResource(policyStatesSummaryResource, resourceId, this.client.apiVersion(), this.client.acceptLanguage(), top, from, to, filter, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<SummarizeResultsInner>>>() {
                @Override
                public Observable<ServiceResponse<SummarizeResultsInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<SummarizeResultsInner> clientResponse = summarizeForResourceDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1231545
public void setResourceAwsEc2InstanceVpcId(java.util.Collection<StringFilter> resourceAwsEc2InstanceVpcId) {
        if (resourceAwsEc2InstanceVpcId == null) {
            this.resourceAwsEc2InstanceVpcId = null;
            return;
        }

        this.resourceAwsEc2InstanceVpcId = new java.util.ArrayList<StringFilter>(resourceAwsEc2InstanceVpcId);
    }