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

COVERAGE SUMMARY FOR SOURCE FILE [BindComputeStrategiesByClass.java]

nameclass, %method, %block, %line, %
BindComputeStrategiesByClass.java0%   (0/1)0%   (0/11)0%   (0/102)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BindComputeStrategiesByClass0%   (0/1)0%   (0/11)0%   (0/102)0%   (0/27)
BindComputeStrategiesByClass (): void 0%   (0/1)0%   (0/3)0%   (0/1)
bindAddNodeWithTagStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindDestroyNodeStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindGetNodeMetadataStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindListNodesStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindRebootNodeStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindRunNodesAndAddToSetStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindStartNodeStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
bindStopNodeStrategy (Class): void 0%   (0/1)0%   (0/8)0%   (0/2)
configure (): void 0%   (0/1)0%   (0/33)0%   (0/9)
defineRunNodesAndAddToSetStrategy (): Class 0%   (0/1)0%   (0/2)0%   (0/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.compute.config;
20 
21import org.jclouds.compute.strategy.CreateNodeWithGroupEncodedIntoName;
22import org.jclouds.compute.strategy.DestroyNodeStrategy;
23import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
24import org.jclouds.compute.strategy.ListNodesStrategy;
25import org.jclouds.compute.strategy.RebootNodeStrategy;
26import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet;
27import org.jclouds.compute.strategy.ResumeNodeStrategy;
28import org.jclouds.compute.strategy.SuspendNodeStrategy;
29import org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet;
30 
31import com.google.inject.AbstractModule;
32import com.google.inject.Scopes;
33 
34/**
35 * 
36 * @author Adrian Cole
37 * 
38 */
39public abstract class BindComputeStrategiesByClass extends AbstractModule {
40   protected void configure() {
41      bindRunNodesAndAddToSetStrategy(defineRunNodesAndAddToSetStrategy());
42      bindAddNodeWithTagStrategy(defineAddNodeWithTagStrategy());
43      bindListNodesStrategy(defineListNodesStrategy());
44      bindGetNodeMetadataStrategy(defineGetNodeMetadataStrategy());
45      bindRebootNodeStrategy(defineRebootNodeStrategy());
46      bindStartNodeStrategy(defineStartNodeStrategy());
47      bindStopNodeStrategy(defineStopNodeStrategy());
48      bindDestroyNodeStrategy(defineDestroyNodeStrategy());
49   }
50 
51   protected void bindRunNodesAndAddToSetStrategy(Class<? extends CreateNodesInGroupThenAddToSet> clazz) {
52      bind(CreateNodesInGroupThenAddToSet.class).to(clazz).in(Scopes.SINGLETON);
53   }
54 
55   /**
56    * needed, if {@link CreateNodesInGroupThenAddToSet} requires it
57    */
58   protected void bindAddNodeWithTagStrategy(Class<? extends CreateNodeWithGroupEncodedIntoName> clazz) {
59      bind(CreateNodeWithGroupEncodedIntoName.class).to(clazz).in(Scopes.SINGLETON);
60   }
61 
62   protected void bindDestroyNodeStrategy(Class<? extends DestroyNodeStrategy> clazz) {
63      bind(DestroyNodeStrategy.class).to(clazz).in(Scopes.SINGLETON);
64   }
65 
66   protected void bindRebootNodeStrategy(Class<? extends RebootNodeStrategy> clazz) {
67      bind(RebootNodeStrategy.class).to(clazz).in(Scopes.SINGLETON);
68   }
69 
70   protected void bindStartNodeStrategy(Class<? extends ResumeNodeStrategy> clazz) {
71      bind(ResumeNodeStrategy.class).to(clazz).in(Scopes.SINGLETON);
72   }
73 
74   protected void bindStopNodeStrategy(Class<? extends SuspendNodeStrategy> clazz) {
75      bind(SuspendNodeStrategy.class).to(clazz).in(Scopes.SINGLETON);
76   }
77 
78   protected void bindGetNodeMetadataStrategy(Class<? extends GetNodeMetadataStrategy> clazz) {
79      bind(GetNodeMetadataStrategy.class).to(clazz).in(Scopes.SINGLETON);
80   }
81 
82   protected void bindListNodesStrategy(Class<? extends ListNodesStrategy> clazz) {
83      bind(ListNodesStrategy.class).to(clazz).in(Scopes.SINGLETON);
84   }
85 
86   protected Class<? extends CreateNodesInGroupThenAddToSet> defineRunNodesAndAddToSetStrategy() {
87      return CreateNodesWithGroupEncodedIntoNameThenAddToSet.class;
88   }
89 
90   /**
91    * needed, if {@link CreateNodesInGroupThenAddToSet} requires it
92    */
93   protected abstract Class<? extends CreateNodeWithGroupEncodedIntoName> defineAddNodeWithTagStrategy();
94 
95   protected abstract Class<? extends DestroyNodeStrategy> defineDestroyNodeStrategy();
96 
97   protected abstract Class<? extends RebootNodeStrategy> defineRebootNodeStrategy();
98 
99   protected abstract Class<? extends ResumeNodeStrategy> defineStartNodeStrategy();
100 
101   protected abstract Class<? extends SuspendNodeStrategy> defineStopNodeStrategy();
102 
103   protected abstract Class<? extends GetNodeMetadataStrategy> defineGetNodeMetadataStrategy();
104 
105   protected abstract Class<? extends ListNodesStrategy> defineListNodesStrategy();
106}

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