Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
6.7.0
-
None
-
Severity 3 - Minor
-
0
-
Description
When a component in plugin implements LifecycleAware interface, the onStart/onStop methods are supposed to be called when the plugin is started/stopped. However, the onStop is not triggered when the plugin is uninstalled.
The confluence implementation of LifecycleManager com.atlassian.sal.confluence.lifecycle.TenantAwareLifecycleManager does not seem to do it correctly.
Steps to replicate it:
1. Create a class implementing LifecycleAware in a plugin:
public class TestComponent implements LifecycleAware { public ExpiredSessionRemover() { } @Override public void onStart() { System.out.println("TestComponent started"); } @Override public void onStop() { System.out.println("TestComponent stopped") }
2. Register it in plugin.xml
<component key="testComponent" class="com.abc.TestComponent" public="true"> <interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface> </component>
3. Deploy the plugin
4. Uninstall the plugin
You will see the "TestComponent started" is printed in console while "TestComponent stopped" is not printed.