package com.poco.PoCoRuntime;
import org.aspectj.lang.JoinPoint;

/**
 * Represents an action/result intercepted by AspectJ for use by PoCo policies.
 * This object is created from an AspectJ JoinPoint object and provides all necessary
 * information for PoCo policies to make a decision.
 */
public class Event {
    private String signature;
    public String eventType;

    private Object result = null;

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    /**
     * Construct an event from explicitly passed details. Used when testing.
     *
     * @param signature method signature of event
     */
    public Event(String eventType, String signature) {
        this.eventType = eventType;
        this.signature = signature;
    }

    public Event(String eventType) {
        this.eventType = eventType;
        this.signature = "";
    }

    public Event(JoinPoint joinPoint) {
        this.signature = joinPoint.getSignature().toString();
    }

    public String getSignature() {
        return signature;
    }

    @Override
    public String toString() {
        return "Event [signature=" + signature + ", eventType=" + eventType
                + ", result=" + result + "]";
    }
}

@@ -13,21 +13,10 @@
 poco
-.PoCoRuntime
 ;
+%0A
 %0Aimp
@@ -327,29 +327,30 @@
 ature;%0A    p
-ublic
+rivate
  String even
@@ -356,16 +356,55 @@
 ntType;%0A
+    private String promotedMethod;%0A    
 %0A    pri
@@ -429,16 +429,17 @@
  = null;
+ 
 %0A%0A    pu
@@ -460,32 +460,26 @@
 tResult() %7B%0A
-        
+%09%09
 return resul
@@ -477,30 +477,31 @@
 urn result;%0A
+%09%7D%0A
     
-%7D%0A
 %0A    public 
@@ -532,28 +532,25 @@
 sult) %7B%0A    
-    
+%09
 this.result 
@@ -566,20 +566,319 @@
 %0A    %7D%0A%0A
-    
+%09public String getPromotedMethod() %7B%0A%09%09return promotedMethod;%0A%09%7D%0A%0A%09public void setPromotedMethod(String promotedMethod) %7B%0A%09%09this.promotedMethod = promotedMethod;%0A%09%7D%0A%0A%09public String getEventType() %7B%0A%09%09return eventType;%0A%09%7D%0A%0A%09public void setEventType(String eventType) %7B%0A%09%09this.eventType = eventType;%0A%09%7D%0A%0A%09
 /**%0A    
@@ -1435,20 +1435,17 @@
 %0A    %7D%0A%0A
-    
+%09
 @Overrid
@@ -1446,20 +1446,17 @@
 verride%0A
-    
+%09
 public S
@@ -1470,32 +1470,26 @@
 oString() %7B%0A
-        
+%09%09
 return %22Even
@@ -1548,24 +1548,12 @@
 ype%0A
-                
+%09%09%09%09
 + %22,
@@ -1578,16 +1578,23 @@
  + %22%5D%22;%0A
+%09%7D%0A
     
-%7D
+%0A    
 %0A%7D%0A

Add field