 | 2 | Security Layer | | | | | | |
| |
 | 2.1 | Introduction | | | | | | |
| |
|
 | 2.2 | Security Overview | | | | | | |
| |
| 2.2.1 | Code Authentication | | | | | | |
| 2.2.2 | Optional Security | | | | | | |
|
 | 2.3 | Digitally Signed JAR Files | | | | | | |
| |
| 2.3.1 | JAR Structure and Manifest | | | | | | |
| 2.3.2 | Java JAR File Restrictions | | | | | | |
| 2.3.3 | Valid Signature | | | | | | |
| 2.3.4 | Signing Algorithms | | | | | | |
| 2.3.5 | Certificates | | | | | | |
| 2.3.6 | Distinguished Names | | | | | | |
| 2.3.7 | Certificate Matching | | | | | | |
|
 | 2.4 | Permissions | | | | | | |
| |
| 2.4.1 | Implied Permissions | | | | | | |
| 2.4.2 | Filter Based Permissions | | | | | | |
|
| 2.5 | Changes | | | | | | |
| 2.6 | References | | | | | | |
|
 | 3 | Module Layer | | | | | | |
| |
| 3.1 | Introduction | | | | | | |
 | 3.2 | Bundles | | | | | | |
| |
| 3.2.1 | Bundle Manifest Headers | | | | | | |
| 3.2.2 | Custom Headers | | | | | | |
| 3.2.3 | Header Value Syntax | | | | | | |
| 3.2.4 | Common Header Syntax | | | | | | |
| 3.2.5 | Version | | | | | | |
| 3.2.6 | Version Ranges |    |    |    |    |    |    |
| 3.2.7 | Filter Syntax |       |       |       |       |       |       |
|
 | 3.3 | Execution Environment | | | | | | |
| |
| 3.3.1 | Naming of Execution Environments | | | | | | |
|
 | 3.4 | Class Loading Architecture |  |  |  |  |  |  |
| |
|
 | 3.5 | Resolving Metadata | | | | | | |
| |
| 3.5.1 | Bundle-ManifestVersion | | | | | | |
| 3.5.2 | Bundle-SymbolicName | | | | | | |
| 3.5.3 | Bundle-Version | | | | | | |
| 3.5.4 | Import-Package Header | | | | | | |
| 3.5.5 | Export-Package |    |    |    |    |    |    |
| 3.5.6 | Exporting and Importing a Package | | | | | | |
| 3.5.7 | Interpretation of Legacy Bundles | | | | | | |
|
 | 3.6 | Constraint Solving | | | | | | |
| |
| 3.6.1 | Diagrams and Syntax | | | | | | |
| 3.6.2 | Version Matching |    |    |    |    |    |    |
| 3.6.3 | Optional Packages |  |  |  |  |  |  |
| 3.6.4 | Package Constraints |        |        |        |        |        |        |
| 3.6.5 | Attribute Matching |  |  |  |  |  |  |
| 3.6.6 | Mandatory Attributes |  |  |  |  |  |  |
| 3.6.7 | Class Filtering | | | | | | |
| 3.6.8 | Provider Selection | | | | | | |
|
| 3.7 | Resolving Process |  |  |  |  |  |  |
 | 3.8 | Runtime Class Loading | | | | | | |
| |
| 3.8.1 | Bundle Class Path | | | | | | |
| 3.8.2 | Dynamic Import Package | | | | | | |
| 3.8.3 | Parent Delegation | | | | | | |
| 3.8.4 | Overall Search Order |  |  |  |  |  |  |
| 3.8.5 | Parent Class Loader | | | | | | |
| 3.8.6 | Resource Loading | | | | | | |
| 3.8.7 | Bundle Cycles | | | | | | |
| 3.8.8 | Code Executed Before Started | | | | | | |
| 3.8.9 | Finding an Object’s Bundle | | | | | | |
|
 | 3.9 | Loading Native Code Libraries | | | | | | |
| |
| 3.9.1 | Native Code Algorithm | | | | | | |
| 3.9.2 | Considerations Using Native Libraries | | | | | | |
|
 | 3.10 | Localization | | | | | | |
| |
| 3.10.1 | Finding Localization Entries | | | | | | |
| 3.10.2 | Manifest Localization | | | | | | |
|
| 3.11 | Bundle Validity | | | | | | |
 | 3.12 | Requiring Bundles | | | | | | |
