Skip to content
Permalink
Browse files
import redback components sources
  • Loading branch information
olamy committed Apr 6, 2012
0 parents commit 1d044533376007470f0688bed71d767452fceafd
Showing 12 changed files with 1,509 additions and 0 deletions.
91 pom.xml
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<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">
<parent>
<groupId>org.codehaus.redback.components</groupId>
<artifactId>redback-components</artifactId>
<version>1.3-SNAPSHOT</version>
<relativePath>../redback-components-parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-quartz</artifactId>
<name>Spring Quartz Component</name>
<version>1.1-SNAPSHOT</version>

<url>http://redback.codehaus.org/components/${project.artifactId}</url>

<distributionManagement>
<site>
<id>codehaus.org</id>
<url>dav:https://dav.codehaus.org/redback/components/${project.artifactId}</url>
</site>
</distributionManagement>

<scm>
<connection>scm:svn:https://svn.codehaus.org/redback/components/trunk/spring-quartz</connection>
<developerConnection>scm:svn:https://svn.codehaus.org/redback/components/trunk/spring-quartz</developerConnection>
<url>http://fisheye.codehaus.org/browse/redback/components/trunk/spring-quartz</url>
</scm>

<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.1.1</version>
<exclusions>
<exclusion>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkedProcessTimeoutInSeconds>60</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,96 @@
package org.codehaus.redback.components.scheduler;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/

import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.InterruptableJob;
import org.quartz.UnableToInterruptJobException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Base class from which all <code>Job</code>s running in the
* scheduler should be derived from if they want access to the
* ServiceBroker.
*
* @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
* @version $Id$
*/
public abstract class AbstractJob
implements InterruptableJob
{

private Logger log = LoggerFactory.getLogger( getClass() );

/** JobDataMap tag for the job's logger. */
public static final String LOGGER = "JOB_LOGGER";

/** JobDataMap tag for the job's context. */
public static final String CONTEXT = "JOB_CONTEXT";

/** JobDataMap tag for the job's service broker. */
public static final String SERVICE_MANAGER = "JOB_SERVICE_MANAGER";

/** JobDataMap tag for the job's configuration. */
public static final String EXECUTION_CONFIGURATION = "JOB_EXECUTION_CONFIGURATION";

/** Job Data Map */
private JobDataMap jobDataMap;

private boolean interrupted;

/** Set Job Data Map */
public void setJobDataMap(JobDataMap jobDataMap)
{
this.jobDataMap = jobDataMap;
}

/** Get Job Data Map */
public JobDataMap getJobDataMap()
{
return jobDataMap;
}

/** Get the Logger. */
public Logger getLogger()
{
return (Logger) getJobDataMap().get(LOGGER);
}



/** Execute the Job. */
public abstract void execute(JobExecutionContext context)
throws JobExecutionException;

public boolean isInterrupted()
{
return interrupted;
}

public void interrupt()
throws UnableToInterruptJobException
{
interrupted = true;
}
}

0 comments on commit 1d04453

Please sign in to comment.