KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > aop > pointcut > PointcutInfo


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.aop.pointcut;
23
24 import org.jboss.aop.advice.AdviceBinding;
25
26 /**
27  * Contains information about a pointcut.
28  * @author Flavia Rainone
29  */

30 public class PointcutInfo
31 {
32    
33    private Pointcut pointcut;
34    private AdviceBinding binding;
35    private boolean dynamicAop;
36
37    /**
38     * This constructor must be called only when a pointcut
39     * is declared inside a binding.
40     * @param pointcut the pointcut.
41     * @param binding the binding associated with <code>pointcut</code>.
42     * @param dynamicAop if <code>true</code>, indicates that <code>binding</code>
43     * was added during a dynamic aop operation (i.e., in runtime).
44     */

45    public PointcutInfo(Pointcut pointcut, AdviceBinding binding, boolean dynamicAop)
46    {
47       this(pointcut, dynamicAop);
48       this.binding = binding;
49    }
50    
51    /**
52     * Constructor that must be called only when a pointcut is declared
53     * outside a binding.
54     * @param pointcut the pointcut.
55     * @param dynamicAop if <code>true</code>, indicates that <code>binding</code>
56     * was added during a dynamic aop operation (i.e., in runtime).
57     */

58    public PointcutInfo(Pointcut pointcut, boolean dynamicAop)
59    {
60       this.pointcut = pointcut;
61       this.dynamicAop = dynamicAop;
62    }
63    
64    /**
65     * Returns the pointcut associated with this information.
66     * @return the pointcut.
67     */

68    public Pointcut getPointcut()
69    {
70       return this.pointcut;
71    }
72    
73    /**
74     * Returns the <code>AdviceBinding</code> associated with the
75     * pointcut.
76     * @return an instance of <code>org.jboss.aop.advice.AdviceBinding</code>.
77     * May be null if this pointcut isn't associated with a binding.
78     */

79    public AdviceBinding getBinding()
80    {
81       return this.binding;
82    }
83    
84    /**
85     * Indicates if this pointcut was added to the system through a dynamic aop
86     * operation. (i.e., through a AspectManager.addBinding() invocation made during
87     * system runtime).
88     */

89    public boolean isDynamicAop()
90    {
91       return this.dynamicAop;
92    }
93 }
Popular Tags