public DatabricksClientConfiguration(Configuration configuration) { this(); if (configuration instanceof AbstractConfiguration) { AbstractConfiguration aconf = (AbstractConfiguration) configuration; } addConfiguration(configuration); }
public DoctorKafkaClusterConfig(String clusterName, AbstractConfiguration configuration) { this.clusterName = clusterName; this.clusterConfiguration = configuration; }
/** * The main method. * * @param args * the arguments */ public static void main(String[] args) { System.out.println(getFiles(".", "z:\\dev\\yajsw\\..\\yajsw\\*.jar") .size()); try { // String // fileName=FilenameUtils.separatorsToSystem("C:\\init\\MOBILEguard\\yajsw/lib/jvmstat/*.jar"); // System.out.println("FileName: "+fileName); CompositeConfiguration compConfig = new CompositeConfiguration(); AbstractConfiguration configuraton = new BaseConfiguration(); compConfig.addConfiguration(new EnvironmentConfiguration()); configuraton.setProperty("wrapper.java.classpath.1", "${VERSANT_ROOT}/lib/jvi.*jar"); configuraton.setProperty("wrapper.java.classpath.2", "${GROOVY_HOME}/lib/*.jar"); compConfig.addConfiguration(configuraton); System.out.println("Configuration: " + ConfigurationConverter.getProperties(compConfig)); System.out.println("subset: " + ConfigurationConverter.getProperties(compConfig .subset("wrapper.java"))); // Collection files=FileUtils.getFiles("../..", // "C:/versant/7_0_1/lib/jvi*.jar"); // Collection collection= // org.apache.commons.io.FileUtils.listFiles(new File("C:/"), // new WildcardFileFilter("jvi*.jar"), new // WildcardFileFilter("*jar")); // File[] files= new // File("C:").listFiles((FilenameFilter)FileFilterUtils.nameFileFilter("C:/versant/7_0_1/lib/jvi*.jar")); // // FileUtils.getFiles("C:/versant/7_0_1/lib/", "jvi*.jar"); // System.out.println("FileList="+ // FileUtils.getFiles("C:/versant/7_0_1/lib/", "jvi*.jar")); // java.util.Arrays.asList(files)); } catch (Exception ex) { ex.printStackTrace(); } }
/** * Create a {@link Configuration} instance, * composed of multiple configurations which are enumerated in {@link ConfigurationType}. * * @return Composite configuration instance. */ @VisibleForTesting AbstractConfiguration createConfiguration() { CompositeConfiguration composite = new CompositeConfiguration(); ConfigurationType[] types = ConfigurationType.values(); Arrays.stream(types).forEach(s -> s.get().ifPresent(composite::addConfiguration)); return composite; }
/** * Create a new instance of the {@link Bitflyer4j}. * A new instance is created for each invocation. * * @return New instance. */ public Bitflyer4j createInstance() { log.info("Creating instance."); final AbstractConfiguration conf = createConfiguration(); Module module = new AbstractModule() { @Override protected void configure() { bind(Configuration.class).toInstance(conf); bind(EventSource.class).toInstance(conf); bind(Gson.class).toProvider(GsonProvider.class).asEagerSingleton(); bind(PubNub.class).toProvider(PubNubProvider.class).asEagerSingleton(); bind(Environment.class).to(EnvironmentImpl.class).asEagerSingleton(); bind(Throttler.class).to(ThrottlerImpl.class).asEagerSingleton(); bind(ExecutorFactory.class).to(ExecutorFactoryImpl.class).asEagerSingleton(); bind(HttpClient.class).to(HttpClientImpl.class).asEagerSingleton(); bind(Bitflyer4j.class).to(Bitflyer4jImpl.class).asEagerSingleton(); bind(MarketService.class).to(MarketServiceImpl.class).asEagerSingleton(); bind(AccountService.class).to(AccountServiceImpl.class).asEagerSingleton(); bind(OrderService.class).to(OrderServiceImpl.class).asEagerSingleton(); bind(RealtimeService.class).to(RealtimeServiceImpl.class).asEagerSingleton(); } }; return Guice.createInjector(module).getInstance(Bitflyer4j.class); }