Tuesday, January 28, 2014

Design Time Governance Using WSO2 G-Reg



Governance of services is critically important in the SOA world to know about running services and their service contracts, such as whether service SLAs are violated or not. Governance tools provide support for policy creation, access control etc. for service governance, which are used within a business enterprise. Governance further enforces the created policy rules to be followed by users in design and run time of the services. 
This article explains how users can manage design time governance using WSO2 G-Reg.

Friday, December 20, 2013

Writing a simple tomcat valve and listener

Tomcat valves act as  preprocessors of each request for webapps. If we want to hook up our custom processing logic for requests, we can write a valve and register it globally for all webapps or locally for a webapp. 

To register it locally for a webapp, in the Context.xml of the webapp register it as;

<Context>
.....
 <Valve className="org.test.valve.MessageRecoveryTomcatValve"/>
.....
</Context>

To define the valve  globally, register it in the catalina-server.xml file

< Engine>
   <Host>
.........
      <Valve className="org.test.valve.MessageRecoveryTomcatValve"/>
.......
   </Host>
</Engine>

Tomcat listeners get notifications when there is any lifecycle state change occurs in a webapp.



This can be registered in the Context.xml of the webapp.

<Listener className="org.test.MyListener" context="GenericJavaBeanResource"/>