What does org.osgi.framework.storage.clean = onFirstInit mean in the context of the Apache Felix OSGi implementation?

I am trying to understand what org.osgi.framework.storage.clean=onFirstInit in the context of the Felix framework.

According to OSGi specification:

org.osgi.framework.storage: A valid path to a file in the file system is directory ... The structure is free to use this directory because it sees, for example, completely erase all files and directories in it ...

org.osgi.framework.storage.clean: Indicates if and when the storage area for the frames should be cleared. If no value is specified, the frame storage area will not be cleared.

Since, according to the specification, the structure is free to use this directory at its discretion, it is not clear what is implied when the OSGi specification states that the storage area should be cleaned. Cleaning may mean something different for every OSGi implementation.

The Apache Felix documentation says:

onFirstInit flushes the packet cache when the frame instance is first initialized.

Specifically for the Felix documentation:

  • What does it mean to clear the packet cache? Does it clear the same thing that removes the repository directory and then restores it from scratch? So it will be the same as rm -rf felix-cache , while the Felix container is disconnected, so when it starts, it restores the cache, as if it were the first start of the container?
  • What does this mean when it says "when the first instance of the structure is initialized"? Does this mean that when you first initialize the framework only when you first start the container? Or does this mean that the first time the environment is initialized every time the container is reloaded?
+6
source share
1 answer

What does it mean to clear the bundle cache?

This means removing the directory specified by org.osgi.framework.storage

Does it reset the same as deleting the repository directory, and then rebuild it from scratch?

Yes

So, it will be the same as rm -rf felix-cache when the Felix container is closed, so when it starts, it restores the cache, as if it were the first start of the container?

Yes

What does this mean when it says "when the first instance of the structure is initialized"?

Ligaments can be initialized several times. This statement indicates that the directory should only be deleted after the first start of the JVM, after which the system package is initialized.

Does this mean that when you first initialize the framework only when you first start the container? Or does this mean that the first time the frame is initialized, every time the container is reloaded?

This means that the first time the environment is initialized each time the container is restarted

+2
source

Source: https://habr.com/ru/post/976579/


All Articles