Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the deal with private packages?

Tags:

java

module

osgi

I have been working with OSGi for a while now, but I still don't understand something about private packages.

  • An exported package is a package with is visible to other bundles
  • An imported package is a package which is imported by a bundle exporting the package.
  • A private package is a package which is not visible to other bundles (I don't get this)

Aren't all bundle packages which are not exported invisible to all other packages? If so, what's the difference to private packages and packages which are not exported?

I've read OSGi in Action and "OSGi and Apache Felix 3.0 - Beginners Guide", but i was not able to find the difference.

like image 450
Mirco Avatar asked Dec 14 '12 12:12

Mirco


People also ask

What is private package?

1): Packages that are not exported or imported are called private packages.

How do private NPM packages work?

With npm private packages, you can use the npm registry to host code that is only visible to you and chosen collaborators, allowing you to manage and use private code alongside public code in your projects. Private packages always have a scope, and scoped packages are private by default.

What is private package json?

private. If you set "private": true in your package. json, then npm will refuse to publish it. This is a way to prevent accidental publication of private repositories. Follow this answer to receive notifications.

What command must you run before installing a private package?

If you need to control access to the package, you should click the + button under collaborators. And then add the appropriate username, and then click submit. If you want to install a private package, you need to have access to the package. Then you can make use of install with the scoped package name.


1 Answers

There is no difference.

Any package which is not listed in Export-Package is private.... that's all there is to it.

You may have seen another header called Private-Package. This is NOT an OSGi header and it is completely ignored by the OSGi Framework. If you see this it indicates that a bundle has been built with bnd or the Maven Bundle Plugin, which uses this header has a build-time instruction. It's therefore only relevant at build time, and has no effect whatsoever at run time.

like image 137
Neil Bartlett Avatar answered Sep 23 '22 09:09

Neil Bartlett