You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ana Rosselló-Busquet <ar...@fotonik.dtu.dk> on 2011/06/01 11:35:44 UTC

OSGi Listener Service through webservices

Hi,

I have been working with OSGi framework using Equinox implementation in
Eclipse. I have been using two bundles, one exporting the service and
another importing the service. The service interface (IMessageSender) has
the following methods:

	public abstract void addListener(IMessageListener listener);
	public abstract void removeListener(IMessageListener listener);

The implementation of this service (MessageSender implements IMessageSender)
has the following methods:

	private List listeners = new ArrayList();

	public synchronized void addListener(IMessageListener listener) {
		listeners.add(listener);
	}

	public synchronized String send_message(String message) throws 
		for (Iterator i = listeners.iterator(); i.hasNext();)
			reply = new String(((IMessageListener) i.next()).status_update(message));
		return reply;
	}

Furthermore, the bundle exporting the service defines IMessageListener
interface which has only one method:

	public String status_update(String feedback);

The bundle importing the service contains a class implementing
IMessageListener and uses the service to add itself as a listener after
importing the service. This class (MessageListener implements
IMessageListener) contains the following methods:

	public void setService(IMessageSender value) {
		sender = value;
		sender.addListener(this);
	}


	public String status_update(String feedback){
		System.out.println(feedback);
	}

Now, I would like to implement the interaction between the bundles through
web services using  cxf-dosgi-ri-singlebundle-distribution (1.2.0). 
However, I am not sure if it is possible or not and how I should do it.
Could anyone please help me?

Regards,

Ana



--
View this message in context: http://cxf.547215.n5.nabble.com/OSGi-Listener-Service-through-webservices-tp4444683p4444683.html
Sent from the cxf-user mailing list archive at Nabble.com.