/** * {@inheritDoc} * * @see org.opencastproject.serviceregistry.api.ServiceRegistry#registerService(java.lang.String, java.lang.String, * java.lang.String) */ @Override public ServiceRegistration registerService(String serviceType, String host, String path) throws ServiceRegistryException { return registerService(serviceType, host, path, false); }
/** * Method to register locally running services. * * @param localService * the service instance * @return the service registration * @throws ServiceRegistryException */ public ServiceRegistration registerService(JobProducer localService) throws ServiceRegistryException { return registerService(localService, Runtime.getRuntime().availableProcessors()); }
public ServiceRegistryInMemoryImpl(JobProducer service, float maxLoad, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) throws ServiceRegistryException { //Note: total memory here isn't really the correct value, but we just need something (preferably non-zero) registerHost(LOCALHOST, LOCALHOST, Runtime.getRuntime().totalMemory(), Runtime.getRuntime().availableProcessors(), maxLoad); if (service != null) registerService(service, maxLoad); this.securityService = securityService; this.userDirectoryService = userDirectoryService; this.organizationDirectoryService = organizationDirectoryService; this.incidents = new Incidents(this, incidentService); this.dispatcher.scheduleWithFixedDelay(new JobDispatcher(), DEFAULT_DISPATCHER_TIMEOUT, DEFAULT_DISPATCHER_TIMEOUT, TimeUnit.MILLISECONDS); }