Expand my Community achievements bar.

Disable OSGI Components & Bundles as part of Application Configuration

Avatar

Level 2

ACS AEM Commons OSGI Bundle and Component Disabler config allows to shut-down OSGI Components and Services by configuration. This feature allows OSGI Bundles and Components to be disabled as part of application configuration and these can be well managed for different environments using run modes config.

OSGI Component Disabler:

Define a sling:OsgiConfig under project config node:

Ex:

/apps/poc/config/com.adobe.acs.commons.util.impl.ComponentDisabler

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"

xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

jcr:primaryType="sling:OsgiConfig"

components="[pid1,pid2]"

/>

Snapshots below for reference:

Components would be an array of the OSGI component PIDs to disable. CRX and OSGI view of component disable configuration.

OSGI Bundle Disabler:

Bundles would be an array of the OSGI bundle symbolic names to disable.

Ex:

/apps/poc/config/com.adobe.acs.commons.util.impl.BundleDisabler

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"

xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

jcr:primaryType="sling:OsgiConfig"

bundles="[bundle1,bundle2]"

/>

CRX and OSGI view of bundle disable configuration.

That's it and we are done with the bundle and component disabler configuration and can be utilized in any AEM specific need.

2 Replies

Avatar

Level 2

Can you tell how to persist existing values which are added to this configuration(Component Disabler) as part of another project on the same instance?