View Javadoc
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 org.picocontainer.internals.Parameter; 14 15 public interface RegistrationPicoContainer extends PicoContainer { 16 17 /*** 18 * Registers a component. Same as calling {@link #registerComponent(Object, Class)} 19 * with the componentImplementation as key. 20 * 21 * @param componentImplementation The class of the component to instantiate 22 * @throws PicoRegistrationException If a registration problem 23 */ 24 void registerComponentByClass(Class componentImplementation) 25 throws PicoRegistrationException, PicoIntrospectionException; 26 27 /*** 28 * Alternate way of registering components with additional 29 * component type. 30 * 31 * @param componentKey Component type 32 * @param componentImplementation The class of the component to instantiate 33 * @throws PicoRegistrationException If a registration problem 34 */ 35 void registerComponent(Object componentKey, Class componentImplementation) 36 throws PicoRegistrationException, PicoIntrospectionException; 37 38 /*** 39 * Registers a component that is instantiated and configured outside 40 * the internals. Useful in cases where pico doesn't have sufficient 41 * knowledge to instantiate a component. 42 * 43 * @param componentKey Component type 44 * @param componentInstance preinstantiated component 45 * @throws PicoRegistrationException If a registration problem 46 */ 47 void registerComponent(Object componentKey, Object componentInstance) 48 throws PicoRegistrationException, PicoIntrospectionException; 49 50 /*** 51 * Registers an instantiated component. This might be because you are 52 * creating trees of Pico containers or if you have a class that you want treated 53 * as a component, but is not Pico component compatible. Will use the components class as key. 54 * 55 * @param componentInstance The pre instantiated component to register 56 * @throws PicoRegistrationException 57 */ 58 void registerComponentByInstance(Object componentInstance) 59 throws PicoRegistrationException, PicoIntrospectionException; 60 61 /*** 62 * Register component with key, implementation and bindings for its parameters. 63 * 64 * @param componentKey Component type 65 * @param componentImplementation The class of the component to instantiate 66 * @throws PicoRegistrationException If a registration problem 67 */ 68 void registerComponent(Object componentKey, Class componentImplementation, Parameter[] parameters) 69 throws PicoRegistrationException; 70 71 /*** 72 * Add a parameter to a component. Used for configuring them. 73 * Very liekly to change before release. 74 * @param componentKey The component type 75 * @param parameter The parameter it pertains to 76 * @param arg The argukemt to pass in. 77 */ 78 void addParameterToComponent(Object componentKey, Class parameter, Object arg) throws PicoIntrospectionException; 79 80 }

This page was automatically generated by Maven