| |
| 3.12.1 | Require-Bundle | | | | | | |
| 3.12.2 | Split Package Compatibility | | | | | | |
| 3.12.3 | Issues With Requiring Bundles | | | | | | |
|
 | 3.13 | Fragment Bundles | | | | | | |
| |
| 3.13.1 | Fragment-Host | | | | | | |
| 3.13.2 | Fragments During Runtime |     |     |     |     |     |     |
| 3.13.3 | Illegal Manifest Header for Fragment Bundles | | | | | | |
|
 | 3.14 | Extension Bundles | | | | | | |
| |
| 3.14.1 | Illegal Manifest Headers for Extension Bundles | | | | | | |
| 3.14.2 | Class Path Treatment | | | | | | |
| 3.14.3 | Optionality Boot Class Path Extension | | | | | | |
|
 | 3.15 | Security | | | | | | |
| |
| 3.15.1 | Extension Bundles | | | | | | |
| 3.15.2 | Bundle Permission | | | | | | |
| 3.15.3 | Package Permission | | | | | | |
| 3.15.4 | Resource Permissions | | | | | | |
| 3.15.5 | Permission Checks | | | | | | |
|
| 3.16 | Changes | | | | | | |
| 3.17 | References | | | | | | |
|
 | 4 | Life Cycle Layer | | | | | | |
| |
 | 4.1 | Introduction | | | | | | |
| |
| 4.1.1 | Essentials | | | | | | |
| 4.1.2 | Entities | | | | | | |
|
 | 4.2 | Frameworks | | | | | | |
| |
| 4.2.1 | Launching and Controlling a Framework | | | | | | |
| 4.2.2 | Launching Properties | | | | | | |
| 4.2.3 | Life Cycle of a Framework | | | | | | |
| 4.2.4 | Initializing the Framework | | | | | | |
| 4.2.5 | Starting the Framework | | | | | | |
| 4.2.6 | Stopping a Framework | | | | | | |
| 4.2.7 | Embedding a Framework | | | | | | |
| 4.2.8 | Daemon Threads | | | | | | |
| 4.2.9 | Java Service Provider Configuration Support | | | | | | |
|
| 4.3 | Bundles | | | | | | |
 | 4.4 | The Bundle Object | | | | | | |
| |
| 4.4.1 | Bundle Identifiers | | | | | | |
| 4.4.2 | Bundle State | | | | | | |
| 4.4.3 | Installing Bundles | | | | | | |
| 4.4.4 | Resolving Bundles | | | | | | |
| 4.4.5 | Starting Bundles | | | | | | |
| 4.4.6 | Activation | | | | | | |
| 4.4.7 | Stopping Bundles | | | | | | |
| 4.4.8 | Deactivation | | | | | | |
| 4.4.9 | Updating Bundles | | | | | | |
| 4.4.10 | Uninstalling Bundles |         |         |         |         |         |         |
| 4.4.11 | Detecting Bundle Changes | | | | | | |
| 4.4.12 | Retrieving Manifest Headers | | | | | | |
| 4.4.13 | Loading Classes | | | | | | |
| 4.4.14 | Access to Resources |  |  |  |  |  |  |
| 4.4.15 | Permissions of a Bundle | | | | | | |
| 4.4.16 | Access to a Bundle’s Bundle Context | | | | | | |
|
 | 4.5 | The Bundle Context | | | | | | |
| |
| 4.5.1 | Getting Bundle Information | | | | | | |
| 4.5.2 | Persistent Storage | | | | | | |
| 4.5.3 | Environment Properties | | | | | | |
|
 | 4.6 | The System Bundle | | | | | | |
| |
| 4.6.1 | System Bundle Headers | | | | | | |
|
 | 4.7 | Events | | | | | | |
| |
| 4.7.1 | Listeners | | | | | | |
| 4.7.2 | Delivering Events | | | | | | |
| 4.7.3 | Synchronization Pitfalls | | | | | | |
|
 | 4.8 | Security | | | | | | |
| |
| 4.8.1 | Admin Permission | | | | | | |
| 4.8.2 | Privileged Callbacks | | | | | | |
| 4.8.3 | Lazy Activation | | | | | | |
|
| 4.9 | Changes | | | | | | |
| 4.10 | References | | | | | | |
|
 | 5 | Service Layer | | | | | | |
