@Service(value=PermissionGatherer.class) @Reference(name="permissionProvider", policy=DYNAMIC, referenceInterface=PermissionDescriptionsProvider.class, cardinality=OPTIONAL_MULTIPLE) public class PermissionGatherer extends Object implements org.osgi.framework.BundleListener
PermissionDescriptionsProvider
, and gathers their
PermissionDescription
s. Furthermore the gatherer scans all
activaded bundles for
Permission
s which are annonated with the
PermissionInfo
annotation and generates
PermissionDescription
s for them. This service provides methods
to retrieve the gathered
PermissionDescription
s and also methods to retrieve all
unannotated
Permission
found in the activated bundles. If new bundles are
started then they are also scanned.Constructor and Description |
---|
PermissionGatherer() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext) |
protected void |
bindPermissionProvider(org.osgi.framework.ServiceReference serviceReference) |
void |
bundleChanged(org.osgi.framework.BundleEvent event) |
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext) |
Iterator<PermissionDescripton> |
getAllPermissionDescriptors() |
Iterator<Class<? extends Permission>> |
getAllPermissions() |
Map<org.osgi.framework.Bundle,Collection<PermissionDescripton>> |
getPermissionDescriptorsPerBundles() |
Map<org.osgi.framework.Bundle,Collection<Class<? extends Permission>>> |
getPermissionsPerBundles() |
protected void |
unbindPermissionProvider(org.osgi.framework.ServiceReference serviceReference) |
public Map<org.osgi.framework.Bundle,Collection<PermissionDescripton>> getPermissionDescriptorsPerBundles()
public Iterator<PermissionDescripton> getAllPermissionDescriptors()
public Map<org.osgi.framework.Bundle,Collection<Class<? extends Permission>>> getPermissionsPerBundles()
public Iterator<Class<? extends Permission>> getAllPermissions()
protected void activate(org.osgi.service.component.ComponentContext componentContext)
protected void bindPermissionProvider(org.osgi.framework.ServiceReference serviceReference)
protected void unbindPermissionProvider(org.osgi.framework.ServiceReference serviceReference)
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged
in interface org.osgi.framework.BundleListener
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.