com.bea.wsrp.consumer.resource
Interface IResourceServletInterceptor

All Known Implementing Classes:
DefaultSecurityCheckResourceServletInterceptor, WsrpResourceServletInterceptor

public interface IResourceServletInterceptor

Implementations of this interface can be used to intercept "getResource" WSRP operations on the consumer side. To register an implementation of this interface as an interceptor, it must be specified in the WEB-INF/web.xml file. As in init-param to the ResourceProxyServlet.


Method Summary
 Status.OnIOFailure onIOFailure(IResourceServletRequestContext requestContext, IResourceServletResponseContext responseContext, Throwable t)
          Invoked when there is exception while sending the request or receiving the response.
 void onServletDestroy()
          Allow the interceptor to cleanup resources created during onServletInit.
 void onServletInit(javax.servlet.ServletConfig config)
          Called when the Resource Servlet is initialized.
 Status.PostInvoke postInvoke(IResourceServletRequestContext requestContext, IResourceServletResponseContext responseContext)
          Invoked after receiving the response.
 Status.PreInvoke preInvoke(IResourceServletRequestContext requestContext)
          Invoked before requesting a resource
 

Method Detail

onServletInit

void onServletInit(javax.servlet.ServletConfig config)
                   throws javax.servlet.ServletException
Called when the Resource Servlet is initialized. This allows the interceptor to set static members and create resources. NOTE: Setting instance members should NOT be done here as individual calls will receive different instances.

Parameters
config - The Servlet's config for getting init-params and the servlet context.
Throws
javax.servlet.ServletException - If the interceptor throws an ServletException it will be handled by the servlet container.

onServletDestroy

void onServletDestroy()
Allow the interceptor to cleanup resources created during onServletInit.


preInvoke

Status.PreInvoke preInvoke(IResourceServletRequestContext requestContext)
                           throws IOException
Invoked before requesting a resource

Parameters
requestContext - a request context object that represents input data for the resource
Returns
by default the implementation should return Status.PreInvoke.CONTINUE_CHAIN.
Throws
IOException - If the interceptor throws an IOException it will be handled by the servlet container.

postInvoke

Status.PostInvoke postInvoke(IResourceServletRequestContext requestContext,
                             IResourceServletResponseContext responseContext)
                             throws IOException
Invoked after receiving the response.
Note: While this method will be called after a forward (requestContext.isForwardRequest() == true), The responseContext will be empty and the will have been committed. Therefore only limited support is provided for this use-case.

Parameters
requestContext - a request context object that represents input data for the resource
responseContext - a response context object that represents output data from the resource. The response context will be empty if the preInvoke method had returned Status.PreInvoke.SKIP_REQUEST_ABORT_CHAIN.
Returns
by default the implementation should return Status.PostInvoke.CONTINUE_CHAIN.
Throws
IOException - If the interceptor throws an IOException it will be handled by the servlet container.
See Also
IResourceServletRequestContext.isForwardRequest()

onIOFailure

Status.OnIOFailure onIOFailure(IResourceServletRequestContext requestContext,
                               IResourceServletResponseContext responseContext,
                               Throwable t)
                               throws IOException
Invoked when there is exception while sending the request or receiving the response. The interceptor can handle the exception, or retry the request.

Parameters
requestContext - a request context object that represents input data for the resource
responseContext - an empty response context, so that an implementation can populate it and return Status.OnIOFailure.HANDLED.
t - an exception that represents an IO failure.
Returns
by default the implementation should return Status.OnIOFailure.CONTINUE_CHAIN.
Throws
IOException - If the interceptor throws an IOException it will be handled by the servlet container.


Copyright © 2011, Oracle. All rights reserved.