View Javadoc

1   /***************************************************************************************
2    * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved.                 *
3    * http://aspectwerkz.codehaus.org                                                    *
4    * ---------------------------------------------------------------------------------- *
5    * The software in this package is published under the terms of the LGPL license      *
6    * a copy of which has been included with this distribution in the license.txt file.  *
7    **************************************************************************************/
8   package org.codehaus.aspectwerkz.aspect;
9   
10  
11  import org.codehaus.aspectwerkz.AspectContext;
12  
13  /***
14   * Interface for that all aspect container implementations must implement.
15   *
16   * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
17   */
18  public interface AspectContainer {
19  
20      /***
21       * Creates a new perJVM cross-cutting instance, if it already exists then return it.
22       *
23       * @return the cross-cutting instance
24       */
25      Object aspectOf();
26  
27      /***
28       * Creates a new perClass cross-cutting instance, if it already exists then return it.
29       *
30       * @param klass
31       * @return the cross-cutting instance
32       */
33      Object aspectOf(Class klass);
34  
35      /***
36       * Creates a new perInstance cross-cutting instance, if it already exists then return it.
37       *
38       * @param instance
39       * @return the cross-cutting instance
40       */
41      Object aspectOf(Object instance);
42  
43      /***
44       * Creates a new perThread cross-cutting instance, if it already exists then return it.
45       *
46       * @param thread the thread for the aspect
47       * @return the cross-cutting instance
48       */
49      Object aspectOf(Thread thread);
50  
51      /***
52       * Returns the context.
53       *
54       * @return the context
55       */
56      AspectContext getContext();
57  }