(e.g. On 3/21/2011 3:20 AM, ronen hamias wrote:
Hi,
I am trying to consume a remote service. Note that my environment is entirely server side.
I have implemented a simple hello world service running on tomcat using the bridge.war
My service is registered like this:
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
Properties props = new Properties();
props.put("service.exported.interfaces", "*");
props.put("service.exported.configs", "ecf.r_osgi.peer");
ServiceRegistration reg =
context.registerService(IHelloWorld.class.getName(),new HelloServiceImpl(), props);
System.out.println("IHello RemoteService registered");
}
I wish to consume this service again from server side environment:
My service client looks like this:
public void start(BundleContext context) throws Exception
{
_context = context;
// Create R-OSGi Container
IContainerManager containerManager = getContainerManagerService();
_container = containerManager.getContainerFactory().createContainer("ecf.r_osgi.peer");
// Get remote service container adapter
IRemoteServiceContainerAdapter containerAdapter = (IRemoteServiceContainerAdapter) _container
.getAdapter(IRemoteServiceContainerAdapter.class); // after this line of code containerAdapter is null