How to add a TransactionStatusListener to txnmgr

29 views
Skip to first unread message

Jeronimo Paoletti

unread,
Nov 26, 2010, 9:29:08 AM11/26/10
to jpos-users
I cant figure out how i can add a TransactionStatusListener to transaction manager by xml. Is there a way or it must be added by addListener() method ?

Regards.

--
A.C. Jerónimo Paoletti
jPOS Presentation Manager Project Manager

Alejandro Revilla

unread,
Nov 26, 2010, 9:47:53 AM11/26/10
to jpos-...@googlegroups.com
Good point. You can't. As it is now, you need another QBean that would get a reference to the TM using the NameRegistrar and register itself. Kind of CoI :)

It worked for my use case because I was monitoring the TMs from an UI component that was already instantiated, but I can see how this could be very useful, if the TM would support something like:

<txnmgr ...>
   <status-listener class="xxxx">
      <property ...>
  </status-listener>
</txnmgr>

I believe it's an easy addition. If you want to add a feature request in http://jpos.org/issues we may be able to address it at some point.

--Alejandro

--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users

Jeronimo Paoletti

unread,
Nov 26, 2010, 9:59:36 AM11/26/10
to jpos-...@googlegroups.com
That status-listener xml definition was exactly what i needed :P

I'll open the issue and try to resolve it myself asap 

Regards

Jeronimo Paoletti

unread,
Nov 26, 2010, 10:04:24 AM11/26/10
to jpos-...@googlegroups.com

Alejandro Revilla

unread,
Nov 26, 2010, 10:08:25 AM11/26/10
to jpos-...@googlegroups.com
Excellent.

You can try to send me a Git based patch (git --format-patch), I'm new to git and will be fun to test it.

Jeronimo Paoletti

unread,
Nov 26, 2010, 10:38:09 AM11/26/10
to jpos-...@googlegroups.com
That is.

Command used: git format-patch origin

Patch attached. 

Have fun :P

On Fri, Nov 26, 2010 at 12:08 PM, Alejandro Revilla <a...@jpos.org> wrote:
Excellent.

You can try to send me a Git based patch (git --format-patch), I'm new to git and will be fun to test it.



--


0001-Added-the-ability-to-define-status-listener-in-xml-d.patch

Alejandro Revilla

unread,
Nov 26, 2010, 11:01:26 AM11/26/10
to jpos-...@googlegroups.com
That was fast!

https://github.com/jpos/jPOS/commit/0b8b16e0de116b805dc4c6088f4b238426d47934

Now I'll have to rebase the mvn branch, which is not good because it's already published...


Jeronimo Paoletti

unread,
Nov 26, 2010, 11:23:49 AM11/26/10
to jpos-...@googlegroups.com
D'oh! Dealing with Maven does not sound so good now, doesn't it? :P

I can't help you there, sorry.

BTW, nice feature this git patch thing 

Alejandro Revilla

unread,
Nov 26, 2010, 12:36:11 PM11/26/10
to jpos-...@googlegroups.com
Well.. I did something that shouldn't be done, I've rebased and force pushed the mvn branch.

I hope to be able to tag master as 1.7.2 soon, and merge mvn to master, so I can delete it.


Jeronimo Paoletti

unread,
Dec 1, 2010, 2:16:52 PM12/1/10
to jpos-...@googlegroups.com
Alejandro, i've found that it will be really useful to have a public TransactionStatusEvent.getContext() getter so you can do a lot more actions in a status listener. context is the only property without getter though.

Here is the patch.

Regards.

On Fri, Nov 26, 2010 at 2:36 PM, Alejandro Revilla <a...@jpos.org> wrote:
Well.. I did something that shouldn't be done, I've rebased and force pushed the mvn branch.

I hope to be able to tag master as 1.7.2 soon, and merge mvn to master, so I can delete it.


On Fri, Nov 26, 2010 at 14:23, Jeronimo Paoletti <jeronimo...@gmail.com> wrote:
D'oh! Dealing with Maven does not sound so good now, doesn't it? :P

I can't help you there, sorry.

BTW, nice feature this git patch thing 

0001-Added-context-getter-to-transaction-status-event.patch

Alejandro Revilla

unread,
Dec 1, 2010, 2:42:31 PM12/1/10
to jpos-...@googlegroups.com
Good point. Done in 'master' https://twitter.com/#!/jposcommits/status/10054325887827968

Now will 'do the needful' on 'mvn' and 'v1_7'
Reply all
Reply to author
Forward
0 new messages