|
|||||||||||||||||||
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 | |||||||||||||||
PicoContainer.java | - | - | - | - |
|
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 |
* Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
|
|
9 |
*****************************************************************************/
|
|
10 |
|
|
11 |
package org.picocontainer;
|
|
12 |
|
|
13 |
import java.util.Collection;
|
|
14 |
|
|
15 |
/**
|
|
16 |
* PicoContainer - guaranteed to resolve the needs of components
|
|
17 |
* as it instantiates them.
|
|
18 |
*
|
|
19 |
*/
|
|
20 |
public interface PicoContainer { |
|
21 |
|
|
22 |
/**
|
|
23 |
* Does the internals have a partilcilar component type?
|
|
24 |
* @param componentKey The component type to look for.
|
|
25 |
* @return true if it does have the component type
|
|
26 |
*/
|
|
27 |
boolean hasComponent(Object componentKey);
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Get a component for a component type.
|
|
31 |
* @param componentKey The component type to look for.
|
|
32 |
* @return the component, or null of no such component.
|
|
33 |
*/
|
|
34 |
Object getComponent(Object componentKey); |
|
35 |
|
|
36 |
/**
|
|
37 |
* Get all components (random order).
|
|
38 |
* @return A collection of components.
|
|
39 |
*/
|
|
40 |
Collection getComponents(); |
|
41 |
|
|
42 |
/**
|
|
43 |
* Get all component types (random order).
|
|
44 |
* @return A collection of component types.
|
|
45 |
*/
|
|
46 |
Collection getComponentKeys(); |
|
47 |
|
|
48 |
/**
|
|
49 |
* Initialize the internals.
|
|
50 |
*/
|
|
51 |
void instantiateComponents() throws PicoInitializationException; |
|
52 |
|
|
53 |
/**
|
|
54 |
* Shorthand for {@link #getComponentMulticaster(boolean, boolean)}(true, true).
|
|
55 |
* @return a proxy.
|
|
56 |
*/
|
|
57 |
Object getComponentMulticaster(); |
|
58 |
|
|
59 |
/**
|
|
60 |
* Returns a proxy that implements the union of all the components'
|
|
61 |
* interfaces.
|
|
62 |
* Calling a method on the returned Object will call the
|
|
63 |
* method on all components in the internals that implement
|
|
64 |
* that interface.
|
|
65 |
*
|
|
66 |
* @param callInInstantiationOrder whether to call the methods in the order of instantiation (true) or reverse (false)
|
|
67 |
* @param callUnmanagedComponents whether to exclude components registered via instance rather than class
|
|
68 |
*/
|
|
69 |
Object getComponentMulticaster(boolean callInInstantiationOrder, boolean callUnmanagedComponents); |
|
70 |
|
|
71 |
|
|
72 |
} |
|
73 |
|
|