What is the best way to use transactional active objects?

Stefan Glase September 23, 2018

I see the following alternatives and do not know which one is better than the other.

a) Keep @ComponentImport annotation on your classes where you require ActiveObjects like this:

@ComponentImport
private ActiveObjects activeObjects;

And in combination with this add the following to the Spring configuration:

<bean class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
<constructor-arg ref="activeObjects"/>
</bean>

This solution is based on the ActiveObjects component being available under the name activeObjects or else this will not work.

b) Remove all @ComponentImport annotations from your code and require Spring to resolve ActiveObjects with OSGi so that there is only one instance available to your classes.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
xmlns:osgi="http://www.eclipse.org/gemini/blueprint/schema/blueprint"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.atlassian.com/schema/atlassian-scanner/2
http://www.atlassian.com/schema/atlassian-scanner/2/atlassian-scanner.xsd
http://www.eclipse.org/gemini/blueprint/schema/blueprint
http://www.eclipse.org/gemini/blueprint/schema/blueprint/gemini-blueprint.xsd">

<osgi:reference id="activeObjects">
<osgi:interfaces>
<value>com.atlassian.activeobjects.external.ActiveObjects</value>
</osgi:interfaces>
</osgi:reference>

<bean id="tx-processor" class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
<constructor-arg ref="activeObjects"/>
</bean>

<atlassian-scanner:scan-indexes/>

</beans>   

Can anybody tell me which of those two alternative is the better way or whether there is another solution to favor over those two?

1 answer

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 25, 2018

Hey Stefan,

We have a dedicated Developer Community that might be good to check out for plugin development related questions. Since the topics are more focused, it's easier for other developers to watch the questions coming in and provide guidance. There aren't many folks on the "primary"/user-facing Community who have strong Java development experience and develop specifically for Jira.

Since we don't have a clean integration with the Developer community right now, the best thing to do is copy/paste your question as a new question over there (it's on a different Q&A platform).

Sorry I don't have a real answer for you but hoping this points you at someone who does! :)

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer