blob: 9f2d9f51be9b54f66ea1fab2dc7546bfafcc04e9 [file] [log] [blame]
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +00001/*
Richard S. Hall33b07d12006-10-18 22:02:38 +00002 * $Header: /cvshome/build/org.osgi.service.component/src/org/osgi/service/component/ComponentInstance.java,v 1.13 2006/06/16 16:31:26 hargrave Exp $
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +00003 *
Richard S. Hall33b07d12006-10-18 22:02:38 +00004 * Copyright (c) OSGi Alliance (2004, 2006). All Rights Reserved.
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +00005 *
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
19package org.osgi.service.component;
20
21/**
22 * A ComponentInstance encapsulates a component instance of an activated
23 * component configuration. ComponentInstances are created whenever a component
24 * configuration is activated.
25 *
26 * <p>
27 * ComponentInstances are never reused. A new ComponentInstance object will be
28 * created when the component configuration is activated again.
29 *
Richard S. Hall33b07d12006-10-18 22:02:38 +000030 * @version $Revision: 1.13 $
Michael E. Rodriguez86f57b02006-03-29 21:05:08 +000031 */
32public interface ComponentInstance {
33 /**
34 * Dispose of the component configuration for this component instance. The
35 * component configuration will be deactivated. If the component
36 * configuration has already been deactivated, this method does nothing.
37 */
38 public void dispose();
39
40 /**
41 * Returns the component instance of the activated component configuration.
42 *
43 * @return The component instance or <code>null</code> if the component
44 * configuration has been deactivated.
45 */
46 public Object getInstance();
Richard S. Hall33b07d12006-10-18 22:02:38 +000047}