Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hooks and Handlers  RSS feed

 
Pearlo Muthukumaran
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can we add Hooks and Handlers functionality to EJB Components?So that the behavior of EJB methods can be customized as per the customer requirements?
Rgds
Muthu
 
Pearlo Muthukumaran
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I struck with an idea and did a simple test also. Works fine !!! Please lemme know whether this is valid.
1. Define a Hook XML File
2. Define a Hook Class containing the customization code
3. Have the Hook Parsing logic embedded in the partial Business Class
4. Extend the partial business class to implement actual deployable
business class.
Hook Characteristics:
1. Behaves like Aspect Oriented Programming
2. Handles Arguments of the methods
3. Could be invoked before / after the core portion of a given method is executed depending upon the hook configuration.
Sample Hook XML File:
<?xml version="1.0"?>
<class name="test.LoadClass">
<method invoke="PRE" name="doChangedPrinting"/>
</class>
Rgds
Muthu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!