blob: b8929172563f60b1838e72162da7cad1bb10c2f8 [file] [log] [blame]
Carsten Ziegelerfc1e6922015-02-05 09:41:52 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. 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,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.apache.felix.scr;
20
21
22import org.osgi.framework.Bundle;
23
24
25/**
26 * The <code>ScrService</code> represents the Declarative Services main
27 * controller also known as the Service Component Runtime or SCR for short.
28 * It provides access to the components managed the SCR.
29 *
30 * @deprecated Use the ServiceComponentRuntime service.
31 */
32@Deprecated
33public interface ScrService
34{
35
36 /**
37 * Returns an array of all components managed by this SCR instance. The
38 * components are returned in ascending order of their component.id. If
39 * there are no components currently managed by the SCR, <code>null</code>
40 * is returned.
41 *
42 * @return The components or <code>null</code> if there are none.
43 */
44 Component[] getComponents();
45
46
47 /**
48 * Returns the component whose component.id matches the given
49 * <code>componentId</code> or <code>null</code> if no component with the
50 * given id is currently managed.
51 *
52 * @param componentId The ID of the component to return
53 *
54 * @return The indicated component or <code>null</code> if no such
55 * component exists.
56 */
57 Component getComponent( long componentId );
58
59
60 /**
61 * Returns the components whose <code>component.name</code> matches the
62 * given <code>componentName</code> or <code>null</code> if no component
63 * with the given name is currently managed.
64 * <p>
65 * If the component name refers to a component factory component or a
66 * component configured with multiple factory configurations this method
67 * returns multiple component instances.
68 *
69 * @param componentName The name of the component to return
70 *
71 * @return The indicated components or <code>null</code> if no such
72 * component exists.
73 * @since 1.5 (Apache Felix Declarative Services 1.4.2)
74 */
75 Component[] getComponents( String componentName );
76
77
78 /**
79 * Reuturns an array of all components managed by this SCR instance on
80 * behalf of the given bundle. The components are returned in ascending
81 * order of their component.id. If there are no components managed by the
82 * SCR for the given bundle, <code>null</code> is returned.
83 *
84 * @param bundle The <code>Bundle</code> whose components are to be
85 * returned.
86 *
87 * @return The bundle's components or <code>null</code> if the bundle
88 * has none.
89 */
90 Component[] getComponents( Bundle bundle );
91
92}