I think it will be better to use an asynchronous listener !
10 seconds to create documents synchronously, seems justified ;)

To use an asynchrone listener: 

in your core-listener-contrib:

<listener name="documentCreationListener" async="*true*" postCommit="*true*" 
class="org.nuxeo.project.sample.DocumentCreationListener" order="157">
   <event>documentCreated</event>
</listener>

in your java:
public class DocumentCreationListener implements *PostCommitEventListener* {
    public void handleEvent(EventBundle events) throws ClientException {
        if (!events.containsEventName(DocumentEventTypes.DOCUMENT_CREATED)) {
            return;
        }
                for (Event event : events) {
                        if 
(DocumentEventTypes.DOCUMENT_CREATED.equals(event.getName())) {
                            /*
                                   your code !!
                           */
                        }
                }
    }
}
--
Posted by "mejihad" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread: 
<http://www.nuxeo.org/discussions/thread.jspa?threadID=3513#10782>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to