---
title: "osgi 中require-bundle import-package 的差别"
author: "floydd"
date: "2008-05-07T16:19:00Z"
tags: []
slug: "osgi-require-bundle-import-package"
draft: false
lastmod: "2011-12-26T12:03:06Z"
id: 1326376
url: "https://floydd.iteye.com/blog/1326376"
---

```


To be clear, require-bundle and import-package are not equivalent, but 
they certainly overlap. A simple way of looking at require-bundle is 
that it is a shorthand way of importing every package that is exported 
by another bundle, but it a slightly different than this in reality.

Import-package terminates when a class from the package is not found 
(i.e., packages are assumed to be self-contained), while require-bundle 
does NOT terminate when a class from a package is not found, it 
continues searching other required bundles as well as the local bundle 
itself (i.e., packages are assumed to be split).
```