geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r660557 [2/2] - in /geronimo/sandbox/quartz-plugin: ./ base/ base/console/ base/console/src/ base/console/src/java/ base/console/src/java/org/ base/console/src/java/org/gplugins/ base/console/src/java/org/gplugins/console/ base/console/src/...
Date Tue, 27 May 2008 15:23:16 GMT
Added: geronimo/sandbox/quartz-plugin/base/scheduler/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/pom.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/pom.xml (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/pom.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,76 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>gplugins</groupId>
+        <artifactId>quartz-parent</artifactId>
+        <version>1.0</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>quartz-scheduler-service</artifactId>
+    <name>Quartz Scheduler for Geronimo</name>
+
+    <build>
+        <sourceDirectory>src/java</sourceDirectory>
+        <testSourceDirectory>src/test</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <testResources>
+            <testResource>
+                <directory>src/test-resources</directory>
+            </testResource>
+        </testResources>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-system</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>opensymphony</groupId>
+            <artifactId>quartz</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzEJBRef.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzEJBRef.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzEJBRef.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzEJBRef.java Tue May 27 08:22:56 2008
@@ -0,0 +1,62 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * ReplaceMe
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class QuartzEJBRef implements Serializable {
+    private String propertyName;
+    private String ejbType;
+    private String localHome;
+    private String local;
+    private Properties pattern;
+
+    public QuartzEJBRef(String propertyName, String ejbType, String localHome, String local, Properties pattern) {
+        this.propertyName = propertyName;
+        this.ejbType = ejbType;
+        this.localHome = localHome;
+        this.local = local;
+        this.pattern = pattern;
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public String getEjbType() {
+        return ejbType;
+    }
+
+    public String getLocalHome() {
+        return localHome;
+    }
+
+    public String getLocal() {
+        return local;
+    }
+
+    public Properties getPattern() {
+        return pattern;
+    }
+}

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJob.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJob.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJob.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJob.java Tue May 27 08:22:56 2008
@@ -0,0 +1,48 @@
+/**
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.util.Map;
+import org.quartz.SchedulerException;
+
+/**
+ * Management interface for a Quartz schedule job
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
+ */
+public interface QuartzJob {
+    String getCronExpression();
+
+    void setCronExpression(String cronExpression) throws SchedulerException;
+
+    String getJobClass();
+
+    void setJobClass(String jobClass);
+
+    String getName();
+
+    void setName(String name);
+
+    Map getJobData();
+
+    void setJobData(Map jobData);
+
+    void pause() throws SchedulerException;
+
+    void resume() throws SchedulerException;
+
+    void execute() throws SchedulerException;
+}

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobFactory.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobFactory.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobFactory.java Tue May 27 08:22:56 2008
@@ -0,0 +1,94 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.naming.reference.ConfigurationAwareReference;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelRegistry;
+import org.quartz.Job;
+import org.quartz.SchedulerException;
+import org.quartz.simpl.SimpleJobFactory;
+import org.quartz.spi.TriggerFiredBundle;
+
+/**
+ * ReplaceMe
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class QuartzJobFactory extends SimpleJobFactory {
+    private static final String PROPERTY_PREFIX = "org.gplugins.quartz.";
+    private final static Log log = LogFactory.getLog(QuartzJobFactory.class);
+
+    public Job newJob(TriggerFiredBundle bundle) throws SchedulerException {
+        Kernel kernel = KernelRegistry.getSingleKernel();
+        Job job = super.newJob(bundle);
+        Map map = bundle.getJobDetail().getJobDataMap();
+        for (Iterator it = map.keySet().iterator(); it.hasNext();) {
+            String key = (String) it.next();
+            if(key.startsWith(PROPERTY_PREFIX)) {
+                processKey(kernel, job, bundle.getJobDetail().getName(), key.substring(PROPERTY_PREFIX.length()), map.get(key));
+            }
+        }
+
+        return job;
+    }
+
+    private void processKey(Kernel kernel, Job job, String jobName, String name, Object value) throws SchedulerException {
+        if(name.startsWith("ejb.")) {
+            injectReference(value, kernel, name, job, jobName, 4, "EJB Reference");
+        } else if(name.startsWith("resource.")) {
+            injectReference(value, kernel, name, job, jobName, 9, "Resource Reference");
+        } else if(name.startsWith("gbean.")) {
+            injectReference(value, kernel, name, job, jobName, 6, "GBean Reference");
+        } else {
+            throw new SchedulerException("Unrecognized job parameter '"+name+"'");
+        }
+    }
+
+    private void injectReference(Object value, Kernel kernel, String name, Job job, String jobName, int prefixLength,
+                                 String refType) throws SchedulerException {
+        ConfigurationAwareReference ref = (ConfigurationAwareReference) value;
+        ref.setKernel(kernel);
+        String property = name.substring(prefixLength);
+        String setterName = "set"+Character.toUpperCase(property.charAt(0))+property.substring(1);
+        Method all[] = job.getClass().getMethods();
+        try {
+            Object refValue = ref.getContent();
+            for (int i = 0; i < all.length; i++) {
+                Method method = all[i];
+                if(method.getName().equals(setterName) && method.getParameterTypes().length == 1 &&
+                        Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers()) &&
+                        method.getReturnType().equals(Void.TYPE)) {
+                    if(method.getParameterTypes()[0].isAssignableFrom(refValue.getClass())) {
+                        method.invoke(job, new Object[]{refValue});
+                        return;
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("Unable to set "+refType+" on Quartz job", e);
+            throw new SchedulerException("Unable to set "+refType+" '"+property+"' on job "+jobName, e);
+        }
+        throw new SchedulerException("No setter method "+setterName+" found for "+refType+" "+property+" on job "+jobName);
+    }
+}

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobGBean.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobGBean.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzJobGBean.java Tue May 27 08:22:56 2008
@@ -0,0 +1,155 @@
+/**
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.text.ParseException;
+import java.util.Map;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.JobDetail;
+import org.quartz.CronTrigger;
+import org.quartz.SchedulerException;
+import org.quartz.JobDataMap;
+
+/**
+ * Represents a Quartz job.
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
+ */
+public class QuartzJobGBean implements GBeanLifecycle, QuartzJob {
+    private final static Log log = LogFactory.getLog(QuartzJobGBean.class);
+    private final QuartzScheduler scheduler;
+    private final ClassLoader loader;
+    private String name;
+    private String jobClass;
+    private Map jobData;
+    private String cronExpression;
+    boolean running;
+
+    public QuartzJobGBean(QuartzScheduler scheduler, String jobClass, Map jobData, String name, ClassLoader loader) {
+        this.jobClass = jobClass;
+        this.name = name;
+        this.jobData = jobData;
+        this.scheduler = scheduler;
+        this.loader = loader;
+    }
+
+    public String getCronExpression() {
+        return cronExpression;
+    }
+
+    public void setCronExpression(String cronExpression) throws SchedulerException {
+        this.cronExpression = cronExpression;
+        if(running) {
+            try {
+                scheduler.rescheduleJob(name, createTrigger());
+            } catch (ParseException e) {
+                throw new SchedulerException("Unable to schedule; invalid cron expression '"+cronExpression+"'", e);
+            }
+        }
+    }
+
+    public String getJobClass() {
+        return jobClass;
+    }
+
+    public void setJobClass(String jobClass) {
+        this.jobClass = jobClass;
+    }
+
+    public Map getJobData() {
+        return jobData;
+    }
+
+    public void setJobData(Map jobData) {
+        this.jobData = jobData;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void pause() throws SchedulerException {
+        if(running) {
+            scheduler.pauseJob(name);
+        }
+    }
+
+    public void resume() throws SchedulerException {
+        if(running) {
+            scheduler.resumeJob(name);
+        }
+    }
+
+    public void execute() throws SchedulerException {
+        if(running) {
+            scheduler.executeImmediately(name);
+        }
+    }
+
+    public void doStart() throws Exception {
+        log.info("Scheduling job '"+name+"'");
+        Class cls = loader.loadClass(jobClass);
+        JobDetail jd = new JobDetail(name, QuartzSchedulerGBean.GROUP_NAME, cls);
+        if(jobData != null) {
+            jd.setJobDataMap(new JobDataMap(jobData));
+        }
+        CronTrigger cronTrigger = createTrigger();
+        scheduler.scheduleJob(jd, cronTrigger);
+        running = true;
+    }
+
+    public void doStop() throws Exception {
+        running = false;
+        scheduler.deleteJob(name);
+    }
+
+    public void doFail() {
+        running = false;
+    }
+
+    private CronTrigger createTrigger() throws ParseException {
+        CronTrigger cronTrigger = new CronTrigger(name+" Trigger", QuartzSchedulerGBean.GROUP_NAME);
+        cronTrigger.setCronExpression(cronExpression);
+        return cronTrigger;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Quartz Job", QuartzJobGBean.class);
+        infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+        infoFactory.addReference("QuartzScheduler", QuartzScheduler.class, "GBean");
+        infoFactory.addInterface(QuartzJob.class, new String[]{"cronExpression", "jobClass","name", "jobData"},
+                                                  new String[]{"cronExpression", "jobClass","name", "jobData"});
+
+        infoFactory.setConstructor(new String[]{"QuartzScheduler", "jobClass", "jobData", "name", "classLoader"});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzScheduler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzScheduler.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzScheduler.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzScheduler.java Tue May 27 08:22:56 2008
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.util.Map;
+import org.quartz.JobDetail;
+import org.quartz.Trigger;
+import org.quartz.SchedulerException;
+import org.quartz.Scheduler;
+
+/**
+ * Management interface for the Quartz scheduler
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
+ */
+public interface QuartzScheduler {
+    /**
+     * Provides raw access to the native Quartz scheduler.  This should be used
+     * if you don't plan to use the rest of the methods on this class.  If you
+     * like you can mix access to the native scheduler and using the other
+     * methods on this class and related plugins, but the Geronimo plugins will
+     * only see jobs created and configured through the Geronimo plugins, while
+     * the native scheduler will see everything.  It's recommended that you
+     * stick to one method or the other.
+     */
+    Scheduler getNativeScheduler();
+
+    /**
+     * Schedules a Quartz job.
+     *
+     * Note that any jobs scheduled through this mechanism must have the group
+     * name "Geronimo Quartz".  The scheduler will overwrite it to be that if
+     * necessary.
+     */
+    void scheduleJob(JobDetail detail, Trigger trigger) throws SchedulerException;
+
+    /**
+     * Deletes a scheduled job.  Assumes the group "Geronimo Quartz".
+     */
+    void deleteJob(String jobName) throws SchedulerException;
+
+    /**
+     * Returns a Map with keys of type JobDetail and values of type Trigger
+     * for all jobs scheduled with group "Geronimo Quartz".
+     */
+    Map getScheduledJobs() throws SchedulerException;
+
+    /**
+     * Sets a new Trigger for an existing job (which must be in the group
+     * "Geronimo Quartz").
+     */
+    void rescheduleJob(String jobName, Trigger trigger) throws SchedulerException;
+
+    /**
+     * Pauses an existing job (which must be in the group "Geronimo Quartz".
+     */
+    void pauseJob(String jobName) throws SchedulerException;
+
+    /**
+     * Resumes an existing job (which must be in the group "Geronimo Quartz".
+     */
+    void resumeJob(String jobName) throws SchedulerException;
+
+    /**
+     * Triggers a job (in the "Geronimo Quartz" group) to start right away.
+     */
+    void executeImmediately(String jobName) throws SchedulerException;
+
+    /**
+     * Gets the job GBean for a job in the "Geronimo Quartz" group.
+     */
+    QuartzJob getJob(String jobName);
+}

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzSchedulerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzSchedulerGBean.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzSchedulerGBean.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzSchedulerGBean.java Tue May 27 08:22:56 2008
@@ -0,0 +1,191 @@
+/**
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.util.Properties;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import java.util.Set;
+import java.io.InputStream;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.system.threads.ThreadPool;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.Scheduler;
+import org.quartz.SchedulerException;
+import org.quartz.JobDetail;
+import org.quartz.Trigger;
+import org.quartz.impl.StdSchedulerFactory;
+
+/**
+ * A GBean that starts and stops the Quartz scheduler.
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
+ */
+public class QuartzSchedulerGBean implements GBeanLifecycle, QuartzScheduler {
+    private final static Log log = LogFactory.getLog(QuartzSchedulerGBean.class);
+    final static String GROUP_NAME="Geronimo Quartz";
+    private final Kernel kernel;
+    private String threadPoolKey;
+    private Scheduler scheduler;
+    private Properties quartzProperties;
+
+    public QuartzSchedulerGBean(Properties quartzProperties, ThreadPool pool, Kernel kernel) {
+        this.quartzProperties = quartzProperties;
+        this.kernel = kernel;
+        if(pool != null) {
+            threadPoolKey = QuartzThreadPool.addPool(pool);
+        }
+    }
+
+    public Scheduler getNativeScheduler() {
+        return scheduler;
+    }
+
+    public void scheduleJob(JobDetail detail, Trigger trigger) throws SchedulerException {
+        detail.setGroup(GROUP_NAME);
+        scheduler.scheduleJob(detail, trigger);
+    }
+
+    public void deleteJob(String jobName) throws SchedulerException {
+        scheduler.deleteJob(jobName, GROUP_NAME);
+    }
+
+    public Map getScheduledJobs() throws SchedulerException {
+        String[] names = scheduler.getJobNames(GROUP_NAME);
+        Map map = new HashMap();
+        for (int i = 0; i < names.length; i++) {
+            String name = names[i];
+            JobDetail detail = scheduler.getJobDetail(name, GROUP_NAME);
+            Trigger[] triggers = scheduler.getTriggersOfJob(name, GROUP_NAME);
+            if(triggers.length == 1) {
+                map.put(detail, triggers[0]);
+            } else {
+                map.put(detail, null);
+            }
+        }
+        return map;
+    }
+
+    public Properties getQuartzProperties() {
+        return quartzProperties;
+    }
+
+    public void setQuartzProperties(Properties quartzProperties) {
+        this.quartzProperties = quartzProperties;
+    }
+
+    public void rescheduleJob(String jobName, Trigger trigger) throws SchedulerException {
+        Trigger[] triggers = scheduler.getTriggersOfJob(jobName, GROUP_NAME);
+        for (int i = 0; i < triggers.length; i++) {
+            Trigger old = triggers[i];
+            scheduler.unscheduleJob(old.getName(), old.getGroup());
+        }
+        trigger.setJobName(jobName);
+        trigger.setJobGroup(GROUP_NAME);
+        scheduler.scheduleJob(trigger);
+    }
+
+    public void executeImmediately(String jobName) throws SchedulerException {
+        scheduler.triggerJob(jobName, GROUP_NAME);
+    }
+
+    public void pauseJob(String jobName) throws SchedulerException {
+        scheduler.pauseJob(jobName, GROUP_NAME);
+    }
+
+    public void resumeJob(String jobName) throws SchedulerException {
+        scheduler.resumeJob(jobName, GROUP_NAME);
+    }
+
+    public QuartzJob getJob(String jobName) {
+        Set results = kernel.listGBeans(new AbstractNameQuery(null, Collections.singletonMap("name", jobName), QuartzJob.class.getName()));
+        if(results.size() == 0) {
+            return null;
+        }
+        return (QuartzJob) kernel.getProxyManager().createProxy((AbstractName) results.iterator().next(), QuartzJob.class);
+    }
+
+    public void doStart() throws Exception {
+        StdSchedulerFactory factory = new StdSchedulerFactory();
+        if(threadPoolKey != null) {
+            Properties props = new Properties();
+            InputStream in = Scheduler.class.getResourceAsStream("quartz.properties");
+            props.load(in);
+            in.close();
+            for (Iterator it = props.keySet().iterator(); it.hasNext();) {
+                String key = (String) it.next();
+                if(key.startsWith("org.quartz.threadPool.")) {
+                    log.info("Ignoring thread property '"+key+"'");
+                    it.remove();
+                } else {
+                    System.out.println(key+"="+props.getProperty(key));
+                }
+            }
+            // Initialize Quartz properties
+            props.put("org.quartz.threadPool.class", QuartzThreadPool.class.getName());
+            props.put("org.quartz.scheduler.jobFactory.class", QuartzJobFactory.class.getName());
+            // Apply user overrides
+            if(quartzProperties != null) {
+                props.putAll(quartzProperties);
+            }
+            // Customize our stuff if it wasn't overridden
+            if(props.getProperty("org.quartz.threadPool.class").equals(QuartzThreadPool.class.getName())) {
+                props.put("org.quartz.threadPool.poolID", threadPoolKey);
+            }
+            // Start the factory
+            factory.initialize(props);
+        }
+        scheduler = factory.getScheduler();
+        scheduler.start();
+    }
+
+    public void doStop() throws Exception {
+        try {
+            scheduler.shutdown();
+        } catch (SchedulerException e) {
+            log.error("Quartz scheduler shutdown error", e);
+        }
+    }
+
+    public void doFail() {
+    }
+
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Quartz Scheduler", QuartzSchedulerGBean.class);
+        infoFactory.addAttribute("quartzProperties", Properties.class, true, true);
+        infoFactory.addAttribute("kernel", Kernel.class, false, false);
+        infoFactory.addReference("ThreadPool", ThreadPool.class, "GBean");
+        infoFactory.addInterface(QuartzScheduler.class);
+        infoFactory.setConstructor(new String[]{"quartzProperties", "ThreadPool", "kernel"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Added: geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzThreadPool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzThreadPool.java?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzThreadPool.java (added)
+++ geronimo/sandbox/quartz-plugin/base/scheduler/src/java/org/gplugins/quartz/QuartzThreadPool.java Tue May 27 08:22:56 2008
@@ -0,0 +1,80 @@
+/**
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.gplugins.quartz;
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.geronimo.system.threads.ThreadPool;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.SchedulerConfigException;
+
+
+/**
+ * A wrapper around a Geronimo thread pool for usage by Quartz.
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 21:48:27 -0500 (Sat, 10 Dec 2005) $
+ */
+public class QuartzThreadPool implements org.quartz.spi.ThreadPool {
+    private final static Log log = LogFactory.getLog(QuartzThreadPool.class);
+    static Map geronimoPools = new HashMap();
+
+    static String addPool(ThreadPool pool) {
+        synchronized(QuartzThreadPool.class) {
+            int count = geronimoPools.size();
+            String key = Integer.toString(count);
+            geronimoPools.put(key, pool);
+            return key;
+        }
+    }
+
+    private ThreadPool geronimoPool;
+    private String poolID;
+
+    public int getPoolSize() {
+        return geronimoPool.getPoolSize();
+    }
+
+    public void initialize() throws SchedulerConfigException {
+        log.info("Geronimo Quartz thread pool starting with Pool ID "+poolID);
+        geronimoPool = (ThreadPool) geronimoPools.get(poolID);
+        if(geronimoPool == null) {
+            throw new SchedulerConfigException("No Geronimo thread pool available ("+poolID+")!");
+        }
+    }
+
+    public boolean runInThread(Runnable runnable) {
+        try {
+            geronimoPool.execute("Quartz Scheduled Job", runnable);
+        } catch (InterruptedException e) {
+            log.error("Unable to complete schedule job", e);
+            return false;
+        }
+        return true;
+    }
+
+    public void shutdown(boolean b) {
+        geronimoPools.remove(poolID);
+    }
+
+    public String getPoolID() {
+        return poolID;
+    }
+
+    public void setPoolID(String poolID) {
+        this.poolID = poolID;
+    }
+}

Added: geronimo/sandbox/quartz-plugin/dependencies/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/dependencies/pom.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/dependencies/pom.xml (added)
+++ geronimo/sandbox/quartz-plugin/dependencies/pom.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,84 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+  http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>gplugins</groupId>
+        <artifactId>quartz-parent</artifactId>
+        <version>1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <groupId>gplugins</groupId>
+    <artifactId>quartz-plugin-dependencies</artifactId>
+    <name>Quartz Plugins :: Geronimo Dependencies</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-gbean-deployer</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>j2ee-server</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>j2ee-system</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>rmi-naming</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>j2ee-deployer</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+        </dependency>
+        
+        <!-- Required by CARs that are missing POMs -->
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm</artifactId>
+            <version>1.4.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+            <version>1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jsp_2.0_spec</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-client</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-webservices</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+    </dependencies>
+</project>

Added: geronimo/sandbox/quartz-plugin/plugins/console-jetty/src/plan/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/console-jetty/src/plan/geronimo-web.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/console-jetty/src/plan/geronimo-web.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/console-jetty/src/plan/geronimo-web.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <moduleId>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-console-jetty</artifactId>
+            <version>0.2.1</version>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>common</artifactId>
+                <type>jar</type>
+            </dependency>
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>quartz-deployer</artifactId>
+                <type>car</type>
+            </dependency>
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>webconsole-jetty</artifactId>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+        <suppress-default-environment />
+    </environment>
+    <context-root>/quartz-console</context-root>
+    <gbean-ref xmlns="http://geronimo.apache.org/xml/ns/naming-1.1">
+        <ref-name>Scheduler</ref-name>
+        <ref-type>org.gplugins.quartz.QuartzScheduler</ref-type>
+        <pattern>
+            <name>QuartzScheduler</name>
+        </pattern>
+    </gbean-ref>
+    <security-realm-name>geronimo-properties-realm</security-realm-name>
+    <security xmlns="http://geronimo.apache.org/xml/ns/security-1.1">
+        <default-principal>
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
+        </default-principal>
+        <role-mappings>
+            <role role-name="admin">
+                <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"
+                           designated-run-as="true"/>
+            </role>
+        </role-mappings>
+    </security>
+    <gbean xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
+           name="PortletInstaller" class="org.gplugins.common.AddToConsoleGBean">
+        <attribute name="title">Quartz</attribute>
+        <attribute name="webApp">quartz-console</attribute>
+        <attribute name="portlets">[Quartz]</attribute>
+    </gbean>
+</web-app>

Added: geronimo/sandbox/quartz-plugin/plugins/console-tomcat/src/plan/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/console-tomcat/src/plan/geronimo-web.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/console-tomcat/src/plan/geronimo-web.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/console-tomcat/src/plan/geronimo-web.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <moduleId>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-console-tomcat</artifactId>
+            <version>0.2.1</version>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>common</artifactId>
+                <type>jar</type>
+            </dependency>
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>quartz-deployer</artifactId>
+                <type>car</type>
+            </dependency>
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>webconsole-tomcat</artifactId>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+        <suppress-default-environment />
+    </environment>
+    <context-root>/quartz-console</context-root>
+    <gbean-ref xmlns="http://geronimo.apache.org/xml/ns/naming-1.1">
+        <ref-name>Scheduler</ref-name>
+        <ref-type>org.gplugins.quartz.QuartzScheduler</ref-type>
+        <pattern>
+            <name>QuartzScheduler</name>
+        </pattern>
+    </gbean-ref>
+    <security-realm-name>geronimo-properties-realm</security-realm-name>
+    <security xmlns="http://geronimo.apache.org/xml/ns/security-1.1">
+        <default-principal>
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
+        </default-principal>
+        <role-mappings>
+            <role role-name="admin">
+                <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"
+                           designated-run-as="true"/>
+            </role>
+        </role-mappings>
+    </security>
+    <gbean xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
+           name="PortletInstaller" class="org.gplugins.common.AddToConsoleGBean">
+        <attribute name="title">Quartz</attribute>
+        <attribute name="webApp">quartz-console</attribute>
+        <attribute name="portlets">[Quartz]</attribute>
+    </gbean>
+</web-app>

Added: geronimo/sandbox/quartz-plugin/plugins/deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/deployer/pom.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/deployer/pom.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/deployer/pom.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,85 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>gplugins</groupId>
+        <artifactId>quartz-plugins-parent</artifactId>
+        <version>1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>quartz-deployer</artifactId>
+    <packaging>car</packaging>
+    <name>Geronimo Plugin :: Quartz Deployer</name>
+
+    <dependencies>
+        <!-- For build ordering -->
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-deployer-service</artifactId>
+            <scope>provided</scope>
+            <type>jar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-scheduler-service</artifactId>
+            <scope>provided</scope>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-scheduler</artifactId>
+            <scope>provided</scope>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-gbean-deployer</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-server</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-deployer</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${pom.basedir}/src/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <deploymentConfigs>
+                        <deploymentConfig>geronimo/geronimo-gbean-deployer/${geronimo-version}/car</deploymentConfig>
+                        <deploymentConfig>geronimo/j2ee-deployer/${geronimo-version}/car</deploymentConfig>
+                    </deploymentConfigs>
+                    <deployerName>geronimo/geronimo-gbean-deployer/${geronimo-version}/car?j2eeType=Deployer,name=Deployer</deployerName>
+                    <planFileName>geronimo-service.xml</planFileName>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>    
+</project>

Added: geronimo/sandbox/quartz-plugin/plugins/deployer/src/plan/geronimo-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/deployer/src/plan/geronimo-service.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/deployer/src/plan/geronimo-service.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/deployer/src/plan/geronimo-service.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <environment>
+        <moduleId>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-deployer</artifactId>
+            <version>${quartz-plugin-version}</version>
+            <type>car</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>quartz-scheduler</artifactId>
+                <type>car</type>
+            </dependency>
+
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>quartz-deployer-service</artifactId>
+                <version>${pom.version}</version>
+                <type>jar</type>
+            </dependency>
+
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>geronimo-gbean-deployer</artifactId>
+                <type>car</type>
+            </dependency>
+
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>common</artifactId>
+                <type>jar</type>
+            </dependency>
+
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>j2ee-server</artifactId>
+                <type>car</type>
+            </dependency>
+
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>j2ee-deployer</artifactId>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+
+    <gbean name="QuartzDeployer" class="org.gplugins.quartz.deployment.QuartzJobDeployerGBean">
+        <reference name="Repository"/>
+        <attribute name="schedulerName">?name=QuartzScheduler</attribute>
+        <xml-attribute name="defaultEnvironment">
+            <environment>
+                <dependencies>
+                    <dependency>
+                        <groupId>gplugins</groupId>
+                        <artifactId>quartz-scheduler</artifactId>
+                        <type>car</type>
+                    </dependency>
+                </dependencies>
+            </environment>
+        </xml-attribute>
+        <reference name="ResourceReferenceBuilder">
+            <name>ConnectorBuilder</name>
+        </reference>
+        <references name="ServiceReferenceBuilder">
+            <pattern>
+                <name>WebServiceBuilder</name>
+            </pattern>
+            <pattern>
+                <name>UnavailableWebServiceBuilder</name>
+            </pattern>
+        </references>
+        <references name="EJBReferenceBuilder">
+            <pattern>
+                <name>ServerEJBReferenceBuilder</name>
+            </pattern>
+            <pattern>
+                <name>UnavailableServerEJBReferenceBuilder</name>
+            </pattern>
+        </references>
+    </gbean>
+
+    <gbean name="AddQuartzToJ2EEModules" class="org.gplugins.quartz.deployment.AddQuartzToJ2EEModule">
+        <reference name="ConfigurationManager" />
+        <reference name="QuartzJobDeployer" />
+        <reference name="QuartzScheduler" />
+    </gbean>
+</module>
\ No newline at end of file

Added: geronimo/sandbox/quartz-plugin/plugins/deployer/src/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/deployer/src/resources/META-INF/geronimo-plugin.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/deployer/src/resources/META-INF/geronimo-plugin.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/deployer/src/resources/META-INF/geronimo-plugin.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin xmlns="http://geronimo.apache.org/xml/ns/plugins-1.1">
+  <name>Quartz Job Deployer</name>
+  <module-id>gplugins/quartz-deployer/${quartz-plugin-version}/car</module-id>
+  <category>Scheduling</category>
+  <description>This plugin lets you deploy Quartz jobs as Geronimo
+modules.  In other words, you can create a JAR containing the job
+classes, with a Geronimo deployment plan providing the module ID,
+classpath, and execution schedule for the job.  Then you can pack
+that plan in the JAR at META-INF/geronimo-quartz.xml or you can
+keep it outside the JAR.
+
+When you've done this, you can use the normal Geronimo deployment
+tools to deploy, start, stop, and undeploy Quartz jobs.  That
+includes the command-line deploy tool, the console, the Maven
+deployment plugin, etc.  So for example, "java -jar bin/deployer.jar
+deploy my-job.jar" would schedule a job, while "java -jar
+bin/deployer.jar stop MyJob" would suspend it.
+
+This plugin depends on the quartz-scheduler plugin that integrates
+the Quartz scheduler into Geronimo.  There's a separate plugin
+available that allows you to manage the Quartz scheduler and jobs
+with the Geronimo admin console.</description>
+  <url>http://sourceforge.net/projects/gplugins/</url>
+  <author>The Geronimo Plugins development team</author>
+  <license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+  <geronimo-version>1.1.1</geronimo-version>
+  <dependency>geronimo/geronimo-gbean-deployer//car</dependency>
+  <dependency>gplugins/quartz-scheduler/${pom.version}/car</dependency>
+  <dependency>gplugins/quartz-deployer-service/${pom.version}/jar</dependency>
+  <dependency>geronimo/j2ee-server//car</dependency>
+  <dependency>geronimo/j2ee-deployer//car</dependency>
+  <obsoletes>gplugins/quartz-deployer//car</obsoletes>
+  <source-repository>http://geronimoplugins.com/repository/geronimo-1.1/</source-repository>
+  <source-repository>http://www.ibiblio.org/maven2/</source-repository>
+  <config-xml-content>
+    <gbean name="QuartzDeployer" xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1">
+      <attribute name="schedulerName">?name=QuartzScheduler</attribute>
+    </gbean>
+  </config-xml-content>
+</geronimo-plugin>

Added: geronimo/sandbox/quartz-plugin/plugins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/pom.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/pom.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/pom.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,60 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+  http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>gplugins</groupId>
+        <artifactId>quartz-parent</artifactId>
+        <version>1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <groupId>gplugins</groupId>
+    <artifactId>quartz-plugins-parent</artifactId>
+    <packaging>pom</packaging>
+    <name>Quartz Plugins for Geronimo</name>
+
+    <modules>
+        <module>scheduler</module>
+        <module>deployer</module>
+<!--
+        <module>console-jetty</module>
+        <module>console-tomcat</module>
+-->
+    </modules>
+    
+    <dependencies>
+      <dependency>
+        <groupId>gplugins</groupId>
+        <artifactId>quartz-plugin-dependencies</artifactId>
+        <scope>provided</scope>
+      </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-clean-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <phase>validate</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <!-- Install as extention to allow 'car' packaging to be used. -->
+                <extensions>true</extensions>
+            </plugin>
+         </plugins>
+    </build>
+</project>

Added: geronimo/sandbox/quartz-plugin/plugins/scheduler/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/scheduler/pom.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/scheduler/pom.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/scheduler/pom.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,61 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>gplugins</groupId>
+        <artifactId>quartz-plugins-parent</artifactId>
+        <version>1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>quartz-scheduler</artifactId>
+    <packaging>car</packaging>
+    <name>Geronimo Plugin :: Quartz Scheduler</name>
+
+    <dependencies>
+        <!-- For build ordering -->
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-scheduler-service</artifactId>
+            <scope>provided</scope>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-gbean-deployer</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${pom.basedir}/src/resources/META-INF</directory>
+                <includes>
+                    <include>geronimo-plugin.xml</include>
+                </includes>
+                <targetPath>META-INF</targetPath>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <deploymentConfigs>
+                        <deploymentConfig>geronimo/geronimo-gbean-deployer/${geronimo-version}/car</deploymentConfig>
+                    </deploymentConfigs>
+                    <deployerName>geronimo/geronimo-gbean-deployer/${geronimo-version}/car?j2eeType=Deployer,name=Deployer</deployerName>
+                    <planFileName>geronimo-service.xml</planFileName>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>    
+</project>

Added: geronimo/sandbox/quartz-plugin/plugins/scheduler/src/plan/geronimo-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/scheduler/src/plan/geronimo-service.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/scheduler/src/plan/geronimo-service.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/scheduler/src/plan/geronimo-service.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+
+    <environment>
+        <moduleId>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-scheduler</artifactId>
+            <version>${quartz-plugin-version}</version>
+            <type>car</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>gplugins</groupId>
+                <artifactId>quartz-scheduler-service</artifactId>
+                <version>${pom.version}</version>
+                <type>jar</type>
+            </dependency>
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>rmi-naming</artifactId>
+                <type>car</type>
+            </dependency>
+            <dependency>
+                <groupId>opensymphony</groupId>
+                <artifactId>quartz</artifactId>
+                <type>jar</type>
+            </dependency>
+        </dependencies>
+    </environment>
+
+    <gbean name="QuartzScheduler"
+            class="org.gplugins.quartz.QuartzSchedulerGBean">
+        <attribute name="quartzProperties">
+# Override Quartz thread pool to use a Geronimo thread pool
+org.quartz.threadPool.class=org.gplugins.quartz.QuartzThreadPool
+# Support injection of Geronimo DB pools, JMS connections, EJBs, etc.
+# This is required for the Quartz Deployer plugin to work
+org.quartz.scheduler.jobFactory.class=org.gplugins.quartz.QuartzJobFactory
+        </attribute>
+        <reference name="ThreadPool">
+            <name>DefaultThreadPool</name>
+        </reference>
+    </gbean>
+</module>

Added: geronimo/sandbox/quartz-plugin/plugins/scheduler/src/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/plugins/scheduler/src/resources/META-INF/geronimo-plugin.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/plugins/scheduler/src/resources/META-INF/geronimo-plugin.xml (added)
+++ geronimo/sandbox/quartz-plugin/plugins/scheduler/src/resources/META-INF/geronimo-plugin.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<geronimo-plugin xmlns="http://geronimo.apache.org/xml/ns/plugins-1.1">
+  <name>Quartz Scheduler Integration</name>
+  <module-id>gplugins/quartz-scheduler/${quartz-plugin-version}/car</module-id>
+  <category>Scheduling</category>
+  <description>This plugin adds a Quartz scheduler to Geronimo.  It provides
+Geronimo components representing the scheduler and scheduled jobs, which
+can be used by other applications as well as other Geronimo modules.
+
+To use the scheduler from an application, add a gbean-ref to the Geronimo
+deployment plan for the application with ref-type org.gplugins.quartz.QuartzScheduler
+and pattern/name QuartzScheduler.  From the QuartzScheduler, you can access
+a native Quartz scheduler, schedule and delete jobs, pause and resume,
+inspect and edit individual jobs, etc.
+
+Note there are related plugins allowing you to deploy Quartz jobs as a JAR
+with XML plan defining the job schdule, and allowing you to manage the
+Quartz scheduler and jobs with the Geronimo admin console.</description>
+  <url>http://sourceforge.net/projects/gplugins/</url>
+  <author>The Geronimo Plugins development team</author>
+  <license osi-approved="true">BSD -- Apache Software License (ASL) 2.0</license>
+  <geronimo-version>1.1.1</geronimo-version>
+  <dependency>geronimo/rmi-naming//car</dependency>
+  <dependency>gplugins/quartz-scheduler-service/${pom.version}/jar</dependency>
+  <dependency>opensymphony/quartz//jar</dependency>
+  <obsoletes>gplugins/quartz-scheduler//car</obsoletes>
+  <source-repository>http://geronimoplugins.com/repository/geronimo-1.1/</source-repository>
+  <source-repository>http://www.ibiblio.org/maven2/</source-repository>
+  <config-xml-content>
+    <gbean name="QuartzScheduler" xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1">
+      <attribute name="quartzProperties">
+# Override Quartz thread pool to use a Geronimo thread pool
+org.quartz.threadPool.class=org.gplugins.quartz.QuartzThreadPool
+# Support injection of Geronimo DB pools, JMS connections, EJBs, etc.
+# This is required for the Quartz Deployer plugin to work
+org.quartz.scheduler.jobFactory.class=org.gplugins.quartz.QuartzJobFactory
+      </attribute>
+      <reference name="ThreadPool">
+        <!-- The thread pool that will be used -->
+        <pattern>
+          <name>DefaultThreadPool</name>
+        </pattern>
+      </reference>
+    </gbean>
+  </config-xml-content>
+</geronimo-plugin>

Added: geronimo/sandbox/quartz-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/quartz-plugin/pom.xml?rev=660557&view=auto
==============================================================================
--- geronimo/sandbox/quartz-plugin/pom.xml (added)
+++ geronimo/sandbox/quartz-plugin/pom.xml Tue May 27 08:22:56 2008
@@ -0,0 +1,285 @@
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>gplugins</groupId>
+    <artifactId>quartz-parent</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0</version>
+    <name>Quartz Plugin for Geronimo</name>
+    <properties>
+        <quartz-plugin-version>1.0</quartz-plugin-version>
+        <geronimo-version>1.1.1</geronimo-version>
+    </properties>
+    <modules>
+        <module>base/scheduler</module>
+        <module>base/deployer</module>
+        <module>base/console</module>
+        <module>plugins</module>
+        <module>dependencies</module>
+    </modules>
+
+    <repositories>
+        <repository>
+            <id>aaron-people-repository</id>
+            <name>Aaron's People Repository</name>
+            <url>http://people.apache.org/~ammulder/</url>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>apache-snapshots</id>
+            <name>Apache Snapshots Repository</name>
+            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+        </pluginRepository>
+        <pluginRepository>
+            <id>codehaus-snapshots</id>
+            <name>Codehaus Snapshots Repository</name>
+            <url>http://snapshots.repository.codehaus.org/</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+        </pluginRepository>
+    </pluginRepositories>
+
+  <dependencyManagement>
+    <dependencies>
+      <!-- Modules built by this project -->
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-scheduler-service</artifactId>
+            <version>${quartz-plugin-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-deployer-service</artifactId>
+            <version>${quartz-plugin-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-console-service</artifactId>
+            <version>${quartz-plugin-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-plugin-dependencies</artifactId>
+            <version>${quartz-plugin-version}</version>
+        </dependency>
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-scheduler</artifactId>
+            <version>${quartz-plugin-version}</version>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-deployer</artifactId>
+            <version>${quartz-plugin-version}</version>
+            <type>car</type>
+        </dependency>
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>quartz-console</artifactId>
+            <version>${quartz-plugin-version}</version>
+            <type>car</type>
+        </dependency>
+
+      <!-- Modules from other projects -->
+        <dependency>
+            <groupId>gplugins</groupId>
+            <artifactId>common</artifactId>
+            <version>1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-core</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-transaction</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-util</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-webservices</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming-builder</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-schema</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee</artifactId>
+            <version>${geronimo-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>rmi-naming</artifactId>
+            <version>${geronimo-version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j</artifactId>
+            <version>3.0.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>opensymphony</groupId>
+            <artifactId>quartz</artifactId>
+            <version>1.5.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.0.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>standard</artifactId>
+            <version>1.1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>jstl</groupId>
+            <artifactId>jstl</artifactId>
+            <version>1.1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>portlet-api</groupId>
+            <artifactId>portlet-api</artifactId>
+            <version>1.0</version>
+        </dependency>
+
+    </dependencies>
+  </dependencyManagement>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-clean-plugin</artifactId>
+                    <version>2.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.geronimo.plugins</groupId>
+                    <artifactId>car-maven-plugin</artifactId>
+                    <version>1.1</version>
+                    <extensions>true</extensions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+</project>



Mime
View raw message