View Javadoc

1   package org.xvsm.core.aspect;
2   
3   import java.io.Serializable;
4   import java.util.Properties;
5   
6   import org.xvsm.internal.exceptions.AspectNotOkException;
7   import org.xvsm.internal.exceptions.AspectRescheduleException;
8   import org.xvsm.internal.exceptions.AspectSkipException;
9   
10  /***
11   * Superclass of all Aspects.
12   * 
13   * @author Christian Schreiber, Michael Proestler
14   * 
15   */
16  public abstract class IAspect implements Serializable {
17  
18  	/***
19  	 * The aspect properties.
20  	 */
21  	protected Properties properties = new Properties();
22  
23  	/***
24  	 * The aspect identifier.
25  	 */
26  	private String id = null;
27  
28  	/***
29  	 * Execute the aspect.
30  	 * 
31  	 * @param c
32  	 *            the {@link AspectContext}.
33  	 * @throws AspectNotOkException
34  	 *             if the aspect wants to abort the surrounding transaction.
35  	 * @throws AspectRescheduleException
36  	 *             if the aspect wants to reschedule just this operation.
37  	 * @throws AspectSkipException
38  	 *             if the aspect just want to skip to the next operation. Skip
39  	 *             will also skip all following registered aspects on that
40  	 *             container.
41  	 */
42  	public abstract void execute(AspectContext c) throws AspectNotOkException,
43  			AspectRescheduleException, AspectSkipException;
44  
45  	/***
46  	 * Sets the properties of this aspect.
47  	 * 
48  	 * @param props
49  	 *            the properties for this aspect.
50  	 */
51  	public void setProperties(Properties props) {
52  		this.properties = props;
53  	}
54  
55  	/***
56  	 * Get the properties for this aspect.
57  	 * 
58  	 * @return the properties for this aspect.
59  	 */
60  	public Properties getProperties() {
61  		return this.properties;
62  	}
63  
64  	/***
65  	 * @return the id
66  	 */
67  	public String getId() {
68  		return id;
69  	}
70  
71  	/***
72  	 * @param id
73  	 *            the id to set
74  	 */
75  	public void setId(String id) {
76  		this.id = id;
77  	}
78  
79  }