| |
 | 5.1 | Introduction | | | | | | |
| |
| 5.1.1 | Essentials | | | | | | |
| 5.1.2 | Entities | | | | | | |
|
 | 5.2 | Services | | | | | | |
| |
| 5.2.1 | Service References | | | | | | |
| 5.2.2 | Service Interfaces | | | | | | |
| 5.2.3 | Registering Services | | | | | | |
| 5.2.4 | Early Need for ServiceRegistration Object | | | | | | |
| 5.2.5 | Service Properties | | | | | | |
| 5.2.6 | Persistent Identifier (PID) | | | | | | |
| 5.2.7 | Locating Services | | | | | | |
| 5.2.8 | Getting Service Properties | | | | | | |
| 5.2.9 | Getting Service Objects | | | | | | |
| 5.2.10 | Information About Services | | | | | | |
| 5.2.11 | Service Exceptions | | | | | | |
| 5.2.12 | Services and Concurrency | | | | | | |
|
 | 5.3 | Service Events | | | | | | |
| |
|
| 5.4 | Stale References | | | | | | |
| 5.5 | Filters |           |           |           |           |           |           |
| 5.6 | Service Factory | | | | | | |
| 5.7 | Releasing Services | | | | | | |
| 5.8 | Unregistering Services | | | | | | |
 | 5.9 | Multiple Version Export Considerations | | | | | | |
| |
| 5.9.1 | Service Registry |      |      |      |      |      |      |
| 5.9.2 | Service Events | | | | | | |
|
 | 5.10 | Security | | | | | | |
| |
|
| 5.11 | Changes | | | | | | |
|
 | 6 | Framework API | | | | | | |
| |
 | 6.1 | org.osgi.framework | | | | | | |
| |
| 6.1.1 | Summary | | | | | | |
| 6.1.2 | public final class AdminPermission extends BasicPermission | | | | | | |
| 6.1.3 | public interface AllServiceListener extends ServiceListener | | | | | | |
| 6.1.4 | public interface Bundle |      |      |      |      |      |      |
| 6.1.5 | public interface BundleActivator | | | | | | |
| 6.1.6 | public interface BundleContext |           |           |           |           |           |           |
| 6.1.7 | public class BundleEvent extends EventObject | | | | | | |
| 6.1.8 | public class BundleException extends Exception | | | | | | |
| 6.1.9 | public interface BundleListener extends EventListener | | | | | | |
| 6.1.10 | public final class BundlePermission extends BasicPermission | | | | | | |
| 6.1.11 | public interface BundleReference | | | | | | |
| 6.1.12 | public interface Configurable | | | | | | |
| 6.1.13 | public interface Constants | | | | | | |
| 6.1.14 | public interface Filter |           |           |           |           |           |           |
| 6.1.15 | public class FrameworkEvent extends EventObject | | | | | | |
| 6.1.16 | public interface FrameworkListener extends EventListener | | | | | | |
| 6.1.17 | public class FrameworkUtil | | | | | | |
| 6.1.18 | public class InvalidSyntaxException extends Exception | | | | | | |
| 6.1.19 | public final class PackagePermission extends BasicPermission | | | | | | |
| 6.1.20 | public class ServiceEvent extends EventObject | | | | | | |
| 6.1.21 | public class ServiceException extends RuntimeException | | | | | | |
| 6.1.22 | public interface ServiceFactory | | | | | | |
| 6.1.23 | public interface ServiceListener extends EventListener | | | | | | |
| 6.1.24 | public final class ServicePermission extends BasicPermission | | | | | | |
| 6.1.25 | public interface ServiceReference extends Comparable | | | | | | |
| 6.1.26 | public interface ServiceRegistration | | | | | | |
| 6.1.27 | public interface SynchronousBundleListener extends BundleListener | | | | | | |
| 6.1.28 | public class Version implements Comparable | | | | | | |
|
 | 6.2 | org.osgi.framework.launch | | | | | | |
| |
| 6.2.1 | Summary | | | | | | |
| 6.2.2 | public interface Framework extends Bundle | | | | | | |
| 6.2.3 | public interface FrameworkFactory | | | | | | |
|
|
 | 7 | Package Admin Service Specification | | | | | | |
