OK, so you are using the Carbon valve abstraction, and there it is not the valve that handles the chaining, but carbon.tomcat.ext.valves.CompositeValve takes care of invoking each of the valves separately. So I think what you would need to do is implement a Tomcat valve, and register it in the catalina-server.xml. The other option would be to change the Carbon valve implementation to allow valves to take control of the chaining. However, that would be a major changes & require changes to all the valves we have in the system. The good thing is, there shouldn't be more than 5 or 6 such valves.
Azeez On Wed, Jun 26, 2013 at 10:26 AM, Nuwan Dias <[email protected]> wrote: > Hi Azeez, > > This [1] is the valve implementation we're using right now and this [2] is > how we register it. Where does the getNext() method reside? I don't see how > it could inherit into the valve we're using right now. And also, the > invoke() method has a void return, so even if we use that, how are we to > get access to the response since it doesn't return anything? As I > understood, you are expecting us to wait for the getNext().invoke() to > return isn't it? > > > [1] - > https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/apimgt/org.wso2.carbon.apimgt.interceptor/1.1.3/src/main/java/org/wso2/carbon/apimgt/interceptor/valve/APIManagerInterceptorValve.java > [2] - > https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/apimgt/org.wso2.carbon.apimgt.interceptor/1.1.3/src/main/java/org/wso2/carbon/apimgt/interceptor/valve/internal/APIManagerInterceptorComponent.java > > Thanks, > NuwanD. > > > On Tue, Jun 25, 2013 at 8:05 PM, Afkham Azeez <[email protected]> wrote: > >> The response comes back through the same valve; >> >> within a valve's invoke method, you normally call the invoke method of >> the next valve as follows: >> getNext().invoke(request, response); >> >> That is how valve chaining works. So, soon after >> the getNext().invoke(request, response); line, you can get hold of the >> response, and extract whatever you may need. >> >> >> On Tue, Jun 25, 2013 at 7:53 PM, Nuwan Dias <[email protected]> wrote: >> >>> Hi, >>> >>> As a part of getting API Management into the platform, we have used a >>> tomcat valve to intercept incoming service requests and perform API >>> Management functionalities. We are currently doing this for the GREG's REST >>> API. >>> >>> The problem we're facing now is that although the request can be >>> intercepted using the valve, the response does not go back through it. The >>> need of this requirement is to intercept responses and publish response >>> stats to BAM. >>> >>> Is there a way to intercept responses through the valve, or is there any >>> alternative ways of getting this done? >>> >>> Thanks, >>> NuwanD. >>> >>> -- >>> Nuwan Dias >>> >>> Senior Software Engineer - WSO2, Inc. http://wso2.com >>> email : [email protected] >>> Phone : +94 777 775 729 >>> >> >> >> >> -- >> *Afkham Azeez* >> Director of Architecture; WSO2, Inc.; http://wso2.com >> Member; Apache Software Foundation; http://www.apache.org/ >> * <http://www.apache.org/>** >> email: **[email protected]* <[email protected]>* cell: +94 77 3320919 >> blog: **http://blog.afkham.org* <http://blog.afkham.org>* >> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> >> * >> linked-in: **http://lk.linkedin.com/in/afkhamazeez* >> * >> * >> *Lean . Enterprise . Middleware* >> > > > > -- > Nuwan Dias > > Senior Software Engineer - WSO2, Inc. http://wso2.com > email : [email protected] > Phone : +94 777 775 729 > -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * <http://www.apache.org/>** email: **[email protected]* <[email protected]>* cell: +94 77 3320919 blog: **http://blog.afkham.org* <http://blog.afkham.org>* twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> * linked-in: **http://lk.linkedin.com/in/afkhamazeez* * * *Lean . Enterprise . Middleware*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
