Hello

I was doing some experimentations with OSGi services, more precisely what happens with bad construction of services. For example i have the following bundles:

   * JLService (only contains the interface JL):
         o public interface JL {public boolean read(); }
   * JL1, implementation of JLService that returns false on read method
   * JL2, implementation of JLService that returns true on read
   * JF, a bundle that consumes the JLService and gives a shell command
     to invoke JL.read()

I am implementing the registering/discovery of services the worse possible way.
On JL1 and JL2 start():
ref = context.registerService(pt.thesis.JL.service.JL.class.getName(), new JL1(), null); /*in JL2 is JL2()*/
On JL1 and JL2 stop():
   ref.unregister();

On JF start():
       refs = context.getServiceReference(JL.class.getName());
       serv1 = (JL) context.getService(refs);
On JF stop():
      context.ungetService(refs);

i start the bundles and JF is binded to JL1. if i stop JL1 and call the command to invoke JL.read() why don't i get a runtime exception or something?

Hope i explained my problem well
Thanks in advance

João Ferreira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to