org.eclipse.ecf.server
Interface IServiceClient


public interface IServiceClient

Service Client

Since:
2.0

Method Summary
 void connect(java.lang.String targetLocation, IConnectContext connectContext)
          Connect to the given targetLocation
 java.lang.String getId()
          Get the client's ID in String form.
 IRemoteServiceContainer getRemoteServiceContainer()
          Get the remote service container for this service client.
 boolean isConnected()
           
 IRemoteServiceRegistration registerRemoteService(java.lang.String[] clazzes, java.lang.Object service, java.util.Dictionary remoteServiceProperties)
          Register a remote service with this service client.
 org.osgi.framework.ServiceRegistration registerServiceClient(org.osgi.framework.BundleContext context, java.util.Dictionary properties)
          Register service client.
 void stop()
          Stop this service client.
 

Method Detail

getId

java.lang.String getId()
Get the client's ID in String form.

Returns:
String unique id for this client.

connect

void connect(java.lang.String targetLocation,
             IConnectContext connectContext)
             throws ContainerConnectException
Connect to the given targetLocation

Parameters:
targetLocation -
Throws:
ContainerConnectException

isConnected

boolean isConnected()
Returns:
true if client is connected, false otherwise.

registerServiceClient

org.osgi.framework.ServiceRegistration registerServiceClient(org.osgi.framework.BundleContext context,
                                                             java.util.Dictionary properties)
Register service client. Registers this service client in the service registry with the given BundleContext.

Parameters:
context - the BundleContext to register with. Must not be null.
properties - to associate with IServiceClient registration. May be null.
Returns:
ServiceRegistration registration for the IServiceClient service. Will not be null.

registerRemoteService

IRemoteServiceRegistration registerRemoteService(java.lang.String[] clazzes,
                                                 java.lang.Object service,
                                                 java.util.Dictionary remoteServiceProperties)
Register a remote service with this service client. This allows remote services to be registered/exposed for remote usage.

Parameters:
clazzes - the interface class names of the remote services expose.
service - the actual service implementation.
remoteServiceProperties - and remote service properties to be exposed to clients of the remote service.
Returns:
IRemoteServiceRegistration the remote service registration for the registered remote service. Will not be null.

getRemoteServiceContainer

IRemoteServiceContainer getRemoteServiceContainer()
Get the remote service container for this service client.

Returns:
IRemoteServiceContainer will not be null.

stop

void stop()
Stop this service client. This will disconnect the underlying container for this client.