| |
 | 7.1 | Introduction | | | | | | |
| |
| 7.1.1 | Essentials | | | | | | |
| 7.1.2 | Entities | | | | | | |
| 7.1.3 | Operation |  |  |  |  |  |  |
|
 | 7.2 | Package Admin | | | | | | |
| |
| 7.2.1 | Package Sharing | | | | | | |
| 7.2.2 | Bundle Information | | | | | | |
| 7.2.3 | Fragments and Required Bundles | | | | | | |
| 7.2.4 | Exported Package | | | | | | |
| 7.2.5 | Refreshing Packages | | | | | | |
|
| 7.3 | Security | | | | | | |
| 7.4 | Changes | | | | | | |
 | 7.5 | org.osgi.service.packageadmin | | | | | | |
| |
| 7.5.1 | Summary | | | | | | |
| 7.5.2 | public interface ExportedPackage | | | | | | |
| 7.5.3 | public interface PackageAdmin | | | | | | |
| 7.5.4 | public interface RequiredBundle | | | | | | |
|
|
 | 8 | Start Level Service Specification | | | | | | |
| |
 | 8.1 | Introduction | | | | | | |
| |
| 8.1.1 | Essentials | | | | | | |
| 8.1.2 | Entities | | | | | | |
|
 | 8.2 | Start Level Service | | | | | | |
| |
| 8.2.1 | The Concept of a Start Level | | | | | | |
| 8.2.2 | Changing the Active Start Level | | | | | | |
| 8.2.3 | Startup Sequence | | | | | | |
| 8.2.4 | Shutdown Sequence | | | | | | |
| 8.2.5 | Changing a Bundle’s Start Level | | | | | | |
| 8.2.6 | Starting a Bundle | | | | | | |
| 8.2.7 | Exceptions in the Bundle Activator | | | | | | |
| 8.2.8 | System Bundle | | | | | | |
|
| 8.3 | Compatibility Mode | | | | | | |
 | 8.4 | Example Applications | | | | | | |
| |
| 8.4.1 | Safe Mode Startup Scheme | | | | | | |
| 8.4.2 | Splash Screen Startup Scheme | | | | | | |
|
| 8.5 | Security | | | | | | |
 | 8.6 | org.osgi.service.startlevel | | | | | | |
| |
| 8.6.1 | public interface StartLevel | | | | | | |
|
|
 | 9 | Conditional Permission Admin Specification | | | | | | |
| |
 | 9.1 | Introduction | | | | | | |
| |
| 9.1.1 | Essentials | | | | | | |
| 9.1.2 | Entities | | | | | | |
| 9.1.3 | Synopsis | | | | | | |
|
 | 9.2 | Permission Management Model | | | | | | |
| |
| 9.2.1 | Local Permissions | | | | | | |
| 9.2.2 | Open Deployment Channels | | | | | | |
| 9.2.3 | Delegation | | | | | | |
| 9.2.4 | Grouping | | | | | | |
| 9.2.5 | Typical Example | | | | | | |
|
| 9.3 | Effective Permissions | | | | | | |
 | 9.4 | Conditional Permissions | | | | | | |
| |
| 9.4.1 | Encoding versus Instantiation | | | | | | |
|
| 9.5 | Conditions | | | | | | |
 | 9.6 | The Permission Check | | | | | | |
| |
| 9.6.1 | Security Manager checkPermission Method | | | | | | |
| 9.6.2 | Bundle Protection Domain implies Method | | | | | | |
| 9.6.3 | Postponed Evaluation | | | | | | |
| 9.6.4 | Example | | | | | | |
| 9.6.5 | Using the Access Control Context Directly | | | | | | |
|
 | 9.7 | Permission Management | | | | | | |
| |
|
| 9.8 | Implementing Conditions | | | | | | |
 | 9.9 | Standard Conditions | | | | | | |
| |
| 9.9.1 | Bundle Signer Condition | | | | | | |
| 9.9.2 | Bundle Location Condition | | | | | | |
|
 | 9.10 | Bundle Permission Resource | | | | | | |
| |
| 9.10.1 | Removing the Bundle Permission Resource | | | | | | |
|
| 9.11 | Relation to Permission Admin | | | | | | |
 | 9.12 | Implementation Issues | | | | | | |
