1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: PV Mapping Using Java Annotations |
From: | Mitch McCuiston <[email protected]> |
To: | "J. Lewis Muir" <[email protected]> |
Cc: | [email protected] |
Date: | Tue, 11 Jan 2011 10:42:44 -0600 |
Hi Lewis,The reason I wanted to use annotations is so that I could use AOP to instrument my classes intead with CA code intead of repeatedly writing it for each PV backed object. For example, if you wanted to implement a callback that would be executed when an PV monitor fired you would typically do the following in JCA/CAJ.
1. Create a context. 2. Create a channel to the PV you want to monitor.3. Create the monitor and map it to the java method you would like to callback to.
4. Convert PV types to Java types when necessary. 5. Execute pendIO calls when necessary. 6. Write code to tear down the channel once you're done.I feel like this is a manual process that could be automated for the majority of cases. If you just define the mapping of the callback method to the PV you are monitoring (with annotations in my case) you can use AOP to instrument your class with the rest of the code. The monitor case is almost identical to a Message Driven Bean/POJO in the J2EE world except your using a PV name instead of a JMS destination name. I also like the fact that my Java abstractions are decoupled from the CA code, which makes things like JUnit testing much easier.
I'll definitely take a look at the project you pointed out. Thanks, Mitch On 01/11/2011 09:40 AM, J. Lewis Muir wrote:
At a minimum, it would provide an EpicsPv object and make it easy to get and set values, easy to register interest in a value change, do blocking puts, and more. I've written such an implementation, but there are a lot of changes and improvements it needs before I'd make it publicly available.