KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > aop > beanstyleconfig > InterceptorPerVm


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.aop.beanstyleconfig;
23
24 import org.jboss.aop.Advisor;
25 import org.jboss.aop.InstanceAdvisor;
26 import org.jboss.aop.advice.Interceptor;
27 import org.jboss.aop.joinpoint.Invocation;
28 import org.jboss.aop.joinpoint.Joinpoint;
29
30 /**
31  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
32  * @version $Revision: 37406 $
33  */

34 public class InterceptorPerVm implements Interceptor
35 {
36    private int intAttr;
37    private String JavaDoc stringAttr;
38    private Advisor advisor;
39    private InstanceAdvisor instanceAdvisor;
40    private Joinpoint joinpoint;
41
42    /**
43     * @return Returns the advisor.
44     */

45    public Advisor getAdvisor()
46    {
47       return advisor;
48    }
49
50    /**
51     * @param advisor The advisor to set.
52     */

53    public void setAdvisor(Advisor advisor)
54    {
55       this.advisor = advisor;
56    }
57
58    /**
59     * @return Returns the instanceAdvisor.
60     */

61    public InstanceAdvisor getInstanceAdvisor()
62    {
63       return instanceAdvisor;
64    }
65
66    /**
67     * @param instanceAdvisor The instanceAdvisor to set.
68     */

69    public void setInstanceAdvisor(InstanceAdvisor instanceAdvisor)
70    {
71       this.instanceAdvisor = instanceAdvisor;
72    }
73
74    /**
75     * @return Returns the intAttr.
76     */

77    public int getIntAttr()
78    {
79       return intAttr;
80    }
81
82    /**
83     * @param intAttr The intAttr to set.
84     */

85    public void setIntAttr(int intAttr)
86    {
87       this.intAttr = intAttr;
88    }
89
90    /**
91     * @return Returns the joinpoint.
92     */

93    public Joinpoint getJoinpoint()
94    {
95       return joinpoint;
96    }
97
98    /**
99     * @param joinpoint The joinpoint to set.
100     */

101    public void setJoinpoint(Joinpoint joinpoint)
102    {
103       this.joinpoint = joinpoint;
104    }
105
106    /**
107     * @return Returns the stringAttr.
108     */

109    public String JavaDoc getStringAttr()
110    {
111       return stringAttr;
112    }
113
114    /**
115     * @param stringAttr The stringAttr to set.
116     */

117    public void setStringAttr(String JavaDoc stringAttr)
118    {
119       this.stringAttr = stringAttr;
120    }
121
122    public String JavaDoc getName()
123    {
124       return this.getClass().getName();
125    }
126
127    public Object JavaDoc invoke(Invocation invocation) throws Throwable JavaDoc
128    {
129       InvokedConfigs.addInvokedConfig(this.getClass().getName(), advisor, instanceAdvisor, joinpoint, intAttr, stringAttr);
130       return invocation.invokeNext();
131    }
132
133 }
134
Popular Tags