Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2c70b84f28c41fb51c488cb03950a46188ea209f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.osgi.framework.dto;

import java.util.Map;
import org.osgi.dto.DTO;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;

/**
 * Data Transfer Object for a ServiceReference.
 * 
 * <p>
 * {@code ServiceReferenceDTO}s for all registered services can be obtained from
 * a {@link FrameworkDTO}. An installed Bundle can be adapted to provide a
 * {@code ServiceReferenceDTO[]} of the services registered by the Bundle. A
 * {@code ServiceReferenceDTO} obtained from a framework must convert service
 * property values which are not valid value types for DTOs to type
 * {@code String} using {@code String.valueOf(Object)}.
 * 
 * @author $Id$
 * @NotThreadSafe
 */
public class ServiceReferenceDTO extends DTO {
    /**
	 * The id of the service.
	 * 
	 * @see Constants#SERVICE_ID
	 */
    public long                id;

    /**
	 * The id of the bundle that registered the service.
	 * 
	 * @see ServiceReference#getBundle()
	 */
    public long                bundle;

    /**
	 * The properties for the service.
	 * 
	 * The value type must be a numerical type, Boolean, String, DTO or an array
	 * of any of the former.
	 * 
	 * @see ServiceReference#getProperty(String)
	 */
    public Map<String, Object> properties;

    /**
	 * The ids of the bundles that are using the service.
	 * 
	 * @see ServiceReference#getUsingBundles()
	 */
    public long[]              usingBundles;
}

Back to the top