|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.ipojo.PolicyServiceContext
public class PolicyServiceContext
The policy service context is a service context aiming to solve service requirement. It's parameterized by a resolving policy. Three policies are managed : - Local : services are only solve un the local service registry - Global : services are resolved only in the global (i.e. OSGi) service registry - Local and Global : services are resolved inside the local registry and the global registry
| Field Summary | |
|---|---|
static int |
GLOBAL
Resolving policy, look inside the global only. |
static int |
LOCAL
Resolving policy, look only in the composite. |
static int |
LOCAL_AND_GLOBAL
Resolving policy, look inside the composite and in the global scope. |
org.osgi.framework.BundleContext |
m_global
Global service registry. |
ServiceContext |
m_local
Local (Composite) Service Registry. |
| Constructor Summary | |
|---|---|
PolicyServiceContext(org.osgi.framework.BundleContext global,
ServiceContext local,
int policy)
Create a new PolicyServiceContext. |
|
| Method Summary | |
|---|---|
void |
addBundleListener(org.osgi.framework.BundleListener arg0)
Add a bundle listener. |
void |
addFrameworkListener(org.osgi.framework.FrameworkListener arg0)
Add a framework listener. |
void |
addServiceListener(org.osgi.framework.ServiceListener listener)
Add a service listener according to the policy. |
void |
addServiceListener(org.osgi.framework.ServiceListener listener,
java.lang.String filter)
Add a service listener according to the policy. |
org.osgi.framework.Filter |
createFilter(java.lang.String arg0)
Create a LDAP filter. |
org.osgi.framework.ServiceReference[] |
getAllServiceReferences(java.lang.String clazz,
java.lang.String filter)
Get all service references. |
org.osgi.framework.Bundle |
getBundle()
Get the current bundle. |
org.osgi.framework.Bundle |
getBundle(long bundleId)
Get the bundle object with the given id. |
org.osgi.framework.Bundle[] |
getBundles()
Get installed bundles. |
java.io.File |
getDataFile(java.lang.String filename)
Get a data file. |
java.lang.String |
getProperty(java.lang.String key)
Get a property value. |
java.lang.Object |
getService(org.osgi.framework.ServiceReference ref)
Get the service object for the given reference. |
org.osgi.framework.ServiceReference |
getServiceReference(java.lang.String clazz)
Get a service reference for the required service specification. |
org.osgi.framework.ServiceReference[] |
getServiceReferences(java.lang.String clazz,
java.lang.String filter)
Get a service reference for the required service specification. |
org.osgi.framework.Bundle |
installBundle(java.lang.String location)
Install a bundle. |
org.osgi.framework.Bundle |
installBundle(java.lang.String location,
java.io.InputStream input)
Install a bundle. |
org.osgi.framework.ServiceRegistration |
registerService(java.lang.String[] clazzes,
java.lang.Object service,
java.util.Dictionary properties)
This method is not supported. |
org.osgi.framework.ServiceRegistration |
registerService(java.lang.String clazz,
java.lang.Object service,
java.util.Dictionary properties)
This method is not supported. |
void |
removeBundleListener(org.osgi.framework.BundleListener listener)
Remove a bundle listener. |
void |
removeFrameworkListener(org.osgi.framework.FrameworkListener listener)
Remove a framework listener. |
void |
removeServiceListener(org.osgi.framework.ServiceListener listener)
Remove a service listener. |
boolean |
ungetService(org.osgi.framework.ServiceReference reference)
Unget the service reference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LOCAL
public static final int LOCAL_AND_GLOBAL
public static final int GLOBAL
public org.osgi.framework.BundleContext m_global
public ServiceContext m_local
| Constructor Detail |
|---|
public PolicyServiceContext(org.osgi.framework.BundleContext global,
ServiceContext local,
int policy)
global - : global bundle contextlocal - : parent (local) service contextpolicy - : resolution policy| Method Detail |
|---|
public void addServiceListener(org.osgi.framework.ServiceListener listener,
java.lang.String filter)
throws org.osgi.framework.InvalidSyntaxException
addServiceListener in interface ServiceContextaddServiceListener in interface org.osgi.framework.BundleContextlistener - : the listener to addfilter - : LDAP filter
org.osgi.framework.InvalidSyntaxException - occurs when the filter is malformed.ServiceContext.addServiceListener(org.osgi.framework.ServiceListener, java.lang.String)public void addServiceListener(org.osgi.framework.ServiceListener listener)
addServiceListener in interface ServiceContextaddServiceListener in interface org.osgi.framework.BundleContextlistener - : the listener to addServiceContext.addServiceListener(org.osgi.framework.ServiceListener)
public org.osgi.framework.ServiceReference[] getAllServiceReferences(java.lang.String clazz,
java.lang.String filter)
throws org.osgi.framework.InvalidSyntaxException
getAllServiceReferences in interface ServiceContextgetAllServiceReferences in interface org.osgi.framework.BundleContextclazz - : required service specification.filter - : LDAP filter
org.osgi.framework.InvalidSyntaxException - occurs when the LDAP filter is malformedServiceContext.getAllServiceReferences(java.lang.String, java.lang.String)public java.lang.Object getService(org.osgi.framework.ServiceReference ref)
getService in interface ServiceContextgetService in interface org.osgi.framework.BundleContextref - : the service reference
ServiceContext.getService(org.osgi.framework.ServiceReference)public org.osgi.framework.ServiceReference getServiceReference(java.lang.String clazz)
getServiceReference in interface ServiceContextgetServiceReference in interface org.osgi.framework.BundleContextclazz - : the required service specification
ServiceContext.getServiceReference(java.lang.String)
public org.osgi.framework.ServiceReference[] getServiceReferences(java.lang.String clazz,
java.lang.String filter)
throws org.osgi.framework.InvalidSyntaxException
getServiceReferences in interface ServiceContextgetServiceReferences in interface org.osgi.framework.BundleContextclazz - : the required service specificationfilter - : LDAP filter
org.osgi.framework.InvalidSyntaxException - occurs when the LDAP filter is malformedServiceContext.getServiceReference(java.lang.String)
public org.osgi.framework.ServiceRegistration registerService(java.lang.String[] clazzes,
java.lang.Object service,
java.util.Dictionary properties)
registerService in interface ServiceContextregisterService in interface org.osgi.framework.BundleContextclazzes - : specificationsservice - : service objectproperties - : service properties
ServiceContext.registerService(java.lang.String[], java.lang.Object, java.util.Dictionary)
public org.osgi.framework.ServiceRegistration registerService(java.lang.String clazz,
java.lang.Object service,
java.util.Dictionary properties)
registerService in interface ServiceContextregisterService in interface org.osgi.framework.BundleContextclazz - : specificationservice - : service objectproperties - : service properties
ServiceContext.registerService(java.lang.String, java.lang.Object, java.util.Dictionary)public void removeServiceListener(org.osgi.framework.ServiceListener listener)
removeServiceListener in interface ServiceContextremoveServiceListener in interface org.osgi.framework.BundleContextlistener - : the service listener to removeServiceContext.removeServiceListener(org.osgi.framework.ServiceListener)public boolean ungetService(org.osgi.framework.ServiceReference reference)
ungetService in interface ServiceContextungetService in interface org.osgi.framework.BundleContextreference - : the service reference to unget.
ServiceContext.ungetService(org.osgi.framework.ServiceReference)public void addBundleListener(org.osgi.framework.BundleListener arg0)
addBundleListener in interface org.osgi.framework.BundleContextarg0 - : bundle listener to addBundleContext.addBundleListener(org.osgi.framework.BundleListener)public void addFrameworkListener(org.osgi.framework.FrameworkListener arg0)
addFrameworkListener in interface org.osgi.framework.BundleContextarg0 - : framework listener to add.BundleContext.addFrameworkListener(org.osgi.framework.FrameworkListener)
public org.osgi.framework.Filter createFilter(java.lang.String arg0)
throws org.osgi.framework.InvalidSyntaxException
createFilter in interface org.osgi.framework.BundleContextarg0 - : String-form of the filter
org.osgi.framework.InvalidSyntaxException - : if the given argument is not a valid against the LDAP grammar.BundleContext.createFilter(java.lang.String)public org.osgi.framework.Bundle getBundle()
getBundle in interface org.osgi.framework.BundleContextBundleContext.getBundle()public org.osgi.framework.Bundle getBundle(long bundleId)
getBundle in interface org.osgi.framework.BundleContextbundleId - : bundle id
BundleContext.getBundle(long)public org.osgi.framework.Bundle[] getBundles()
getBundles in interface org.osgi.framework.BundleContextBundleContext.getBundles()public java.io.File getDataFile(java.lang.String filename)
getDataFile in interface org.osgi.framework.BundleContextfilename - : File name.
BundleContext.getDataFile(java.lang.String)public java.lang.String getProperty(java.lang.String key)
getProperty in interface org.osgi.framework.BundleContextkey - : key of the asked property
BundleContext.getProperty(java.lang.String)
public org.osgi.framework.Bundle installBundle(java.lang.String location)
throws org.osgi.framework.BundleException
installBundle in interface org.osgi.framework.BundleContextlocation - : URL of the bundle to install
org.osgi.framework.BundleException - : if the bundle cannot be installed correctlyBundleContext.installBundle(java.lang.String)
public org.osgi.framework.Bundle installBundle(java.lang.String location,
java.io.InputStream input)
throws org.osgi.framework.BundleException
installBundle in interface org.osgi.framework.BundleContextlocation - : URL of the bundle to installinput - :
org.osgi.framework.BundleException - : if the bundle cannot be installed correctlyBundleContext.installBundle(java.lang.String, java.io.InputStream)public void removeBundleListener(org.osgi.framework.BundleListener listener)
removeBundleListener in interface org.osgi.framework.BundleContextlistener - : the listener to removeBundleContext.removeBundleListener(org.osgi.framework.BundleListener)public void removeFrameworkListener(org.osgi.framework.FrameworkListener listener)
removeFrameworkListener in interface org.osgi.framework.BundleContextlistener - : the listener to removeBundleContext.removeFrameworkListener(org.osgi.framework.FrameworkListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||