@Override public Lifecycle newInstance(KernelContext context, Dependencies dependencies) throws Throwable { GraphDatabaseService graphDatabaseService = dependencies.getGraphDatabaseService(); Config config = dependencies.getConfig(); Setting<HostnamePort> hostnamePort = setting("websocket_host", HOSTNAME_PORT, "0.0.0.0:8765"); Setting<List<String>> packageNames = setting("websocket_packages", STRING_LIST, ""); Setting<String> managementPath = setting("websocket_management_path", STRING, "/ws/management"); Setting<String> commandPath = setting("websocket_data_path", STRING, "/ws/data"); ClusterMemberEvents clusterMemberEvents = null; if (graphDatabaseService instanceof HighlyAvailableGraphDatabase) { logger.info("[newInstance] cluster installation"); clusterMemberEvents = dependencies.getClusterMemberEvents(); } return new WebsocketsKernelExtension( graphDatabaseService, clusterMemberEvents, config.get(packageNames), config.get(hostnamePort), config.get(managementPath), config.get(commandPath)); }
private static ConfigurationParameter configure( Setting<?> key, String value ) { return new ConfigurationParameter( key, value ); }
public ConfigurationParameter( Setting<?> key, String value ) { this.key = key; this.value = value; }