EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.rest.internal]

COVERAGE SUMMARY FOR SOURCE FILE [UtilsImpl.java]

nameclass, %method, %block, %line, %
UtilsImpl.java100% (1/1)6%   (1/17)36%  (27/75)38%  (10/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UtilsImpl100% (1/1)6%   (1/17)36%  (27/75)38%  (10/26)
asyncHttp (): HttpAsyncClient 0%   (0/1)0%   (0/3)0%   (0/1)
crypto (): Crypto 0%   (0/1)0%   (0/3)0%   (0/1)
date (): DateService 0%   (0/1)0%   (0/3)0%   (0/1)
getCrypto (): Crypto 0%   (0/1)0%   (0/3)0%   (0/1)
getDateService (): DateService 0%   (0/1)0%   (0/3)0%   (0/1)
getHttpAsyncClient (): HttpAsyncClient 0%   (0/1)0%   (0/3)0%   (0/1)
getHttpClient (): HttpClient 0%   (0/1)0%   (0/3)0%   (0/1)
getIoExecutor (): ExecutorService 0%   (0/1)0%   (0/3)0%   (0/1)
getJson (): Json 0%   (0/1)0%   (0/3)0%   (0/1)
getLoggerFactory (): Logger$LoggerFactory 0%   (0/1)0%   (0/3)0%   (0/1)
getUserExecutor (): ExecutorService 0%   (0/1)0%   (0/3)0%   (0/1)
http (): HttpClient 0%   (0/1)0%   (0/3)0%   (0/1)
ioExecutor (): ExecutorService 0%   (0/1)0%   (0/3)0%   (0/1)
json (): Json 0%   (0/1)0%   (0/3)0%   (0/1)
loggerFactory (): Logger$LoggerFactory 0%   (0/1)0%   (0/3)0%   (0/1)
userExecutor (): ExecutorService 0%   (0/1)0%   (0/3)0%   (0/1)
UtilsImpl (Json, HttpClient, HttpAsyncClient, Crypto, DateService, ExecutorSe... 100% (1/1)100% (27/27)100% (10/10)

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.rest.internal;
20 
21import java.util.concurrent.ExecutorService;
22 
23import javax.inject.Inject;
24import javax.inject.Named;
25 
26import org.jclouds.Constants;
27import org.jclouds.crypto.Crypto;
28import org.jclouds.date.DateService;
29import org.jclouds.json.Json;
30import org.jclouds.logging.Logger.LoggerFactory;
31import org.jclouds.rest.HttpAsyncClient;
32import org.jclouds.rest.HttpClient;
33import org.jclouds.rest.Utils;
34 
35import com.google.inject.Singleton;
36 
37/**
38 * @author Adrian Cole
39 */
40@Singleton
41public class UtilsImpl implements Utils {
42 
43   private final Json json;
44   private final HttpClient simpleClient;
45   private final HttpAsyncClient simpleAsyncClient;
46   private final Crypto encryption;
47   private final DateService date;
48   private final ExecutorService userExecutor;
49   private final ExecutorService ioExecutor;
50   private final LoggerFactory loggerFactory;
51 
52   @Inject
53   protected UtilsImpl(Json json, HttpClient simpleClient, HttpAsyncClient simpleAsyncClient,
54         Crypto encryption, DateService date,
55         @Named(Constants.PROPERTY_USER_THREADS) ExecutorService userThreads,
56         @Named(Constants.PROPERTY_IO_WORKER_THREADS) ExecutorService ioThreads, LoggerFactory loggerFactory) {
57      this.json = json;
58      this.simpleClient = simpleClient;
59      this.simpleAsyncClient = simpleAsyncClient;
60      this.encryption = encryption;
61      this.date = date;
62      this.userExecutor = userThreads;
63      this.ioExecutor = ioThreads;
64      this.loggerFactory = loggerFactory;
65   }
66 
67   @Override
68   public HttpAsyncClient asyncHttp() {
69      return simpleAsyncClient;
70   }
71 
72   @Override
73   public DateService date() {
74      return date;
75   }
76 
77   @Override
78   public Crypto crypto() {
79      return encryption;
80   }
81 
82   @Override
83   public DateService getDateService() {
84      return date;
85   }
86 
87   @Override
88   public Crypto getCrypto() {
89      return encryption;
90   }
91 
92   @Override
93   public HttpAsyncClient getHttpAsyncClient() {
94      return simpleAsyncClient;
95   }
96 
97   @Override
98   public HttpClient getHttpClient() {
99      return simpleClient;
100   }
101 
102   @Override
103   public HttpClient http() {
104      return simpleClient;
105   }
106 
107   @Override
108   public ExecutorService getIoExecutor() {
109      return ioExecutor;
110   }
111 
112   @Override
113   public ExecutorService getUserExecutor() {
114      return userExecutor;
115   }
116 
117   @Override
118   public ExecutorService ioExecutor() {
119      return ioExecutor;
120   }
121 
122   @Override
123   public ExecutorService userExecutor() {
124      return userExecutor;
125   }
126 
127   @Override
128   public LoggerFactory getLoggerFactory() {
129      return loggerFactory;
130   }
131 
132   @Override
133   public LoggerFactory loggerFactory() {
134      return loggerFactory;
135   }
136 
137   @Override
138   public Json getJson() {
139      return json;
140   }
141 
142   @Override
143   public Json json() {
144      return json;
145   }
146 
147}

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