Hi All,
We are using a custom compoment and need to stop permanently.We have clicked on stop button in component and went to inactive mode. If we restart the instance, all the components are loading and even this also moving to active state.
We need to stop and it should not get active even the instance restarted. Please advice.
Solved! Go to Solution.
Views
Replies
Total Likes
The state of the component is not persisted, so you would need to stop after the bundle has been started. I would recommend you to change your component and have either a "enabled" config option or just start it only if a configuration is present.
If you need a quick and dirty workaround to this problem, I would recommend to use the component disabler of ACS commons [1].
regards,
Jörg
[1] http://adobe-consulting-services.github.io/acs-aem-commons/features/osgi-disabler.html
Views
Replies
Total Likes
Hello,
You can add OSGI Property "enabled" to the component.
Also create activation method:
@Activate @Modified protected void activate(ComponentContext componentContext) { if (enabled) { // your configurable property componentContext.disableComponent("COMPONENT_NAME"); } }
Views
Replies
Total Likes
Hello,
1. You can create OSGI config file for your component.
<?xml version="1.0" encoding="UTF-8"?><jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" enabled="{Boolean}false"/>
2. Add property "enabled" to the component.
Also create activation method:
@Activate @Modified protected void activate(ComponentContext componentContext) { if (enabled) { // your configurable property componentContext.disableComponent("COMPONENT_NAME"); } }
Views
Replies
Total Likes
The state of the component is not persisted, so you would need to stop after the bundle has been started. I would recommend you to change your component and have either a "enabled" config option or just start it only if a configuration is present.
If you need a quick and dirty workaround to this problem, I would recommend to use the component disabler of ACS commons [1].
regards,
Jörg
[1] http://adobe-consulting-services.github.io/acs-aem-commons/features/osgi-disabler.html
Views
Replies
Total Likes
Here an example without any coding needed...
Views
Replies
Total Likes