Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Using a container multiple times

Dear All

On the server side, I have create a container and registered a shared
object on it.

I would like to publish a remote service over it as well. I tried:

final IContainer container =
final ISharedObjectContainer sharedObjectContainer =
ISharedObjectManager manager1 = sharedObjectContainer.getSharedObjectManager();
Properties props = new Properties();
props.put(EventConstants.EVENT_TOPIC, "uk_co_xlegal_xbundle3_remote");
(ISharedObject) admin, props);

//now share the StateProvider service

IRemoteServiceContainerAdapter rsc = (IRemoteServiceContainerAdapter)
((IAdaptable) container).getAdapter(IRemoteServiceContainerAdapter.class);
StateProvider provider = (StateProvider) localStateServiceTracker.getService();

rsc.registerRemoteService(new String[]{StateProvider.class.getName()},
provider, null);


I am not seeing the service on the client side. I have connected, and
am successfully synchronizing the EventAdmin.
But if I register a tracker for the remote service, the remote service
is never found.

remoteStateProviderTracker = new ServiceTracker(context,
StateProvider.class.getName(), new ServiceTrackerCustomizer() {

			public Object addingService(ServiceReference reference) {
//never reaching here

				StateProvider provider = (StateProvider) context.getService(reference);
				Map<String, Object> state = provider.provideState();
				List<String> openBundleURIs = (List<String>) state.get("openBundleURIs");
				for (String uri : openBundleURIs)
				return provider;


			public void modifiedService(ServiceReference reference,
					Object service) {
				// TODO Auto-generated method stub

			public void removedService(ServiceReference reference,
					Object service) {
Is it possible to use a server container in this way?

Robert Onslow
XLegal Limited

Back to the top