I would like to create my own Custom Tube 开发者_开发技巧and put it in the Java Metro WS Stack, but so far I have no luck. I have not found any thorough documentation of Metro, especially about this part (the Metro documentation on the official site is quite useless).
What I have found out so far is that I need to create a Tube that implements AbstractFilterTubeImpl
, then I need a TubelineAssembler
, and a factory (TubelineAssemblerFactory
). However, after creating these classes, I have no idea what to do with them, how to plug it into the WS Stack. I have read a lot of blogs and sites, some of them use an old method which uses TubeFactory (but this class does not even exist any more), and none of them clearly explain what to do at this point.
Some of them mention a META-INF/services
folder, where I have to create a config file, but I'm not sure where this folder is supposed to be, what the config file has to contain exactly (found contrary blog posts about this), and how it will be recognized. I am using Netbeans IDE 6.9.1 with Glassfish 3.
Any help would be greatly appreciated. Thanks!
The following links helped me in figuring it out. In newer versions of Metro/Glassfish you have to deploy a metro.xml
with your application (in the META-INF directory) to customize the tubeline creation... See the second link for an example.
Custom tubes sample for Metro
Intercepting web service calls with a custom Metro Tube
精彩评论