00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 package org.knopflerfish.framework;
00036
00037 import java.io.InputStream;
00038 import java.security.ProtectionDomain;
00039 import java.util.*;
00040
00041 import org.osgi.framework.*;
00042
00043
00048 class PermissionOps {
00049
00050 void registerService() {
00051 }
00052
00053 boolean checkPermissions() {
00054 return false;
00055 }
00056
00057
00058
00059
00060
00061 boolean okClassAdminPerm(Bundle b) {
00062 return true;
00063 }
00064
00065 void checkExecuteAdminPerm(Bundle b) {
00066 }
00067
00068 void checkExtensionLifecycleAdminPerm(Bundle b) {
00069 }
00070
00071 void checkExtensionLifecycleAdminPerm(Bundle b, Object checkContext) {
00072 }
00073
00074 void checkLifecycleAdminPerm(Bundle b) {
00075 }
00076
00077 void checkLifecycleAdminPerm(Bundle b, Object checkContext) {
00078 }
00079
00080 void checkListenerAdminPerm(Bundle b) {
00081 }
00082
00083 void checkMetadataAdminPerm(Bundle b) {
00084 }
00085
00086 void checkResolveAdminPerm() {
00087 }
00088
00089 void checkResourceAdminPerm(Bundle b) {
00090 }
00091
00092 boolean okResourceAdminPerm(Bundle b) {
00093 return true;
00094 }
00095
00096 void checkStartLevelAdminPerm() {
00097 }
00098
00099
00100
00101
00102
00103 boolean okFragmentBundlePerm(BundleImpl b) {
00104 return true;
00105 }
00106
00107 boolean okHostBundlePerm(BundleImpl b) {
00108 return true;
00109 }
00110
00111 boolean okProvideBundlePerm(BundleImpl b) {
00112 return true;
00113 }
00114
00115 boolean okRequireBundlePerm(BundleImpl b) {
00116 return true;
00117 }
00118
00119
00120
00121
00122
00123 boolean hasImportPackagePermission(BundleImpl b, String pkg) {
00124 return true;
00125 }
00126
00127
00134 String missingMandatoryPackagePermissions(BundlePackages bpkgs, List okImports) {
00135 for (Iterator i = bpkgs.getImports(); i.hasNext(); ) {
00136 okImports.add(i.next());
00137 }
00138 return null;
00139 }
00140
00141
00142
00143
00144
00145 void checkRegisterServicePerm(String clazz) {
00146 }
00147
00148 boolean okGetServicePerm(String clazz) {
00149 return true;
00150 }
00151
00152 void checkGetServicePerms(String [] classes) {
00153 }
00154
00155 boolean okGetServicePerms(String [] classes) {
00156 return true;
00157 }
00158
00159 void filterGetServicePermission(Set srs) {
00160 }
00161
00162
00163
00164
00165
00166 InputStream callGetInputStream(final BundleArchive archive,
00167 final String name,
00168 final int ix) {
00169 return archive.getInputStream(name, ix);
00170 }
00171
00172
00173 Enumeration callFindResourcesPath(final BundleArchive archive,
00174 final String path) {
00175 return archive.findResourcesPath(path);
00176 }
00177
00178
00179
00180
00181
00182 Object callSearchFor(final BundleClassLoader cl,
00183 final String name,
00184 final String pkg,
00185 final String path,
00186 final BundleClassLoader.SearchAction action,
00187 final boolean onlyFirst,
00188 final BundleClassLoader requestor,
00189 final HashSet visited) {
00190 return cl.searchFor(name, pkg, path, action, onlyFirst, requestor, visited);
00191 }
00192
00193
00194
00195
00196
00197 void callStart0(final BundleImpl b) throws BundleException {
00198 b.start0();
00199 }
00200
00201
00202 BundleException callStop0(final BundleImpl b, final boolean resetPersistent) {
00203 return b.stop0(resetPersistent);
00204 }
00205
00206
00207 void callUpdate0(final BundleImpl b, final InputStream in, final boolean wasActive)
00208 throws BundleException {
00209 b.update0(in, wasActive);
00210 }
00211
00212
00213 void callUninstall0(final BundleImpl b) {
00214 b.uninstall0();
00215 }
00216
00217
00218 void callStartOnLaunch(final BundleImpl b, final boolean flag) {
00219 b.startOnLaunch(flag);
00220 }
00221
00222
00223 void callSetPersistent(final BundleImpl b, final boolean flag) {
00224 b.setPersistent(flag);
00225 }
00226
00227
00228 ClassLoader callGetClassLoader0(final BundleImpl b) {
00229 return b.getClassLoader0();
00230 }
00231
00232
00233 HeaderDictionary callGetHeaders0(final BundleImpl b, final String locale) {
00234 return b.getHeaders0(locale);
00235 }
00236
00237
00238 Enumeration callFindEntries0(final BundleImpl b, final String path,
00239 final String filePattern, final boolean recurse) {
00240 return b.findEntries0(path, filePattern, recurse);
00241 }
00242
00243
00244
00245
00246
00247 BundleImpl callInstall0(final Bundles bs, final String location, final InputStream in)
00248 throws BundleException {
00249 return bs.install0(location, in, null);
00250 }
00251
00252
00253
00254
00255
00256 void callBundleChanged(final BundleListener bl, final BundleEvent evt) {
00257 bl.bundleChanged(evt);
00258 }
00259
00260 void callFrameworkEvent(final FrameworkListener fl, final FrameworkEvent evt) {
00261 fl.frameworkEvent(evt);
00262 }
00263
00264 void callServiceChanged(final ServiceListener sl, final ServiceEvent evt) {
00265 sl.serviceChanged(evt);
00266 }
00267
00268
00269
00270
00271
00272 void callMainRestart() {
00273 Main.restart();
00274 }
00275
00276 void callMainShutdown(final int exitcode) {
00277 Main.shutdown(exitcode);
00278 }
00279
00280
00281
00282
00283
00284 void callRefreshPackages0(final PackageAdminImpl pa, final Bundle [] bundles) {
00285 pa.refreshPackages0(bundles);
00286 }
00287
00288
00289
00290
00291
00292 Object callGetService(final ServiceFactory sf,
00293 final Bundle b,
00294 final ServiceRegistration sr) {
00295 return sf.getService(b, sr);
00296 }
00297
00298
00299
00300
00301
00302 void callUnregister0(final ServiceRegistrationImpl sr) {
00303 sr.unregister0();
00304 }
00305
00306
00307
00308
00309
00310 ProtectionDomain getProtectionDomain(BundleImpl b) {
00311 return null;
00312 }
00313
00314
00315
00316
00317
00321 void purge(BundleImpl b, ProtectionDomain pc) {
00322 }
00323
00324 }