org.apache.clerezza.permissiondescriptions
Class PermissionGatherer

java.lang.Object
  extended by org.apache.clerezza.permissiondescriptions.PermissionGatherer
All Implemented Interfaces:
EventListener, org.osgi.framework.BundleListener

@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

This binds all implementations of PermissionDescriptionsProvider, and gathers their PermissionDescriptions. Furthermore the gatherer scans all activaded bundles for Permissions which are annonated with the PermissionInfo annotation and generates PermissionDescriptions for them. This service provides methods to retrieve the gathered PermissionDescriptions and also methods to retrieve all unannotated Permission found in the activated bundles. If new bundles are started then they are also scanned.

Author:
mir

Constructor Summary
PermissionGatherer()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionGatherer

public PermissionGatherer()
Method Detail

getPermissionDescriptorsPerBundles

public Map<org.osgi.framework.Bundle,Collection<PermissionDescripton>> getPermissionDescriptorsPerBundles()

getAllPermissionDescriptors

public Iterator<PermissionDescripton> getAllPermissionDescriptors()

getPermissionsPerBundles

public Map<org.osgi.framework.Bundle,Collection<Class<? extends Permission>>> getPermissionsPerBundles()

getAllPermissions

public Iterator<Class<? extends Permission>> getAllPermissions()

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)

bindPermissionProvider

protected void bindPermissionProvider(org.osgi.framework.ServiceReference serviceReference)

unbindPermissionProvider

protected void unbindPermissionProvider(org.osgi.framework.ServiceReference serviceReference)

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Specified by:
bundleChanged in interface org.osgi.framework.BundleListener


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.