public void lifecycleEvent(LifecycleEvent lifecycleEvent) {
String lifecycleEventType = lifecycleEvent.getType();
if (lifecycleEventType.equals(Lifecycle.BEFORE_START_EVENT)) {
//Initialize SpecSecurityBuilder
SpecSecurityBuilder specSecurityBuilder = new SpecSecurityBuilder(bundle, deploymentDescriptor, annotationScanRequired);
GeronimoStandardContext standardContext = (GeronimoStandardContext) lifecycleEvent.getSource();
GeronimoApplicationContext applicationContext = (GeronimoApplicationContext) standardContext.getInternalServletContext();
applicationContext.setSpecSecurityBuilder(specSecurityBuilder);
} else if (lifecycleEventType.equals(Lifecycle.START_EVENT)) {
GeronimoStandardContext standardContext = (GeronimoStandardContext) lifecycleEvent.getSource();
GeronimoApplicationContext applicationContext = (GeronimoApplicationContext) standardContext.getInternalServletContext();
//Calculate the final Security Permissions
SpecSecurityBuilder specSecurityBuilder = applicationContext.getSpecSecurityBuilder();
Map<String, ComponentPermissions> contextIdPermissionsMap = new HashMap<String, ComponentPermissions>();
contextIdPermissionsMap.put(contextId, specSecurityBuilder.buildSpecSecurityConfig());
//Update ApplicationPolicyConfigurationManager