org.knopflerfish.framework.Services Class Reference

List of all members.


Detailed Description

Here we handle all the services that are registered in framework.

Author:
Jan Stein

Philippe Laporte

Definition at line 55 of file Services.java.


Package Functions

ServiceRegistration register (BundleImpl bundle, String[] classes, Object service, Dictionary properties)
 Register a service in the framework wide register.
synchronized ServiceReference get (BundleImpl bundle, String clazz)
 Get a service implementing a certain class.
synchronized ServiceReference[] get (String clazz, String filter, BundleImpl bundle, boolean doAssignableToTest) throws InvalidSyntaxException
 Get all services implementing a certain class and then filter these with a property filter.
synchronized void removeServiceRegistration (ServiceRegistrationImpl sr)
 Remove a registered service.
synchronized Set getRegisteredByBundle (Bundle b)
 Get all services that a bundle has registered.
synchronized Set getUsedByBundle (Bundle b)
 Get all services that a bundle uses.

Member Function Documentation

ServiceRegistration org.knopflerfish.framework.Services.register ( BundleImpl  bundle,
String[]  classes,
Object  service,
Dictionary  properties 
) [package]

Register a service in the framework wide register.

Parameters:
bundle The bundle registering the service.
classes The class names under which the service can be located.
service The service object.
properties The properties for this service.
Returns:
A ServiceRegistration object.
Exceptions:
java.lang.IllegalArgumentException If one of the following is true:
  • The service object is null.
  • The defining class of the service paramater is not owned by the bundle.
  • The service parameter is not a ServiceFactory and is not an instance of all the named classes in the classes parameter.

Definition at line 94 of file Services.java.

References org.knopflerfish.framework.PermissionOps.checkRegisterServicePerm(), and org.osgi.framework.ServiceRegistration.getReference().

Referenced by org.knopflerfish.framework.Framework.Framework(), and org.knopflerfish.framework.BundleContextImpl.registerService().

synchronized ServiceReference org.knopflerfish.framework.Services.get ( BundleImpl  bundle,
String  clazz 
) [package]

Get a service implementing a certain class.

Parameters:
bundle bundle requesting reference
clazz The class name of requested service.
Returns:
A ServiceReference object.

Definition at line 177 of file Services.java.

References org.osgi.framework.ServiceReference.isAssignableTo().

Referenced by org.knopflerfish.framework.BundleContextImpl.getAllServiceReferences(), org.knopflerfish.framework.BundleContextImpl.getServiceReference(), and org.knopflerfish.framework.BundleContextImpl.getServiceReferences().

synchronized ServiceReference [] org.knopflerfish.framework.Services.get ( String  clazz,
String  filter,
BundleImpl  bundle,
boolean  doAssignableToTest 
) throws InvalidSyntaxException [package]

Get all services implementing a certain class and then filter these with a property filter.

Parameters:
clazz The class name of requested service.
filter The property filter.
bundle bundle requesting reference. can be null if doAssignableToTest is false (this is not an interface class so don't check)
isAssignableToTest whether to if the bundle that registered the service referenced by this ServiceReference and the specified bundle are both wired to same source for the registration class.
Returns:
An array of ServiceReference object.

Definition at line 226 of file Services.java.

References org.knopflerfish.framework.ServiceRegistrationImpl.getReference(), org.osgi.framework.ServiceReference.isAssignableTo(), org.knopflerfish.framework.PermissionOps.okGetServicePerms(), and org.knopflerfish.framework.ServiceRegistrationImpl.properties.

synchronized void org.knopflerfish.framework.Services.removeServiceRegistration ( ServiceRegistrationImpl  sr  )  [package]

Remove a registered service.

Parameters:
sr The ServiceRegistration object that is registered.

Definition at line 286 of file Services.java.

References org.knopflerfish.framework.PropertiesDictionary.get(), and org.knopflerfish.framework.ServiceRegistrationImpl.properties.

synchronized Set org.knopflerfish.framework.Services.getRegisteredByBundle ( Bundle  b  )  [package]

Get all services that a bundle has registered.

Parameters:
b The bundle
Returns:
A set of ServiceRegistration objects

Definition at line 306 of file Services.java.

References org.knopflerfish.framework.ServiceRegistrationImpl.bundle.

Referenced by org.knopflerfish.framework.BundleImpl.getRegisteredServices().

synchronized Set org.knopflerfish.framework.Services.getUsedByBundle ( Bundle  b  )  [package]

Get all services that a bundle uses.

Parameters:
b The bundle
Returns:
A set of ServiceRegistration objects

Definition at line 324 of file Services.java.

References org.knopflerfish.framework.ServiceRegistrationImpl.isUsedByBundle().

Referenced by org.knopflerfish.framework.BundleImpl.getServicesInUse().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:19 2010 for OpenMobileIS by  doxygen 1.5.4