What is the Use of Interceptor Design Pattern in Java ?

Interceptor design pattern is used for intercepting a request. Primary use of this pattern is in Security policy implementation.

We can use this pattern to intercept the requests by a client to a resource. At the interception we can check for authentication and authorization of client for the resource being accessed.

In Java it is used in javax.servlet.Filter interface.

This pattern is also used in Spring framework in HandlerInterceptor and MVC interceptor.



You May Interest

What is the Reason to Organize Classes and Interfaces in a Packag ...

How Will You Handle InterruptedException in Java ?

Why an Object Used as Key in HashMap Should Be Immutable in Java ...

How Can You Determine If Your Program Has a Deadlock in Java ?

What are the Differences Between a Vector and an ArrayList in Jav ...