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

COVERAGE SUMMARY FOR SOURCE FILE [BYONComputeServiceContextModule.java]

nameclass, %method, %block, %line, %
BYONComputeServiceContextModule.java100% (5/5)100% (7/7)100% (73/73)100% (9/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BYONComputeServiceContextModule100% (1/1)100% (3/3)100% (49/49)100% (9/9)
BYONComputeServiceContextModule (): void 100% (1/1)100% (6/6)100% (2/2)
configure (): void 100% (1/1)100% (41/41)100% (6/6)
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)

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.byon.config;
20 
21import java.io.InputStream;
22import java.net.URI;
23 
24import javax.inject.Singleton;
25 
26import org.jclouds.byon.Node;
27import org.jclouds.byon.internal.BYONComputeServiceAdapter;
28import org.jclouds.byon.suppliers.SupplyFromProviderURIOrNodesProperty;
29import org.jclouds.compute.config.JCloudsNativeComputeServiceAdapterContextModule;
30import org.jclouds.concurrent.SingleThreaded;
31import org.jclouds.domain.Location;
32import org.jclouds.location.Provider;
33import org.jclouds.location.suppliers.OnlyLocationOrFirstZone;
34 
35import com.google.common.base.Function;
36import com.google.common.base.Supplier;
37import com.google.common.cache.Cache;
38import com.google.inject.Provides;
39import com.google.inject.TypeLiteral;
40 
41/**
42 * 
43 * @author Adrian Cole
44 */
45@SuppressWarnings("unchecked")
46@SingleThreaded
47public class BYONComputeServiceContextModule extends
48      JCloudsNativeComputeServiceAdapterContextModule<Supplier, Supplier> {
49 
50   public BYONComputeServiceContextModule() {
51      super(Supplier.class, Supplier.class, BYONComputeServiceAdapter.class);
52   }
53 
54   @Provides
55   @Singleton
56   Supplier provideApi(Supplier<Cache<String, Node>> in) {
57      return in;
58   }
59 
60   @Override
61   protected void configure() {
62      super.configure();
63      bind(new TypeLiteral<Supplier<Location>>() {
64      }).to(OnlyLocationOrFirstZone.class);
65      bind(new TypeLiteral<Function<URI, InputStream>>() {
66      }).to(SupplyFromProviderURIOrNodesProperty.class);
67      bind(new TypeLiteral<Supplier<InputStream>>() {
68      }).annotatedWith(Provider.class).to(SupplyFromProviderURIOrNodesProperty.class);
69      bind(new TypeLiteral<Function<URI, InputStream>>() {
70      }).to(SupplyFromProviderURIOrNodesProperty.class);
71   }
72 
73}

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