开发者

Can I add listeners/publisher subscriber to JAXB objects?

开发者 https://www.devze.com 2023-02-10 21:48 出处:网络
I have a multithreaded application using JAXB.The JAXB object represent state of other system hardware.I have a thread monitoring the system h开发者_StackOverflow社区ardware, and it updates the JAXB o

I have a multithreaded application using JAXB. The JAXB object represent state of other system hardware. I have a thread monitoring the system h开发者_StackOverflow社区ardware, and it updates the JAXB objects with the setters to update the state.

I have another chunk of code that is supposed to "do something" when the state of an object changes. I'm wondering how to set up event listeners, or some sort of publisher subscriber scheme, so that when a JAXB object changes state, the appropriate response to the change is kicked off. I have not seen anything describing how something could register as a listener with a JAXB object.


JAXB objects are just POJOs, so you can modify the code to add listeners appropriate to your use case.

0

精彩评论

暂无评论...
验证码 换一张
取 消