|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object livespace.osgi.ServiceBinding
public class ServiceBinding
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 multiple implementations of an interface are registered, the binding will be informed of all of them and will be called back when each of them goes online and offline.
Constructor Summary | |
---|---|
ServiceBinding(org.osgi.framework.BundleContext context,
Class<?> serviceType,
Object activator,
String bindMethodName,
String unbindMethodName)
Create a new instance. |
|
ServiceBinding(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 ServiceBinding(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.ServiceBinding(BundleContext, Class, Object, String, String)
public ServiceBinding(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
ServiceBinding(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 |