This demo shows how to write and use transport interceptors. You can find out what interceptors are in the Developer's Guide.
This interceptor monitors all readings and writings on input and output streams and dumps bytes onto System.out.
The files for this demo are as described in Files and Directories.
The implementation consists of following files:
src/demo/advanced/interceptor/server/InterceptorService.java - implementation of the Web Service. This class is used for the WSDL generation by SESJ Java2WSDL tool src/demo/advanced/interceptor/server/InterceptorServer.java - runs server, publishes service and inserts interceptor src/demo/advanced/interceptor/MyInterceptor.java - implementation class of the interceptor src/demo/advanced/interceptor/client/InterceptorClient.java - client implementation containing the main() method src/package.xml - deployment descriptor of the service package used during persistent deployment
You can run the demo using the "run.sh" (for UNIX) or "run.bat" (for Windows) scripts. Running the script without arguments prints out a help message on screen.
The demo can be run in two different ways:
To use Runtime Publishing, follow these steps:
Be sure that you have not started SESJ.
Compile the classes in the "demo.advanced.interceptor.server" package.
Linux: ./run.sh make_server Windows: run.bat make_server
Run the InterceptorServer class (it starts SESJ and publishes InterceptorService).
Linux: ./run.sh run_server Windows: run.bat run_server
Compile InterceptorClient.
Linux: ./run.sh make_client Windows: run.bat make_client
Run InterceptorClient (it will call InterceptorService).
Linux: ./run.sh run_client Windows: run.bat run_client
To run using Persistent Deployment:
Publish InterceptorService on SESJ which is already running.
Be sure that you've started SESJ.
Compile the InterceptorService class.
Linux: ./run.sh make_service Windows: run.bat make_service
Deploy the service on the SESJ.
Linux: ./run.sh deploy_service Windows: run.bat deploy_service
Compile InterceptorClient.
Linux: ./run.sh make_client Windows: ./run.bat make_client
Run InterceptorClient (it will call InterceptorService).
Linux: ./run.sh run_client Windows: ./run.bat run_client
Undeploy InterceptorService from the SESJ.
Linux: ./run.sh undeploy_service Windows: run.bat undeploy_service