|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
CachingPicoContainer.java | - | 75% | 66.7% | 71.4% |
|
1 |
/*****************************************************************************
|
|
2 |
* Copyright (C) PicoContainer Organization. All rights reserved. *
|
|
3 |
* ------------------------------------------------------------------------- *
|
|
4 |
* The software in this package is published under the terms of the BSD *
|
|
5 |
* style license a copy of which has been included with this distribution in *
|
|
6 |
* the LICENSE.txt file. *
|
|
7 |
* *
|
|
8 |
* Original code by the committers *
|
|
9 |
*****************************************************************************/
|
|
10 |
package org.picocontainer.alternatives;
|
|
11 |
|
|
12 |
import org.picocontainer.MutablePicoContainer;
|
|
13 |
import org.picocontainer.PicoContainer;
|
|
14 |
import org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer;
|
|
15 |
import org.picocontainer.defaults.CachingComponentAdapterFactory;
|
|
16 |
import org.picocontainer.defaults.ComponentAdapterFactory;
|
|
17 |
import org.picocontainer.defaults.DefaultComponentAdapterFactory;
|
|
18 |
import org.picocontainer.defaults.DefaultPicoContainer;
|
|
19 |
|
|
20 |
import java.io.Serializable;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* <p/>
|
|
24 |
* The Cacing version of {@link org.picocontainer.defaults.DefaultPicoContainer}
|
|
25 |
* </p>
|
|
26 |
*
|
|
27 |
* @author Paul Hammant
|
|
28 |
* @version $Revision: 1.1 $
|
|
29 |
*/
|
|
30 |
public class CachingPicoContainer extends AbstractDelegatingMutablePicoContainer implements Serializable { |
|
31 |
|
|
32 |
/**
|
|
33 |
* Creates a new container with a parent container.
|
|
34 |
*/
|
|
35 | 74 |
public CachingPicoContainer(ComponentAdapterFactory caf, PicoContainer parent) {
|
36 | 74 |
this(parent, new CachingComponentAdapterFactory(caf)); |
37 |
} |
|
38 |
|
|
39 | 74 |
private CachingPicoContainer(PicoContainer parent, CachingComponentAdapterFactory caf) {
|
40 | 74 |
super(new DefaultPicoContainer(caf, parent)); |
41 |
|
|
42 |
} |
|
43 |
|
|
44 |
/**
|
|
45 |
* Creates a new container with a parent container.
|
|
46 |
*/
|
|
47 | 72 |
public CachingPicoContainer(PicoContainer parent) {
|
48 | 72 |
this(new DefaultComponentAdapterFactory(), parent); |
49 |
} |
|
50 |
|
|
51 |
/**
|
|
52 |
* Creates a new container with a parent container.
|
|
53 |
*/
|
|
54 | 0 |
public CachingPicoContainer(ComponentAdapterFactory caf) {
|
55 | 0 |
this(caf, null); |
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Creates a new container with no parent container.
|
|
61 |
*/
|
|
62 | 0 |
public CachingPicoContainer() {
|
63 | 0 |
this((PicoContainer) null); |
64 |
} |
|
65 |
|
|
66 |
|
|
67 | 6 |
public MutablePicoContainer makeChildContainer() {
|
68 | 6 |
ImplementationHidingCachingPicoContainer pc = new ImplementationHidingCachingPicoContainer(this); |
69 | 6 |
getDelegate().addChildContainer(pc); |
70 | 6 |
return pc;
|
71 |
} |
|
72 |
|
|
73 |
} |
|
74 |
|
|