Java – OSGi vs JBoss hot deployment

According to my understanding, in OSGi, you can update jars at runtime without restarting the server However, JBoss also has hot plug, full ear updates, and the server is still running

So what are the benefits of OSGi in JBoss's enterprise java project?

Solution

I believe the answer is the same for every OSGi use case: modularity and finer update granularity

OSGi doesn't just update jars at runtime, it doesn't restart the server From the perspective of your problem, it updates the jar at run time without restarting the application

I admit that I don't know the specific implementation of ear hot deployment in JBoss as, but in any case, ear update can't be designed to keep the whole state of the application The server is still running, but you basically restart the application when updating The extent of this state loss really depends on how you design your application, but the fact remains that you are simply doing things

With OSGi, this is not the case: an application consists of a large number of software packages, each of which wants to be able to handle a separate functional part This approach enables hot deployment within applications, because the framework is designed to consider the impact of restarting any single jar on the entire application and make other jars respond appropriately This provides the ability to retain as much application state as possible

Therefore, the benefit of OSGi design in the enterprise case is application activity There is no need to emphasize the importance of this point There are really some use cases that can safely restart the application However, in my opinion, OSGi is the only truly extensible and maintainable option for Java EE In fact, the most important application servers have been (or will be) to the OSGi runtime (and therefore provide OSGi application support), which proves this

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>