Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 37f28411212b0bece1d87d43a9d74fdd9de7d9ba (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/*******************************************************************************
 * Copyright (c) 2008, 2013 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.osgi.launch;

import java.io.*;
import java.net.URL;
import java.security.cert.X509Certificate;
import java.util.*;
import org.eclipse.osgi.internal.framework.EquinoxContainer;
import org.osgi.framework.*;
import org.osgi.framework.launch.Framework;

/**
 * The System Bundle implementation for the Equinox Framework.
 * 
 * @since 3.5
 */
public class Equinox implements Framework {

	private final Framework systemBundle;

	public Equinox(Map<String, ?> configuration) {
		EquinoxContainer container = new EquinoxContainer(configuration);
		systemBundle = (Framework) container.getStorage().getModuleContainer().getModule(0).getBundle();
	}

	@Override
	public int getState() {
		return systemBundle.getState();
	}

	@Override
	public Dictionary<String, String> getHeaders() {
		return systemBundle.getHeaders();
	}

	@Override
	public ServiceReference<?>[] getRegisteredServices() {
		return systemBundle.getRegisteredServices();
	}

	@Override
	public ServiceReference<?>[] getServicesInUse() {
		return systemBundle.getServicesInUse();
	}

	@Override
	public boolean hasPermission(Object permission) {
		return systemBundle.hasPermission(permission);
	}

	@Override
	public URL getResource(String name) {
		return systemBundle.getResource(name);
	}

	@Override
	public Dictionary<String, String> getHeaders(String locale) {
		return systemBundle.getHeaders(locale);
	}

	@Override
	public Class<?> loadClass(String name) throws ClassNotFoundException {
		return systemBundle.loadClass(name);
	}

	@Override
	public Enumeration<URL> getResources(String name) throws IOException {
		return systemBundle.getResources(name);
	}

	@Override
	public long getLastModified() {
		return systemBundle.getLastModified();
	}

	@Override
	public BundleContext getBundleContext() {
		return systemBundle.getBundleContext();
	}

	@Override
	public Map<X509Certificate, List<X509Certificate>> getSignerCertificates(int signersType) {
		return systemBundle.getSignerCertificates(signersType);
	}

	@Override
	public Version getVersion() {
		return systemBundle.getVersion();
	}

	@Override
	public File getDataFile(String filename) {
		return systemBundle.getDataFile(filename);
	}

	@Override
	public int compareTo(Bundle o) {
		return systemBundle.compareTo(o);
	}

	public void start(int options) throws BundleException {
		systemBundle.start(options);
	}

	public void start() throws BundleException {
		systemBundle.start();
	}

	public void stop(int options) throws BundleException {
		systemBundle.stop(options);
	}

	public void stop() throws BundleException {
		systemBundle.stop();
	}

	public void update(InputStream input) throws BundleException {
		systemBundle.update(input);
	}

	public void update() throws BundleException {
		systemBundle.update();
	}

	public void uninstall() throws BundleException {
		systemBundle.uninstall();
	}

	public long getBundleId() {
		return systemBundle.getBundleId();
	}

	public String getLocation() {
		return systemBundle.getLocation();
	}

	public String getSymbolicName() {
		return systemBundle.getSymbolicName();
	}

	public Enumeration<String> getEntryPaths(String path) {
		return systemBundle.getEntryPaths(path);
	}

	public URL getEntry(String path) {
		return systemBundle.getEntry(path);
	}

	public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse) {
		return systemBundle.findEntries(path, filePattern, recurse);
	}

	public <A> A adapt(Class<A> type) {
		return systemBundle.adapt(type);
	}

	@Override
	public void init() throws BundleException {
		systemBundle.init();
	}

	/**
	 * @since 3.10
	 */
	@Override
	public void init(FrameworkListener... listeners) throws BundleException {
		systemBundle.init(listeners);
	}

	@Override
	public FrameworkEvent waitForStop(long timeout) throws InterruptedException {
		return systemBundle.waitForStop(timeout);
	}
}

Back to the top