How is activation happening in the Java SPI modules?

56 Views Asked by At

I am working on a task that migrates the OSGI modules to Java SPI modules. Let's say I have three OSGI(A, B, C) modules. So each module has a class for activation and activation happening when starting the servers(at the beginning). Service registration and some other required method executions happening on the activation(@acctivate) class. Service, Service implementation, and Service registration are included in the same module.

but when migrating I have some questions,

1)Each OSGI module has a different class path. Therefore I can have different versions of dependency jars for the different modules ( A - aaa.jar(version-1.0), B - aaa.jar(version-2.0). But all the SPI modules will load in the same class path. So is it possible to have different versions of dependency jars for the different modules?

2)In Java SPI we don't have an activation class. Service loader is to load service implementations. is this lazy loading the solution for java SPI?

3)As I mentioned earlier. Some other method executions are happening in the OSGi activation class. So it will execute those methods when bundle activation happens(Starting the server ).what can be the solution in SPI modules(there is no activation class)?

0

There are 0 best solutions below