Creating and Deploying Interceptors

4. Shutdown Oracle Service Registry, delete the REGISTRY_HOMEwork directory, and restart the registry.

3.3.2. Logging Interceptor Sample

This section includes step-by-step instructions how to create the interceptor that logs requests. To create a logging interceptor: 1. Create Java file LoggingInterceptor.java as shown in Example 8, Logging Interceptor Class . 2. Compile the interceptor using Java -classpath REGISTRY_HOME\app\uddi\services\Wasp- inf\lib\application_core.jar; REGISTRY_HOME\lib\wasp.jar LoggingInterceptor.java 3. Copy LoggingInterceptor.class to the REGISTRY_HOMEappuddiservicesWasp-infclassesinterceptor directory. 4. Create the configuration file Myinterceptor.xml in REGISTRY_HOMEappuddiconf folder. For details, please see Example 9, Logging Interceptor Configuration File . 5. Shutdown Oracle Service Registry, delete the REGISTRY_HOMEwork directory, and restart the registry. Page 537

3.3.2. Logging Interceptor Sample

Example 8. Logging Interceptor Class package interceptor; import org.idoox.config.Configurable; import org.idoox.wasp.WaspInternalException; import org.idoox.wasp.interceptor.InterceptorChain; import org.systinet.uddi.interceptor.ExceptionInterceptor; import org.systinet.uddi.interceptor.RequestInterceptor; import org.systinet.uddi.interceptor.ResponseInterceptor; import org.systinet.uddi.interceptor.StopProcessingException; import java.lang.reflect.Method; public class LoggingInterceptor implements RequestInterceptor, ResponseInterceptor, ExceptionInterceptor { public void loadConfigurable config throws WaspInternalException { no initialization required } public void destroy { no destroy required } public void interceptMethod method, Object[] args, InterceptorChain chain, int position throws StopProcessingException, Exception { System.out.printlnrequest: + method.getName; } public Object interceptMethod method, Object returnValue, InterceptorChain chain, int position throws Exception { System.out.printlnresponse: + method.getName; return returnValue; } public Exception interceptMethod method, Exception e, InterceptorChain chain, int position { System.out.printlnexception: + method.getName; return e; } } Page 538

3.3.2. Logging Interceptor Sample