I'm building a plugin for Jira. I want to add a caching-layer so I wanted to use the
com.atlassian.cache.CacheManager
I have to inject this via an argument / setter.
Since I'm extending an other class I wanted to inject this via a setter, but for some reason it returns null all the time. It does not go past the setter.
import com.atlassian.cache.Cache; import com.atlassian.cache.CacheLoader; import com.atlassian.cache.CacheManager; import com.atlassian.cache.CacheSettingsBuilder; public class Foo extends AbstractJiraContextProvider { private CacheManager cacheManager; public void setCacheManager(CacheManager cacheManager) { //It does not get past this function.. this.cacheManager = cacheManager; } @Override public Map getContextMap(ApplicationUser user, JiraHelper jiraHelper) { cache = this.cacheManager.getCache("bar"); } }
I also tried this by doing the following:
public Foo(CacheManager cacheManager) { this.cacheManager = cacheManager; }
After that the plugin does nothing anymore. I do not get errors, but it just gives 0 output.
I used this for documentation: https://developer.atlassian.com/confdev/confluence-plugin-guide/writing-confluence-plugins/accessing-confluence-components-from-plugin-modules
Hi Wiard! This looks like a developer question, so my recommendation would be to ask our Developer Community for help. You can find them at community.developer.atlassian.com.
Cheers :)
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For those who are interrested, I moved my question to here: https://community.developer.atlassian.com/t/injecting-cachemanager-not-working-setter/3574
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.