Changeset 30133

Show
Ignore:
Timestamp:
02/13/08 14:38:27 (9 months ago)
Author:
bstefanescu
Message:

merged from trunk 30131, 30132 - added support for composite events and for event transactions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/event/CoreEvent.java

    r28563 r30133  
    2222import java.security.Principal; 
    2323import java.util.Date; 
     24import java.util.List; 
    2425import java.util.Map; 
    2526 
     
    2829 * 
    2930 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a> 
     31 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a> 
    3032 */ 
    3133public interface CoreEvent { 
     34 
     35        /** 
     36         * Tests if this event is a composite event. Composite events may have nested events. 
     37         * 
     38         * @return true if this is a composite event, false otherwise 
     39         */ 
     40        boolean isComposite(); 
     41 
     42        /** 
     43         * Get nested events if any. 
     44         * <p> 
     45         * Composite events are always returning a non null list. 
     46         * If there are no nested events an empty list is returned. 
     47         * <p> 
     48         * Be aware that the returned list may not be a copy of the internal list of nested events 
     49         * thus modifying it may also modify the composite event. 
     50         *<p> 
     51         * Non composite events are always returning null 
     52         * 
     53         * @return the nested event list or null if this is not a composite event 
     54         */ 
     55        List<CoreEvent> getNestedEvents(); 
     56 
    3257 
    3358    /** 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/event/impl/CoreEventImpl.java

    r28563 r30133  
    2222import java.security.Principal; 
    2323import java.util.Date; 
     24import java.util.List; 
    2425import java.util.Map; 
    2526 
     
    6162        this.category = category; 
    6263        this.comment = comment; 
     64    } 
     65 
     66 
     67 
     68    public boolean isComposite() { 
     69        return false; 
     70    } 
     71 
     72    public List<CoreEvent> getNestedEvents() { 
     73        return null; 
    6374    } 
    6475 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core/src/main/java/org/nuxeo/ecm/core/listener/CoreEventListenerService.java

    r21744 r30133  
    3030 * 
    3131 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a> 
     32 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a> 
    3233 */ 
    3334public interface CoreEventListenerService { 
     
    7677    EventListener getEventListenerByName(String name); 
    7778 
     79    /** 
     80     * Start a transaction 
     81     */ 
     82    void start(); 
     83 
     84    /** 
     85     * End a transaction 
     86     */ 
     87    void end(); 
     88 
     89    /** 
     90     * Commit a transaction 
     91     */ 
     92    void commit(); 
     93 
     94    /** 
     95     * Rollback a transaction 
     96     */ 
     97    void rollback(); 
    7898} 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core/src/main/java/org/nuxeo/ecm/core/listener/impl/CoreEventListenerServiceImpl.java

    r21640 r30133  
    161161    } 
    162162 
     163    public void start() { 
     164        throw new UnsupportedOperationException("Transaction are not supported"); 
     165    } 
     166 
     167    public void end() { 
     168        throw new UnsupportedOperationException("Transaction are not supported"); 
     169    } 
     170 
     171    public void commit() { 
     172        throw new UnsupportedOperationException("Transaction are not supported"); 
     173    } 
     174 
     175    public void rollback() { 
     176        throw new UnsupportedOperationException("Transaction are not supported"); 
     177    } 
     178 
    163179}