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

COVERAGE SUMMARY FOR SOURCE FILE [BlobStoreMapModule.java]

nameclass, %method, %block, %line, %
BlobStoreMapModule.java100% (3/3)83%  (5/6)71%  (44/62)88%  (7/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BlobStoreMapModule$BlobMapFactory100% (1/1)50%  (1/2)14%  (3/21)50%  (1/2)
create (String, ListContainerOptions): BlobMap 0%   (0/1)0%   (0/18)0%   (0/1)
BlobStoreMapModule$BlobMapFactory (): void 100% (1/1)100% (3/3)100% (1/1)
     
class BlobStoreMapModule100% (1/1)100% (2/2)100% (18/18)100% (5/5)
BlobStoreMapModule (): void 100% (1/1)100% (3/3)100% (2/2)
configure (): void 100% (1/1)100% (15/15)100% (3/3)
     
class BlobStoreMapModule$InputStreamMapFactory100% (1/1)100% (2/2)100% (23/23)100% (2/2)
BlobStoreMapModule$InputStreamMapFactory (): void 100% (1/1)100% (3/3)100% (1/1)
create (String, ListContainerOptions): InputStreamMap 100% (1/1)100% (20/20)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.blobstore.config;
20 
21import javax.inject.Inject;
22import javax.inject.Provider;
23 
24import org.jclouds.blobstore.BlobMap;
25import org.jclouds.blobstore.BlobStore;
26import org.jclouds.blobstore.InputStreamMap;
27import org.jclouds.blobstore.domain.BlobBuilder;
28import org.jclouds.blobstore.internal.BlobMapImpl;
29import org.jclouds.blobstore.internal.InputStreamMapImpl;
30import org.jclouds.blobstore.options.ListContainerOptions;
31import org.jclouds.blobstore.strategy.ContainsValueInListStrategy;
32import org.jclouds.blobstore.strategy.GetBlobsInListStrategy;
33import org.jclouds.blobstore.strategy.PutBlobsStrategy;
34import org.jclouds.blobstore.strategy.internal.ListContainerAndRecurseThroughFolders;
35import org.jclouds.crypto.Crypto;
36 
37import com.google.inject.AbstractModule;
38import com.google.inject.Scopes;
39 
40/**
41 * Configures the domain object mappings needed for all Blob implementations
42 * 
43 * @author Adrian Cole
44 */
45public class BlobStoreMapModule extends AbstractModule {
46 
47   /**
48    * explicit factories are created here as it has been shown that Assisted Inject is extremely
49    * inefficient. http://code.google.com/p/google-guice/issues/detail?id=435
50    */
51   @Override
52   protected void configure() {
53      bind(BlobMap.Factory.class).to(BlobMapFactory.class).in(Scopes.SINGLETON);
54      bind(InputStreamMap.Factory.class).to(InputStreamMapFactory.class).in(Scopes.SINGLETON);
55   }
56 
57   private static class BlobMapFactory implements BlobMap.Factory {
58      @Inject
59      BlobStore connection;
60      @Inject
61      GetBlobsInListStrategy getAllBlobs;
62      @Inject
63      ContainsValueInListStrategy containsValueStrategy;
64      @Inject
65      PutBlobsStrategy putBlobsStrategy;
66      @Inject
67      ListContainerAndRecurseThroughFolders listStrategy;
68      @Inject
69      Provider<BlobBuilder> blobBuilders;
70 
71      public BlobMap create(String containerName, ListContainerOptions options) {
72         return new BlobMapImpl(connection, getAllBlobs, containsValueStrategy, putBlobsStrategy, listStrategy,
73               containerName, options, blobBuilders);
74      }
75 
76   }
77 
78   private static class InputStreamMapFactory implements InputStreamMap.Factory {
79      @Inject
80      BlobStore connection;
81      @Inject
82      Provider<BlobBuilder> blobBuilders;
83      @Inject
84      GetBlobsInListStrategy getAllBlobs;
85      @Inject
86      ContainsValueInListStrategy containsValueStrategy;
87      @Inject
88      PutBlobsStrategy putBlobsStrategy;
89      @Inject
90      Crypto crypto;
91      @Inject
92      ListContainerAndRecurseThroughFolders listStrategy;
93 
94      public InputStreamMap create(String containerName, ListContainerOptions options) {
95         return new InputStreamMapImpl(connection, blobBuilders, getAllBlobs, listStrategy, containsValueStrategy,
96               putBlobsStrategy, containerName, options, crypto);
97      }
98 
99   }
100 
101}

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