1 /* 2 * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentFactory.java,v 1.19 2006/06/16 16:31:26 hargrave Exp $ 3 * 4 * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.osgi.service.component; 20 21 import java.util.Dictionary; 22 23 /** 24 * When a component is declared with the <code>factory</code> attribute on its 25 * <code>component</code> element, the Service Component Runtime will register 26 * a Component Factory service to allow new component configurations to be 27 * created and activated rather than automatically creating and activating 28 * component configuration as necessary. 29 * 30 * @version $Revision: 1.19 $ 31 */ 32 public interface ComponentFactory { 33 /** 34 * Create and activate a new component configuration. Additional properties 35 * may be provided for the component configuration. 36 * 37 * @param properties Additional properties for the component configuration 38 * or <code>null</code> if there are no additional properties. 39 * @return A <code>ComponentInstance</code> object encapsulating the 40 * component instance of the component configuration. The component 41 * configuration has been activated and, if the component specifies 42 * a <code>service</code> element, the component instance has been 43 * registered as a service. 44 * @throws ComponentException If the Service Component Runtime is unable to 45 * activate the component configuration. 46 */ 47 public ComponentInstance newInstance(Dictionary properties); 48 } 49