I have a component plugin module
<component key="my.unique.key" class="com.my.Component" public="true">
<interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface>
<param name="myParam">myValue</param>
</component>
How to access this param from com.my.Component class?
Community moderators have prevented the ability to post new answers.
I found the answer.
Taking this question as a source https://answers.atlassian.com/questions/60582
<dependency> <groupId>com.atlassian.plugins</groupId> <artifactId>atlassian-plugins-osgi-bridge</artifactId> <version>2.10.1</version> <scope>provided</scope> </dependency>
<component-import key="plugin-retrieval-service" interface="com.atlassian.plugin.osgi.bridge.external.PluginRetrievalService"/>
import com.atlassian.plugin.Plugin; import com.atlassian.plugin.osgi.bridge.external.PluginRetrievalService; public class YourComponent { public YourComponent(PluginRetrievalService prs) { Plugin plugin = prs.getPlugin(); Map<String, String> params = pluginRetrievalService.getPlugin().getModuleDescriptorsByModuleClass( getClass() ).get( 0 ).getParams(); //some stuff with params for YourComponent class. } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.