Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] bundles wiring and redeployment issues - hotswap

You can't. You have a binding on the MyBean class in the code of both B and C so you are pinned to exactly that version. 

Alex 

Sent from my iPhone 4S

On 30 Jan 2013, at 16:47, "matteo rulli" <matteo.rulli@xxxxxxxxxxx> wrote:

I'm facing the following issue under OSGi environment: let's say I have a bundle A exporting com.mybiz.example package. This package, in its 1.0.0 version, contains a bean class MyBean so that

 

    public class MyBean {

     int var;

     public MyBean() { }

     public int getVar() { return var; }

     public void setVar(int v) { var = v; }

    }

 

Bundle B exports an interface MyService which uses MyBean:

 

    public interface MyService {

     public MyBean getMyBean();

    }

 

Note: in our architecture, MyBean must be a class and not an interface.

 

Bundle C uses MyService as a declarative service in this way:

 

    private AtomicReference<MyService> _serv = new AtomicReference<MyService>();

    public void addMyService(MyService serv) {

     //this method is the one called by declarative services when Bundle B is started

     _serv.set(serv);

    }

 

    public void run() {

     ...

    

     MyBean x = _serv.getMyBean();

     //use x ...

    }

 

Now the problem arises if I need to do a hot fix on MyBean class.

Let's say I need to add a field and some methods.

Then, I've got a running OSGi environment where bundles A,B,C are deployed.

 

My requirement is that I cannot stop any bundle.

 

So, under these hypotheses, I deploy a new version of my bundle A, say A_1.1.0.jar. Now I'm not able to make bundle C to use the new version of MyBean class contained in A_1.1.0.jar.

 

How can I do it?

 

Thank you very much!

 

Best regards,

matteo

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Back to the top