Clover Coverage Report - ARESTC 0.1.7-SNAPSHOT
Coverage timestamp: Fri Aug 27 2010 19:12:04 CEST
../../../../img/srcFileCovDistChart7.png 67% of files have more coverage
14   88   4   7
4   31   0.29   2
2     2  
1    
 
  ChainBuilder       Line # 28 14 0% 4 6 70% 0.7
 
  (16)
 
1    /*
2    *
3    * (C)opyright 2010, Nikolaos Georgosopoulos
4    *
5    * This file is part of ARESTC.
6   
7    ARESTC is free software: you can redistribute it and/or modify
8    it under the terms of the Lesser General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11   
12    ARESTC is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    GNU General Public License for more details.
16   
17    You should have received a copy of the Lesser General Public License
18    along with ARESTC. If not, see <http://www.gnu.org/licenses/>.
19   
20    */
21    package net.sf.arestc.core;
22   
23   
24    // TODO: Auto-generated Javadoc
25    /**
26    * The Class ChainBuilder.
27    */
 
28    public class ChainBuilder {
29   
30    /** The Constant instance. */
31    public static final ChainBuilder instance = new ChainBuilder();
32   
33    /**
34    * Gets the default chain.
35    *
36    * @param context
37    * the context
38    * @param initialTransformer
39    * the initial transformer
40    * @param endTransformer
41    * the end transformer
42    * @return the default chain
43    */
 
44  17 toggle public ConnectorCommand getDefaultChain(final ConnectorContext context,
45    final ConnectorCommand initialTransformer,
46    final ConnectorCommand endTransformer) {
47   
48  17 final ConnectorCommand transform = new TransformToServiceCall(context
49    .getService().getMethod());
50  17 final ConnectorCommand call = new CallServer(new TransformResponse(
51    endTransformer));
52  17 transform.setNextLink(call);
53  17 ConnectorCommand firstLink = transform;
54  17 if (null != initialTransformer) {
55  0 initialTransformer.setNextLink(transform);
56  0 firstLink = initialTransformer;
57    }
58   
59  17 return firstLink;
60    }
61   
62    /**
63    * Gets the dummy chain.
64    *
65    * @param context
66    * the context
67    * @param initialTransformer
68    * the initial transformer
69    * @param endTransformer
70    * the end transformer
71    * @return the dummy chain
72    */
 
73  1 toggle public ConnectorCommand getDummyChain(final ConnectorContext context,
74    final ConnectorCommand initialTransformer,
75    final ConnectorCommand endTransformer) {
76   
77  1 final ConnectorCommand dummy = new DummyTransformer(
78    new TransformResponse(endTransformer));
79   
80  1 ConnectorCommand firstLink = dummy;
81  1 if (null != initialTransformer) {
82  0 initialTransformer.setNextLink(dummy);
83  0 firstLink = initialTransformer;
84    }
85   
86  1 return firstLink;
87    }
88    }