[
https://issues.apache.org/jira/browse/OPENJPA-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981529#action_12981529
]
Wolfgang Glas edited comment on OPENJPA-1593 at 1/13/11 5:48 PM:
-----------------------------------------------------------------
Michael,
Thanks for reviewing my stuff, I've attached a version with slight javadoc
improvements and with curly braces add to all if-statements.
I don't know how to test OSGi service discovery inside a JUnit test.
What I've done is to attach a remote debugger to my apache karaf an add
breakpoints in side the ServiceListener and the bunde startup and shutdown
code. I then started and stopped the openjpa bundle with the transaction bundle
started or stopped. Then I started and stopped the transaction bundle while the
openjpa bundle was up in order to verify that the cached transaction manager
instance is reliably removed in all possible situations.
Ideas for automating these test are very much welcome ;-)
Best regards, Wolfgang
was (Author: [email protected]):
Michael,
Thanks for reviewing my stuff, I've attached a version with slight javadoc
improvements and with curly braces add to all if-statements.
I don't know how to test OSGi service discovery inside a JUnit test.
What I've done is to attach a remote debugger to my apahe karaf an add
breakpoints in side the SErfie listener and the startup and shutdown code. I
then started and stopped the openjap bundle with the transaction bundle started
or stopped. Then I started and stopped the transaction bundle while the openjpa
bundle was up in order to verify that the cached transaction manager instance
is reliably removed in all possible situations.
Ideas for automating these test are very much welcome ;-)
Best regards, Wolfgang
> Create an OSGiManagedRuntime
> ----------------------------
>
> Key: OPENJPA-1593
> URL: https://issues.apache.org/jira/browse/OPENJPA-1593
> Project: OpenJPA
> Issue Type: Sub-task
> Components: osgi
> Affects Versions: 2.0.0-beta
> Reporter: Donald Woods
> Assignee: Donald Woods
> Fix For: 2.2.0
>
> Attachments: OPENJPA-1593-1.patch, OPENJPA-1593-2.patch
>
>
> Follow-on to OPENJPA-1524 to create a generic OSGiManagedRuntime class that
> would work for vendors/frameworks other than Apache Aries.
> Tim's original suggestion was - One implementation suggestion would be to use
> a ServiceTracker to keep track of the JTA services. This would allow for lazy
> lookup and also provide a notification if the service is unregistered.
> This should then be possible to implement as a relatively simple subclass of
> RegistryManagedRuntime that overrides getTransactionManager(). I don't know
> if you have a nice mechanism to pass a BundleContext yet, but I don't think
> that should pose a significant problem.
> Now that we have a BundleUtils.java to require OSGi classes in our runtime,
> we should be able to lookup
> "javax.transaction.TransactionSynchronizationRegistry" from the
> ServiceRegistry to use, instead of relying on the current JNDI lookup which
> is Aries specific.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.