KickJava   Java API By Example, From Geeks To Geeks.

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


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 InterceptorPerJoinpoint 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    /**
44     * @return Returns the advisor.
45     */

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

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

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

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

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

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

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

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

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

118    public void setStringAttr(String JavaDoc stringAttr)
119    {
120       this.stringAttr = stringAttr;
121    }
122
123    public String JavaDoc getName()
124    {
125       return this.getClass().getName();
126    }
127
128    /* (non-Javadoc)
129     * @see org.jboss.aop.advice.Interceptor#invoke(org.jboss.aop.joinpoint.Invocation)
130     */

131    public Object JavaDoc invoke(Invocation invocation) throws Throwable JavaDoc
132    {
133       InvokedConfigs.addInvokedConfig(this.getClass().getName(), advisor, instanceAdvisor, joinpoint, intAttr, stringAttr);
134       return invocation.invokeNext();
135    }
136
137 }
138
Popular Tags