I am building a telephony routing application which includes a digit translation and routing engine. The engine uses a number of rules provisioned in a database to make decisions on how to route (or reject) calls and how calling attributes such as calling-party number, called-party number calling-line-id should be altered before being routed to the next hop. Some decisions are too complex to describe in the database-provisioned rules and/or rely on information outside of the application. To support this, there is a rule type which allows a plug-in to be called to assist in the decision-making and attribute manipulation. The routing application needs to be highly available, so I decided to dynamically load the plug-ins rather than bundle them with the application so that they could be loaded (and unloaded) without the need to stop and start the application.
The class below is responsible for loading the plug-in JARs s from a directory, and making them available to the routing engine when needed. It loads the plug-ins when instantiated, and attempts to reload the set of plug-in when requested.
What I am finding is, that when I try to reload the plug-ins, that the old classes stay loaded and do not get updated. I assumed that if I removed the entries from the registry map, and made sure that there were no references to any plug-in class objects, that the class loader instances would have no more references, and the class loaders would go-away, and that I would be able to load the new versions of the plug-ins.
Working with class loaders is new for me, so any hints or words of wisdom will be appreciated.
The class below is responsible for loading the plug-in JARs s from a directory, and making them available to the routing engine when needed. It loads the plug-ins when instantiated, and attempts to reload the set of plug-in when requested.
What I am finding is, that when I try to reload the plug-ins, that the old classes stay loaded and do not get updated. I assumed that if I removed the entries from the registry map, and made sure that there were no references to any plug-in class objects, that the class loader instances would have no more references, and the class loaders would go-away, and that I would be able to load the new versions of the plug-ins.
Working with class loaders is new for me, so any hints or words of wisdom will be appreciated.