public static boolean getRegistryUseSSL() { return getBoolean(REGISTRY_USESSL, false); }
public static int getRegistryPort() { return getInt(REGISTRY_PORT, 8080); }
public static long getRegistryHeartbeatInterval() { return getLong(REGISTRY_HEARTBEAT_INTERVAL, 10000L); }
public static String getRegistryContextroot() { return getString(REGISTRY_CONTEXTROOT, "microverse-rest-registry"); }
@PostConstruct public void init() { final String dir = Configuration.getServiceDeployDir(); if (dir != null) { serviceDir = Paths.get(dir); } else { LOG.warn("No deploy directory configured. Please set the system property '" + Configuration.getServiceDeployDir() + "'!"); serviceDir = Paths.get("."); } }
if (entry.getName().endsWith(Configuration.getAutoDeployServiceDescriptorFilename())) { final BufferedReader reader = new BufferedReader(new InputStreamReader(zis)); String line = reader.readLine(); throw new ServiceException("Error reading auto-deploy service-descriptor file '" + Configuration.getAutoDeployServiceDescriptorFilename() + "' from bundle!", e);
/** * Starts this service-registry. * * @param host the host under which the registry is running * @param port the port under which the registry is running * @param useSSL flag, whether to use SSL * @param contextRoot the context under which the registry is running */ public void start(final RegistryDescriptor registryDescriptor) { // try to discover all registries registryCache.addAll(RegistryDiscovererService.requestRegistries()); // remove this registry, since we don't want to propagate anything to ourselves registryCache.remove(registryDescriptor); // propagate this registry to other registries propagateRegistryToOtherRegistries(registryDescriptor, Action.ADD); // schedule service heartbeat checks to update latencies timer.schedule(new TimerTask() { @Override public void run() { for (final ServiceDescriptor serviceDescriptor : serviceCache.getAll()) { final Long latency = getLatency(serviceDescriptor); serviceCache.setMetadata(serviceDescriptor, ServiceCache.Metadata.create(latency)); } } }, 0, Configuration.getServerHeartbeatInterval()); LOG.info("Service-Registry started successfully on: " + registryDescriptor.getHost() + ":" + registryDescriptor.getPort() + " (SSL=" + registryDescriptor.isUseSSL() + ")"); }
public static String getServiceDeployDir() { return getString(SERVICE_DEPLOY_DIR, "./deploy"); }
public static long getServerHeartbeatInterval() { return getLong(SERVER_HEARTBEAT_INTERVAL, 10000L); }
public static String getRegistryHost() { return getString(REGISTRY_HOST, "localhost"); }
public static boolean getServerUseSSL() { return getBoolean(SERVER_USESSL, false); }
public static int getServerPort() { return getInt(SERVER_PORT, 8080); }
public static long getAutoDeployStartDelay() { return getLong(AUTODEPLOY_START_DELAY, 0L); }