Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] help

Hi Wim and thanks for your response here is some more information:
State Bundle:

0 ACTIVE org.eclipse.osgi_3.3.0.200704022148

Fragments=156

127 ACTIVE org.eclipse.equinox.common_3.6.0.v20100503

128 ACTIVE org.eclipse.update.configurator_3.2.100.v20070322

129 ACTIVE org.eclipse.equinox.http.servletbridge_1.0.0.200704022148

130 ACTIVE org.eclipse.equinox.http.registry_1.0.0.200704022148

131 ACTIVE org.eclipse.core.jobs_3.5.1.R36x_v20100824

132 INSTALLED org.eclipse.core.runtime_3.6.0.v20100505

133 ACTIVE org.eclipse.ecf.discovery_4.0.0.v20110225-1732

134 RESOLVED org.eclipse.ecf.examples.remoteservices.hello.ds.host_2.0.0.v20110225-1732

135 RESOLVED org.eclipse.ecf.examples.remoteservices.hello_3.0.0.v20110225-1732

136 ACTIVE org.eclipse.ecf.identity_3.1.100.v20110225-1732

137 INSTALLED org.eclipse.ecf.osgi.services.distribution_2.0.0.v20110225-1732

138 ACTIVE org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy_1.0.0.v20110225-1732

139 <<LAZY>> org.eclipse.ecf.osgi.services.remoteserviceadmin_1.0.0.v20110225-1732

140 ACTIVE org.eclipse.ecf.provider.jmdns_4.1.0.v20110225-1732

141 ACTIVE org.eclipse.ecf.provider.remoteservice_4.0.0.v20110225-1732

142 ACTIVE org.eclipse.ecf.provider_4.1.0.v20110225-1732

143 ACTIVE org.eclipse.ecf.remoteservice_6.0.0.v20110225-1732

144 RESOLVED org.eclipse.ecf.saxparserfactory_1.0.0.201011121350

145 ACTIVE org.eclipse.ecf.sharedobject_2.2.100.v20110225-1732

146 ACTIVE org.eclipse.ecf_3.1.200.v20110225-1732

147 INSTALLED org.eclipse.equinox.common_3.3.0.200704022148

149 ACTIVE org.eclipse.equinox.concurrent_1.0.100.v20100503

150 ACTIVE org.eclipse.equinox.event_1.2.0.v20100503

153 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.200704022148

154 ACTIVE org.eclipse.equinox.registry_3.3.0.v20070318

155 INSTALLED org.eclipse.equinox.registry_3.5.0.v20100503

156 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.0.0

Master=0

157 RESOLVED org.eclipse.equinox.supplement_1.4.0.v20101022

158 RESOLVED org.eclipse.osgi.services.remoteserviceadmin_1.0.0.v20110225-1602

159 RESOLVED org.eclipse.osgi.services_3.1.100.200704022148

160 RESOLVED org.eclipse.osgi.util_3.2.100.v20100503

163 RESOLVED org.objectweb.asm_3.2.0.v200909071300

164 RESOLVED osgi.cmpn_4.2.0.200908310645

165 <<LAZY>> pt.hello.client_1.0.0.201103201749

166 ACTIVE pt.hello.service_1.0.0.201103201749

167 ACTIVE pt.hello_1.0.0.201103201749



On Mon, Mar 21, 2011 at 12:59 PM, Wim Jongman <wim.jongman@xxxxxxxxx> wrote:
Hi,

Are all the required ECF bundles running? Please examine the example plugins (and especially the launch configurations) to make find out the bundles that you need to start.

Yes, server side only is possible, there is no ui dependency.

Regards,

Wim 

On Mon, Mar 21, 2011 at 11:20 AM, ronen hamias <ronen.hamias@xxxxxxxxx> 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

 

            // Lookup IRemoteServiceReference

            IRemoteServiceReference[] helloReferences = containerAdapter.getRemoteServiceReferences(IDFactory.getDefault()

                        .createID(_container.getConnectNamespace(), GENERIC_SERVICE_HOST), IHelloWorld.class.getName(), null);

 

            // Get remote service for reference

            IRemoteService remoteService = containerAdapter.getRemoteService(helloReferences[0]);

 

            // Get the proxy

            IHelloWorld proxy = (IHelloWorld) remoteService.getProxy();

 

            // Call the proxy

            proxy.hello("RemoteService Client via Proxy");

            System.out.println((new Date()) + " RemoteService Called via Proxy");

 

            // Call Sync

            remoteService.callSync(createRemoteCall("RemoteService Client Sync"));

            System.out.println((new Date()) + " RemoteService Called Sync");

 

 

      }

 

The IRemoteServiceContainerAdapter is inherits from IAdaptable (org.eclipse.core) that is a UI dependency?

 

How would I consume a service from a server side environment?

 

Best regards

Ronen.

 

 

 

 


_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev




--
Ronen Hamias
Cell Phone: +972-50-2289988

Back to the top