Introduce per-customer personalization in java application
<p>I've searched on internet and here on SO, but couldn't wrap my mind around the various options.</p>

<p>What I need is a way to be able to introduce customer specific customization in any point of my app, in an "external" way, external as in "add drop-in jar and get the customized behavior".</p>

<p>I know that I should implement some sort of plugin system, but I really don't know where to start.</p>

<p>I've read some comment about spring, osgi, etc, can't figure out what is the best approach.</p>

<p>Currently, I have a really simple structure like this:</p>

<pre><code>com.mycompany.module.client.jar // client side applet

com.mycompany.module.server.jar // server side services
</code></pre>

<p>I need a way of doing something like:</p>

<p>1) extend com.mycompany.module.client.MyClass as com.mycompany.module.client.MyCustomerClass</p>

<p>2) jar it separately from the "standard" jars: com.mycompany.customer.client.jar</p>

<p>3) drop in the jar</p>

<p>4) start the application, and have MyCustomerClass used everywhere the original MyClass was used.</p>

<p>Also, since the existing application is pretty big and based on a custom third-party framework, I can't introduce devastating changes.</p>

<p>Which is the best way of doing this? </p>

<p>Also, I need the solution to be doable with java 1.5, since the above mentioned third-party framework requires it.</p>
