EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.ec2]

COVERAGE SUMMARY FOR SOURCE FILE [EC2ContextBuilder.java]

nameclass, %method, %block, %line, %
EC2ContextBuilder.java100% (1/1)80%  (4/5)84%  (26/31)78%  (7/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EC2ContextBuilder100% (1/1)80%  (4/5)84%  (26/31)78%  (7/9)
addClientModule (List): void 0%   (0/1)0%   (0/5)0%   (0/2)
EC2ContextBuilder (Properties): void 100% (1/1)100% (6/6)100% (2/2)
addContextModule (List): void 100% (1/1)100% (7/7)100% (2/2)
addImageResolutionModule (): void 100% (1/1)100% (8/8)100% (2/2)
withModules (Iterable): EC2ContextBuilder 100% (1/1)100% (5/5)100% (1/1)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.ec2;
20 
21import java.util.List;
22import java.util.Properties;
23 
24import org.jclouds.ec2.compute.config.EC2ComputeServiceContextModule;
25import org.jclouds.ec2.compute.config.EC2ResolveImagesModule;
26import org.jclouds.ec2.config.EC2RestClientModule;
27import org.jclouds.compute.ComputeServiceContextBuilder;
28import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
29import org.jclouds.logging.jdk.config.JDKLoggingModule;
30 
31import com.google.inject.Injector;
32import com.google.inject.Module;
33 
34/**
35 * Creates {@link EC2ComputeServiceContext} or {@link Injector} instances based on the most commonly
36 * requested arguments.
37 * <p/>
38 * Note that Threadsafe objects will be bound as singletons to the Injector or Context provided.
39 * <p/>
40 * <p/>
41 * If no <code>Module</code>s are specified, the default {@link JDKLoggingModule logging} and
42 * {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be installed.
43 * 
44 * @author Adrian Cole
45 * @see EC2ComputeServiceContext
46 */
47public class EC2ContextBuilder extends ComputeServiceContextBuilder<EC2Client, EC2AsyncClient> {
48 
49   public EC2ContextBuilder(Properties props) {
50      super(EC2Client.class, EC2AsyncClient.class, props);
51   }
52 
53   @Override
54   public EC2ContextBuilder withModules(Iterable<Module> modules) {
55      return (EC2ContextBuilder) super.withModules(modules);
56   }
57 
58   @Override
59   protected void addContextModule(List<Module> modules) {
60      modules.add(new EC2ComputeServiceContextModule());
61   }
62 
63   @Override
64   protected void addClientModule(List<Module> modules) {
65      modules.add(EC2RestClientModule.create());
66   }
67 
68   @Override
69   protected void addImageResolutionModule() {
70      modules.add(new EC2ResolveImagesModule());
71   }
72}

[all classes][org.jclouds.ec2]
EMMA 2.0.5312 (C) Vladimir Roubtsov