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