|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object livespace.osgi.NewServiceBinding
public class NewServiceBinding
Creates a binding to another service or services. When the required services start and stop, the binding will call nominated methods on the client. The methods are called with two parameters, eg:
public void register (BundleContext context, ISomeService service)If the System property "use.experimental.service_binding" is true, it is possible to listen for multiple instances of a single service interface; clients will be notified about the starting and stopping of each of them. Otherwise clients will only be notified about one instance of a service interface, the first one to become available. It's default value is now true but it can be turned off by running the Livespace client with the command line switch for Java:
-Duse.experimental.service_binding=false
Constructor Summary | |
---|---|
NewServiceBinding(org.osgi.framework.BundleContext context,
Class<?> serviceType,
Object activator,
String bindMethodName,
String unbindMethodName)
Create a new instance. |
|
NewServiceBinding(org.osgi.framework.BundleContext context,
String filter,
Object activator,
String bindMethodName,
String unbindMethodName)
Create a new instance. |
Method Summary | |
---|---|
void |
dispose()
|
static String |
ldapFilterFor(Class<?> serviceType)
Create an LDAP filter for selecting a service with a given service class type. |
static String |
ldapFilterFor(Class<?> serviceType,
String filter)
Create an LDAP filter for selecting a service with a given service class type plus an addition filter. |
static String |
ldapFilterFor(String serviceType)
Create an LDAP filter for selecting a service with a given service class type. |
static String |
ldapFilterFor(String serviceType,
String filter)
Create an LDAP filter for selecting a service with a given service class type plus an addition filter. |
void |
serviceChanged(org.osgi.framework.ServiceEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NewServiceBinding(org.osgi.framework.BundleContext context, Class<?> serviceType, Object activator, String bindMethodName, String unbindMethodName)
context
- The bundle context.serviceType
- The class name of the required service (usually an
interface).activator
- The activator instance to call back.bindMethodName
- The method to call on the activator when the required
service becomes available.unbindMethodName
- The method to call on the activator when the
required service becomes unavailable.NewServiceBinding(BundleContext, Class, Object, String, String)
public NewServiceBinding(org.osgi.framework.BundleContext context, String filter, Object activator, String bindMethodName, String unbindMethodName) throws org.osgi.framework.InvalidSyntaxException
context
- The bundle context.filter
- The LDAP filter expression to use to select services. May be
null for select all. See the ldapFilterFor () methods for ways
to easily create common filters.activator
- The activator instance to call back.bindMethodName
- The method to call on the activator when the required
service becomes available.unbindMethodName
- The method to call on the activator when the
required service becomes unavailable.
org.osgi.framework.InvalidSyntaxException
NewServiceBinding(BundleContext, String, Object, String, String)
Method Detail |
---|
public static String ldapFilterFor(Class<?> serviceType)
serviceType
- The class (usually a service interface) to generate the
filter for.
public static String ldapFilterFor(String serviceType)
serviceType
- The class name (usually a service interface) to generate
the filter for.
public static String ldapFilterFor(Class<?> serviceType, String filter)
serviceType
- The class (usually a service interface) to generate the
filter for.filter
- A filter to subselect from the services selected by
serviceType. e.g. "panelId=livespace.ui.some_dashboard_id".
public static String ldapFilterFor(String serviceType, String filter)
serviceType
- The class name (usually a service interface) to generate
the filter for.filter
- A filter to subselect from the services selected by
serviceType. e.g. "panelId=livespace.ui.some_dashboard_id".
public void dispose()
public void serviceChanged(org.osgi.framework.ServiceEvent e)
serviceChanged
in interface org.osgi.framework.ServiceListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |