KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > container > ForwardInterceptor


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms.container;
8
9 import org.jboss.aop.advice.Interceptor;
10 import org.jboss.aop.joinpoint.Invocation;
11
12 /**
13  * An interceptor for forwarding invocations.
14  *
15  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
16  * @version $Revision: 1.2 $
17  */

18 public class ForwardInterceptor
19    implements Interceptor
20 {
21    // Constants -----------------------------------------------------
22

23    // Attributes ----------------------------------------------------
24

25    /** The delegate container */
26    private Container delegate;
27
28    // Static --------------------------------------------------------
29

30    // Constructors --------------------------------------------------
31

32    /**
33     * Create a new forwarding interceptor
34     *
35     * @param delegate the container to forward the invocation to
36     */

37    public ForwardInterceptor(Container delegate)
38    {
39       this.delegate = delegate;
40    }
41
42    // Public --------------------------------------------------------
43

44    // Interceptor implementation -----------------------------------
45

46    public String JavaDoc getName()
47    {
48       return "ForwardInterceptor";
49    }
50
51    public Object JavaDoc invoke(Invocation invocation) throws Throwable JavaDoc
52    {
53       return delegate.invoke(invocation);
54    }
55
56    // Protected ------------------------------------------------------
57

58    // Package Private ------------------------------------------------
59

60    // Private --------------------------------------------------------
61

62    // Inner Classes --------------------------------------------------
63

64 }
65
Popular Tags