Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Remote Service Publication II

Hi,

A remote service construct like the snippet [3] below leads to two
invocations. The first one is an object of class $Proxy0 and the
second one is the actual class QuoteServiceImpl. Both objects are my
service but this seems not correct. Please let me know if this is
expected behavior. During the remote conversation I get various errors
host [1] and consumer [2] that I still have to debug. They could be
related. Please see my next conversation on this matter.

Regards,

Wim

[1]
[log;+0200 2010.06.01
10:11:43:199;ERROR;org.eclipse.ecf.osgi.services.distribution;org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.distribution;code=4;message=org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl:registerRemoteServiceReferences:Remote
service is null for remote reference
RemoteServiceReference[remoteServiceID=org.eclipse.ecf.remoteservice.RemoteServiceID[containerID=r-osgi://localhost:9278;containerRelativeID=7235];ref=RemoteServiceReference{r-osgi://localhost:9278#7235-[org.eclipse.ecf.services.quotes.QuoteService]}];severity4;exception=null;children=[]]]

[2]
[log;+0200 2010.06.01
10:14:16:909;ERROR;org.eclipse.ecf.osgi.services.distribution;org.eclipse.core.runtime.Status[plugin=org.eclipse.ecf.osgi.services.distribution;code=4;message=org.eclipse.ecf.internal.osgi.services.distribution.DiscoveredServiceTrackerImpl:registerRemoteServiceReferences:Remote
service is null for remote reference
RemoteServiceReference[remoteServiceID=org.eclipse.ecf.remoteservice.RemoteServiceID[containerID=r-osgi://188.40.116.87:9278;containerRelativeID=7275];ref=RemoteServiceReference{r-osgi://188.40.116.87:9278#7275-[org.eclipse.ecf.services.quotes.QuoteService]}];severity4;exception=null;children=[]]]

[3]
	public void start(BundleContext bundleContext) throws Exception {
		Activator.context = bundleContext;

		bundleContext.addServiceListener(new ServiceListener() {

			@Override
			public void serviceChanged(ServiceEvent event) {

				if (event.getType() == ServiceEvent.REGISTERED) {
					Object obj = context.getService(event.getServiceReference());
					System.out.println("Sercice: "
							+ obj.getClass().getSimpleName());

					if (obj instanceof QuoteService) {
						QuoteService service = (QuoteService) context
								.getService(event.getServiceReference());

						System.out.print("\n\n\nA new Quote Service: ");
						System.out.println(service.getServiceDescription());
						System.out.print("\t" + service.getRandomQuote()
								+ "\n\n");
					}
				}
			}
		} , "(" +Constants.OBJECTCLASS + "=" + QuoteService.class.getName() + ")");

	}


Back to the top