jiveforums | 2 Dec 17:46

problem with the quartz scheduler

hello everybody,
we are running a 5.1.6 nuxeo ep.
we tried to schedule an event which should be sent every second (see sourcecode below).
we've also written a listener which works properly (tested with other predefined events).
the scheduler doesn't work, it isn't executed or registered (telling from the info log).

scheduler-service-contrib.xml:
------------------------------------<?xml version="1.0"?>
<component name="de.ancud.scheduler.HelloWorld.schedulerTest">
<implementation
class="org.nuxeo.ecm.platform.scheduler.core.service.SchedulerRegistryService" />
<extension-point name="schedule">
<schedule id="helloWorld">
<username>Administrator</username>
<password>Administrator</password>
<eventId>testEvent</eventId>            
<eventCategory>default</eventCategory>
<cronExpression>*/1 * * * * ?</cronExpression>
</schedule>
<object class="org.nuxeo.ecm.platform.scheduler.core.service.ScheduleImpl" />
</extension-point>
</component>
------------------------------------
event-listener-contrib.xml:
------------------------------------<?xml version="1.0"?>
<component name="de.ancud.scheduler.HelloWorld.event-listeners">

<extension target="org.nuxeo.ecm.core.listener.CoreEventListenerService"
point="listener">

<listener name="helloWorld_event" 
class="de.ancud.scheduler.HelloWorld.HwEventListener">
<eventId>testEvent</eventId>
</listener>
</extension>

</component>------------------------------------
HwEventListener.java
------------------------------------/*
* (C) Copyright 2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License
* (LGPL) version 2.1 which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl.html
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* Contributors:
*     Nuxeo - initial API and implementation
*
* $Id: $
*/
package de.ancud.scheduler.HelloWorld;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuxeo.ecm.core.api.CoreSession;
import org.nuxeo.ecm.core.api.event.CoreEvent;
import org.nuxeo.ecm.core.listener.AbstractEventListener;
import org.nuxeo.ecm.core.listener.AsynchronousEventListener;
import org.nuxeo.ecm.platform.util.RepositoryLocation;
import org.nuxeo.ecm.webapp.delegate.DocumentManagerBusinessDelegate;

// import org.nuxeo.ecm.platform.api.RepositoryDescriptor;

public class HwEventListener extends AbstractEventListener implements
AsynchronousEventListener {

private static final Log log = LogFactory.getLog(HwEventListener.class);
private HelloWorld HelloWorld_instance;

public void notifyEvent(CoreEvent event) {
log.info("TEST");
log.info("EVENT" + event.getEventId());
if (event.getEventId().equals("testEvent")) {            
log.info("Received event!");
HelloWorld_instance = new HelloWorld();
HelloWorld_instance.main();
}

}

}
------------------------------------
any ideas?

thanks in advance

Andreas

--
Posted by "ancud" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread: <http://www.nuxeo.org/discussions/thread.jspa?threadID=2147#5828>

Gmane