| |
| 9.12.1 | Optimizing Immutable Conditions | | | | | | |
| 9.12.2 | Optimizing the Permission Check | | | | | | |
| 9.12.3 | Using Permission Checks in Conditions | | | | | | |
| 9.12.4 | Concurrency | | | | | | |
| 9.12.5 | Class Loading | | | | | | |
| 9.12.6 | Condition Life Cycle | | | | | | |
|
 | 9.13 | Security | | | | | | |
| |
| 9.13.1 | Service Registry Security | | | | | | |
|
| 9.14 | Changes | | | | | | |
 | 9.15 | org.osgi.service.condpermadmin | | | | | | |
| |
| 9.15.1 | Summary | | | | | | |
| 9.15.2 | public class BundleLocationCondition | | | | | | |
| 9.15.3 | public class BundleSignerCondition | | | | | | |
| 9.15.4 | public interface Condition | | | | | | |
| 9.15.5 | public interface ConditionalPermissionAdmin | | | | | | |
| 9.15.6 | public interface ConditionalPermissionInfo | | | | | | |
| 9.15.7 | public interface ConditionalPermissionUpdate | | | | | | |
| 9.15.8 | public class ConditionInfo | | | | | | |
|
| 9.16 | References | | | | | | |
|
 | 10 | Permission Admin Service Specification | | | | | | |
| |
 | 10.1 | Introduction | | | | | | |
| |
| 10.1.1 | Essentials | | | | | | |
| 10.1.2 | Entities | | | | | | |
| 10.1.3 | Operation | | | | | | |
|
 | 10.2 | Permission Admin service | | | | | | |
| |
| 10.2.1 | File Permission for Relative Path Names | | | | | | |
|
| 10.3 | Security | | | | | | |
 | 10.4 | org.osgi.service.permissionadmin | | | | | | |
| |
| 10.4.1 | Summary | | | | | | |
| 10.4.2 | public interface PermissionAdmin | | | | | | |
| 10.4.3 | public class PermissionInfo | | | | | | |
|
|
 | 11 | URL Handlers Service Specification | | | | | | |
| |
 | 11.1 | Introduction | | | | | | |
| |
| 11.1.1 | Essentials | | | | | | |
| 11.1.2 | Entities | | | | | | |
| 11.1.3 | Operation | | | | | | |
|
| 11.2 | Factories in java.net | | | | | | |
 | 11.3 | Framework Procedures | | | | | | |
| |
| 11.3.1 | Constructing a Proxy and Handler | | | | | | |
| 11.3.2 | Built-in Handlers | | | | | | |
| 11.3.3 | Finding Built-in Handlers | | | | | | |
| 11.3.4 | Protected Methods and Proxy | | | | | | |
| 11.3.5 | Stream Handlers that use java.net.Proxy | | | | | | |
|
| 11.4 | Providing a New Scheme | | | | | | |
| 11.5 | Providing a Content Handler | | | | | | |
| 11.6 | Security Considerations | | | | | | |
| 11.7 | Changes | | | | | | |
 | 11.8 | org.osgi.service.url | | | | | | |
| |
| 11.8.1 | Summary | | | | | | |
| 11.8.2 | public abstract class AbstractURLStreamHandlerService extends URLStreamHandler implements ... | | | | | | |
| 11.8.3 | public interface URLConstants | | | | | | |
| 11.8.4 | public interface URLStreamHandlerService | | | | | | |
| 11.8.5 | public interface URLStreamHandlerSetter | | | | | | |
|
| 11.9 | References | | | | | | |
|
 | 12 | Service Hooks Specification | | | | | | |
| |
 | 12.1 | Introduction | | | | | | |
| |
| 12.1.1 | Essentials | | | | | | |
| 12.1.2 | Entities | | | | | | |
| 12.1.3 | Synopsis | | | | | | |
|
| 12.2 | Service Hooks | | | | | | |
 | 12.3 | Usage Scenarios | | | | | | |
| |
| 12.3.1 | Proxying | | | | | | |
| 12.3.2 | Providing a Service on Demand | | | | | | |
|
| 12.4 | Event Hook | | | | | | |
| 12.5 | Find Hook | | | | | | |
 | 12.6 | Listener Hook | | | | | | |
| |
|
 | 12.7 | Architectural Notes | | | | | | |
| |
| |