EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.byon.config]

COVERAGE SUMMARY FOR SOURCE FILE [BYONComputeServiceContextModule.java]

nameclass, %method, %block, %line, %
BYONComputeServiceContextModule.java100% (6/6)100% (8/8)100% (88/88)100% (10/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BYONComputeServiceContextModule100% (1/1)100% (3/3)100% (58/58)100% (10/10)
BYONComputeServiceContextModule (): void 100% (1/1)100% (6/6)100% (2/2)
configure (): void 100% (1/1)100% (50/50)100% (7/7)
provideApi (Supplier): Supplier 100% (1/1)100% (2/2)100% (1/1)
     
class BYONComputeServiceContextModule$1100% (1/1)100% (1/1)100% (6/6)100% (1/1)
BYONComputeServiceContextModule$1 (BYONComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class BYONComputeServiceContextModule$2100% (1/1)100% (1/1)100% (6/6)100% (1/1)
BYONComputeServiceContextModule$2 (BYONComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class BYONComputeServiceContextModule$3100% (1/1)100% (1/1)100% (6/6)100% (1/1)
BYONComputeServiceContextModule$3 (BYONComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class BYONComputeServiceContextModule$4100% (1/1)100% (1/1)100% (6/6)100% (1/1)
BYONComputeServiceContextModule$4 (BYONComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class BYONComputeServiceContextModule$5100% (1/1)100% (1/1)100% (6/6)100% (1/1)
BYONComputeServiceContextModule$5 (BYONComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.byon.config;
20 
21import java.io.InputStream;
22import java.net.URI;
23import java.util.Map;
24 
25import javax.inject.Singleton;
26 
27import org.jclouds.byon.Node;
28import org.jclouds.byon.functions.NodesFromYamlStream;
29import org.jclouds.byon.internal.BYONComputeServiceAdapter;
30import org.jclouds.byon.suppliers.NodesParsedFromSupplier;
31import org.jclouds.byon.suppliers.SupplyFromProviderURIOrNodesProperty;
32import org.jclouds.compute.config.JCloudsNativeComputeServiceAdapterContextModule;
33import org.jclouds.concurrent.SingleThreaded;
34import org.jclouds.domain.Location;
35import org.jclouds.location.Provider;
36import org.jclouds.location.suppliers.OnlyLocationOrFirstZone;
37 
38import com.google.common.base.Function;
39import com.google.common.base.Supplier;
40import com.google.inject.Provides;
41import com.google.inject.TypeLiteral;
42 
43/**
44 * 
45 * @author Adrian Cole
46 */
47@SuppressWarnings("unchecked")
48@SingleThreaded
49public class BYONComputeServiceContextModule extends
50         JCloudsNativeComputeServiceAdapterContextModule<Supplier, Supplier> {
51 
52   public BYONComputeServiceContextModule() {
53      super(Supplier.class, Supplier.class, BYONComputeServiceAdapter.class);
54   }
55 
56   @Provides
57   @Singleton
58   Supplier provideApi(Supplier<Map<String, Node>> in) {
59      return in;
60   }
61 
62   @Override
63   protected void configure() {
64      super.configure();
65      bind(new TypeLiteral<Supplier<Location>>() {
66      }).to(OnlyLocationOrFirstZone.class);
67      bind(new TypeLiteral<Supplier<Map<String, Node>>>() {
68      }).to(NodesParsedFromSupplier.class);
69      bind(new TypeLiteral<Supplier<InputStream>>() {
70      }).annotatedWith(Provider.class).to(SupplyFromProviderURIOrNodesProperty.class);
71      bind(new TypeLiteral<Function<URI, InputStream>>() {
72      }).to(SupplyFromProviderURIOrNodesProperty.class);
73      // TODO make this somehow overridable via user request
74      bind(new TypeLiteral<Function<InputStream, Map<String, Node>>>() {
75      }).to(NodesFromYamlStream.class);
76   }
77 
78}

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