Search in sources :

Example 1 with Log4JLoggingModule

use of org.jclouds.logging.log4j.config.Log4JLoggingModule in project whirr by apache.

the class ComputeServiceContextBuilder method build.

public static ComputeServiceContext build(ClusterSpec spec) throws IOException {
    Set<AbstractModule> wiring = ImmutableSet.of(new JschSshClientModule(), new Log4JLoggingModule());
    ComputeServiceContext context = new ComputeServiceContextFactory().createContext(spec.getProvider(), spec.getIdentity(), spec.getCredential(), wiring);
    return context;
}
Also used : Log4JLoggingModule(org.jclouds.logging.log4j.config.Log4JLoggingModule) JschSshClientModule(org.jclouds.ssh.jsch.config.JschSshClientModule) ComputeServiceContext(org.jclouds.compute.ComputeServiceContext) ComputeServiceContextFactory(org.jclouds.compute.ComputeServiceContextFactory) AbstractModule(com.google.inject.AbstractModule)

Example 2 with Log4JLoggingModule

use of org.jclouds.logging.log4j.config.Log4JLoggingModule in project hive by apache.

the class CloudComputeService method initComputeServiceContext.

private ComputeServiceContext initComputeServiceContext(CloudComputeConfig.CloudComputeProvider provider, String identity, String credential) {
    Properties overrides = new Properties();
    overrides.put(ComputeServiceProperties.POLL_INITIAL_PERIOD, String.valueOf(60L * 1000L));
    overrides.put(ComputeServiceProperties.POLL_MAX_PERIOD, String.valueOf(600L * 1000L));
    overrides.put(Constants.PROPERTY_MAX_RETRIES, String.valueOf(60));
    return ContextBuilder.newBuilder(provider.getmJcloudsId()).credentials(identity, credential).modules(ImmutableSet.of(new SshjSshClientModule(), new Log4JLoggingModule())).overrides(overrides).buildView(ComputeServiceContext.class);
}
Also used : SshjSshClientModule(org.jclouds.sshj.config.SshjSshClientModule) Log4JLoggingModule(org.jclouds.logging.log4j.config.Log4JLoggingModule) ComputeServiceProperties(org.jclouds.compute.config.ComputeServiceProperties)

Aggregations

Log4JLoggingModule (org.jclouds.logging.log4j.config.Log4JLoggingModule)2 AbstractModule (com.google.inject.AbstractModule)1 ComputeServiceContext (org.jclouds.compute.ComputeServiceContext)1 ComputeServiceContextFactory (org.jclouds.compute.ComputeServiceContextFactory)1 ComputeServiceProperties (org.jclouds.compute.config.ComputeServiceProperties)1 JschSshClientModule (org.jclouds.ssh.jsch.config.JschSshClientModule)1 SshjSshClientModule (org.jclouds.sshj.config.SshjSshClientModule)1