1 /* 2 * Copyright 2005 Joe Walker 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.directwebremoting; 17 18 import java.util.Collection; 19 20 /** 21 * A very basic IoC container 22 * @author Joe Walker [joe at getahead dot ltd dot uk] 23 */ 24 public interface Container 25 { 26 /** 27 * Get an instance of a bean of a given name (usually name=class name). 28 * @param name The type to get an instance of 29 * @return The object of the given type, or null if the object does not exist 30 */ 31 Object getBean(String name); 32 33 /** 34 * Get a list of all the available beans. 35 * Implementation of this method is optional so it is valid for this method 36 * to return an empty collection, but to return Objects when queried 37 * directly using {@link #getBean(String)}. This method should only be used 38 * for debugging purposes. 39 * @return A collection containing all the availble bean names. 40 */ 41 Collection getBeanNames(); 42 } 43