KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > server > container > ServerSessionInterceptor


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.server.container;
8
9 import org.jboss.aop.advice.Interceptor;
10 import org.jboss.aop.joinpoint.Invocation;
11 import org.jboss.aop.joinpoint.MethodInvocation;
12
13 /**
14  * The server implementation of the session
15  *
16  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
17  * @version $Revision: 1.4 $
18  */

19 public class ServerSessionInterceptor
20    implements Interceptor
21 {
22    // Constants -----------------------------------------------------
23

24    // Attributes ----------------------------------------------------
25

26    // Static --------------------------------------------------------
27

28    public static ServerSessionInterceptor singleton = new ServerSessionInterceptor();
29
30    // Constructors --------------------------------------------------
31

32    // Public --------------------------------------------------------
33

34    // Interceptor implementation ------------------------------------
35

36    public String JavaDoc getName()
37    {
38       return "ServerProducerInterceptor";
39    }
40
41    public Object JavaDoc invoke(Invocation invocation) throws Throwable JavaDoc
42    {
43       MethodInvocation mi = (MethodInvocation) invocation;
44       String JavaDoc methodName = ((MethodInvocation) invocation).getMethod().getName();
45       if (methodName.equals("createBrowser"))
46          return null;
47       else if (methodName.equals("createConsumer"))
48          return null;
49       else if (methodName.equals("createProducer"))
50          return null;
51       else if (methodName.equals("closing") || methodName.equals("close"))
52          return null;
53       throw new UnsupportedOperationException JavaDoc(mi.getMethod().toString());
54    }
55
56    // Protected ------------------------------------------------------
57

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

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

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

64 }
65
Popular Tags