Hi all,
following this discussion I've found a solution to the hot reload of an extension. But I fall down in a new problem. I've two extensions that share spring application context in a singleton and everything was working well if deployed in a single jar_with_dependencies and loaded via standard classloader during smartfox bootstrap, but with such kind of deploy was impossible the hot reload. Now with the new deploy in the javaExtension directory the singleton is initialized twice. Looks like is not recognized as the same type by the application. Which is the strategy you are using to load extension classes ? Are you using different classloaders?
Filippo
Reload java extension
coclusion
Ok so:
if I deploy in a single jar I can create a singleton with application scope
If I deploy classes in the javaExtensions directori and I remove that directory from the classpath how can I implement the singleton pattern? Is there any good practice? Should I maintain the spring context only in one extension and then use the handleRequestInternalMethod to use spring managed beans?
Thanks in advance
Filippo
if I deploy in a single jar I can create a singleton with application scope
If I deploy classes in the javaExtensions directori and I remove that directory from the classpath how can I implement the singleton pattern? Is there any good practice? Should I maintain the spring context only in one extension and then use the handleRequestInternalMethod to use spring managed beans?
Thanks in advance
Filippo
Unfortunately have little to no experience with Spring so I don't think I can be of much help in this area.
About the singleton thing, if that is the problem, why would you need one?
The extension is one java class (at least its entry point). Can't you pass a reference of it to the other objects used by the server side logic?
This way you don't use static data and when you issue an extension reload you shouldn't have problems.
About the singleton thing, if that is the problem, why would you need one?
The extension is one java class (at least its entry point). Can't you pass a reference of it to the other objects used by the server side logic?
This way you don't use static data and when you issue an extension reload you shouldn't have problems.