This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch ISIS-3271 in repository https://gitbox.apache.org/repos/asf/isis.git
commit e39aeadff6295a0d1f8510707c0cfd971ac8a8f7 Author: Dan Haywood <[email protected]> AuthorDate: Thu Nov 3 17:58:14 2022 +0000 ISIS-3271: removes quartz extension source code --- extensions/core/quartz/adoc/antora.yml | 19 -- .../examples/DemoCausewayInteractionTemplate.java | 44 ----- .../adoc/modules/quartz/examples/DemoJob.java | 62 ------ .../examples/DemoJobQuartzConfigurerModule.java | 87 -------- .../core/quartz/adoc/modules/quartz/nav.adoc | 4 - .../quartz/adoc/modules/quartz/pages/about.adoc | 218 --------------------- .../adoc/modules/quartz/partials/module-nav.adoc | 5 - extensions/core/quartz/impl/pom.xml | 54 ----- .../quartz/CausewayModuleExtQuartzImpl.java | 36 ---- .../quartz/context/JobExecutionData.java | 56 ------ .../spring/AutowiringSpringBeanJobFactory.java | 52 ----- extensions/core/quartz/pom.xml | 39 ---- 12 files changed, 676 deletions(-) diff --git a/extensions/core/quartz/adoc/antora.yml b/extensions/core/quartz/adoc/antora.yml deleted file mode 100644 index 448d819e20..0000000000 --- a/extensions/core/quartz/adoc/antora.yml +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -name: userguide -version: latest diff --git a/extensions/core/quartz/adoc/modules/quartz/examples/DemoCausewayInteractionTemplate.java b/extensions/core/quartz/adoc/modules/quartz/examples/DemoCausewayInteractionTemplate.java deleted file mode 100644 index 4f2b268f7e..0000000000 --- a/extensions/core/quartz/adoc/modules/quartz/examples/DemoCausewayInteractionTemplate.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ -package org.apache.causeway.extensions.quartz.jobs; - - -import java.util.Arrays; - -import javax.inject.Inject; - -import org.quartz.Job; -import org.quartz.JobExecutionContext; - -import org.apache.causeway.applib.services.user.UserService; -import org.apache.causeway.core.config.CausewayConfiguration; -import org.apache.causeway.core.runtime.iactn.template.AbstractCausewayInteractionTemplate; - -import lombok.extern.log4j.Log4j2; - -//tag::class[] -@Log4j2 -class DemoCausewayInteractionTemplate extends AbstractCausewayInteractionTemplate { - @Override - protected void doExecuteWithTransaction(Object context) { - log.debug("Running session via quartz as '{}'", userService.getUser().getName()); - } - @Inject UserService userService; -} -//end::class[] diff --git a/extensions/core/quartz/adoc/modules/quartz/examples/DemoJob.java b/extensions/core/quartz/adoc/modules/quartz/examples/DemoJob.java deleted file mode 100644 index 57aa13958e..0000000000 --- a/extensions/core/quartz/adoc/modules/quartz/examples/DemoJob.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ -package org.apache.causeway.extensions.quartz.jobs; - - -import java.util.Arrays; - -import javax.inject.Inject; - -import org.quartz.Job; -import org.quartz.JobExecutionContext; - -import org.apache.causeway.applib.services.user.UserMemento; -import org.apache.causeway.applib.services.user.UserService; -import org.apache.causeway.core.config.CausewayConfiguration; -import org.apache.causeway.core.runtime.iactn.template.AbstractCausewayInteractionTemplate; -import org.apache.causeway.core.security.authentication.Authentication; -import org.apache.causeway.core.security.authentication.standard.SimpleAuthentication; - -import lombok.val; -import lombok.extern.log4j.Log4j2; - -//tag::class[] -@Log4j2 -public class DemoJob implements Job { - - public void execute(final JobExecutionContext context) { - - final Authentication authentication = newAuthentication(context); - new DemoCausewayInteractionTemplate().execute(authentication, null); - - } - - protected Authentication newAuthentication(JobExecutionContext context) { - - val user = UserMemento.ofNameAndRoleNames( - "causewayModuleExtQuartzDemoUser", - Stream.of("causewayModuleExtQuartzDemoRole")); - - return SimpleAuthentication.ofValid(user); - } - - @Inject CausewayConfiguration causewayConfiguration; - -} -//end::class[] diff --git a/extensions/core/quartz/adoc/modules/quartz/examples/DemoJobQuartzConfigurerModule.java b/extensions/core/quartz/adoc/modules/quartz/examples/DemoJobQuartzConfigurerModule.java deleted file mode 100644 index aefb8245b0..0000000000 --- a/extensions/core/quartz/adoc/modules/quartz/examples/DemoJobQuartzConfigurerModule.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ -package demoapp.web.replay; - -import javax.inject.Inject; - -import org.quartz.JobDetail; -import org.quartz.SimpleTrigger; -import org.quartz.Trigger; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.JobDetailFactoryBean; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; -import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean; -import org.springframework.scheduling.quartz.SpringBeanJobFactory; - -import org.apache.causeway.extensions.quartz.jobs.DemoJob; -import org.apache.causeway.extensions.quartz.spring.AutowiringSpringBeanJobFactory; - -import lombok.val; -import lombok.extern.log4j.Log4j2; - -//tag::class[] -@Configuration -@Log4j2 -public class DemoJobQuartzConfigurerModule { - - @Bean - public JobDetailFactoryBean jobDetail() { - val jobDetailFactory = new JobDetailFactoryBean(); - jobDetailFactory.setJobClass(DemoJob.class); - jobDetailFactory.setDescription("Run demo job"); - jobDetailFactory.setDurability(true); - return jobDetailFactory; - } - - @Bean - public SimpleTriggerFactoryBean trigger(JobDetail job) { - val triggerFactory = new SimpleTriggerFactoryBean(); - triggerFactory.setJobDetail(job); - triggerFactory.setRepeatInterval(10000); // 10seconds - triggerFactory.setStartDelay(15000); // 15 seconds approx boot up time - triggerFactory.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); - return triggerFactory; - } - - @Bean - public SchedulerFactoryBean scheduler(Trigger trigger, JobDetail job, SpringBeanJobFactory springBeanJobFactory) { - val schedulerFactory = new SchedulerFactoryBean(); - // schedulerFactory.setConfigLocation(new ClassPathResource("quartz.properties")); - - schedulerFactory.setJobFactory(springBeanJobFactory); - schedulerFactory.setJobDetails(job); - - schedulerFactory.setTriggers(trigger); - - return schedulerFactory; - } - - @Bean - public SpringBeanJobFactory springBeanJobFactory() { - val jobFactory = new AutowiringSpringBeanJobFactory(); - jobFactory.setApplicationContext(applicationContext); - return jobFactory; - } - - @Inject ApplicationContext applicationContext; -} -//end::class[] - diff --git a/extensions/core/quartz/adoc/modules/quartz/nav.adoc b/extensions/core/quartz/adoc/modules/quartz/nav.adoc deleted file mode 100644 index 35b7262129..0000000000 --- a/extensions/core/quartz/adoc/modules/quartz/nav.adoc +++ /dev/null @@ -1,4 +0,0 @@ - -:Notice: 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 ag [...] - -include::userguide:ROOT:partial$component-nav.adoc[] diff --git a/extensions/core/quartz/adoc/modules/quartz/pages/about.adoc b/extensions/core/quartz/adoc/modules/quartz/pages/about.adoc deleted file mode 100644 index 6d9cb8037d..0000000000 --- a/extensions/core/quartz/adoc/modules/quartz/pages/about.adoc +++ /dev/null @@ -1,218 +0,0 @@ -= Quartz - -:Notice: 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 ag [...] - -[CAUTION] -==== -TODO - v2 I think this module may no longer be necessary; Spring Boot can inject into jobs just fine. -Moving to incubator, pending possible deletion. -==== - -Quartz is (according to their link:https://www.quartz-scheduler.org/[website]) a richly featured, open source job scheduling library that can be integrated within virtually any Java application. - -We can configure Quartz to run ``Job``s using xref:userguide:btb:headless-access.adoc[headless access], for numerous use cases, most commonly involving the polling of work to be performed in the background. -For example: - -* period archiving of data to another system, eg blob images to S3 -* aggregating data -* proactively monitoring health/status - -In simple use cases, Spring Boot's link:https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-quartz[integration] with Quartz can be used without bringing in a dependency on this extension. - -This extension supports the use case where there is a requirement to pass state from one invocation of a ``Job`` to the next. - - -== Simple use case - -The simple use case (that _doesn't_ require a dependency on this extension) is demonstrated in the xref:docs:starters:simpleapp.adoc[SimpleApp] starter app. - -* add the dependency (eg to the webapp module): -+ -[source,xml] -.pom.xml ----- -<dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-quartz</artifactId> -</dependency> - -<dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - <exclusions> - <exclusion> <!--.--> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-logging</artifactId> - </exclusion> - </exclusions> -</dependency> ----- -<.> to avoid Slf4j <--> log4j2 cyclic dependency - -* implement quartz's `Job` interface: -+ -[source,java] -.SampleJob.java ----- -@Component -@RequiredArgsConstructor(onConstructor_ = {@Inject}) -@Slf4j -public class SampleJob implements Job { - - private final InteractionService interactionService; // <.> - private final TransactionalProcessor transactionalProcessor; // <1> - - @Override - public void execute(JobExecutionContext context) throws JobExecutionException { - // ... - } -} ----- -<.> for xref:userguide:btb:headless-access.adoc[headless access] to the domain object model. - -* Set up beans to act as the trigger factory and a job factory: -+ -[source,java] -.QuartzModule.java ----- -@Configuration -@ComponentScan -public class QuartzModule { - - private static final int REPEAT_INTERVAL_SECS = 60; - private static final int START_DELAY_SECS = 20; - private static final int MILLIS_PER_SEC = 1000; - - @Bean - public JobDetailFactoryBean jobDetail() { - val jobDetailFactory = new JobDetailFactoryBean(); - jobDetailFactory.setJobClass(SampleJob.class); - jobDetailFactory.setDescription("Invoke Sample Job service..."); - jobDetailFactory.setDurability(true); - return jobDetailFactory; - } - - @Bean - public SimpleTriggerFactoryBean trigger(JobDetail job) { - val trigger = new SimpleTriggerFactoryBean(); - trigger.setJobDetail(job); - trigger.setStartDelay(START_DELAY_SECS * MILLIS_PER_SEC); - trigger.setRepeatInterval(REPEAT_INTERVAL_SECS * MILLIS_PER_SEC); - trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); - return trigger; - } -} ----- - -* include the `QuartzModule` in the application's top-level `AppManifest`. - - - -== More complex use cases - -This _Quartz_ module is intended to support a couple of slightly more advanced use cases. - -If either are used: - -* add an entry to the `pom.xml` `dependencyManagement` section: -+ -[source,xml] ----- -<dependencyManagement> - <dependencies> - <dependency> - <groupId>org.apache.causeway.extensions</groupId> - <artifactId>causeway-extensions-quartz</artifactId> - <scope>import</scope> - <type>pom</type> - <version>{page-causewayrel}</version> - </dependency> - </dependencies> -</dependencyManagement> ----- - -* add the following dependency: -+ -[source,xml] ----- -<dependency> - <groupId>org.apache.causeway.extensions</groupId> - <artifactId>causeway-extensions-quartz-impl</artifactId> -</dependency> ----- - -* import the extension's module in your application's top-level `AppManifest`: -+ -[source,java] ----- -@Configuration -@Import({ - // ... - CausewayModuleExtQuartzImpl.class, -}) -// ... -public class AppManifest { - // ... -} ----- - -=== Preserving job state - -Sometimes there is a requirement to pass state from one invocation of a job to another. -For example, if some external service is unavailable, then we wouldn't necessarily want to a periodic job to keep trying to connect, creating noise in the logs. - -To support this use case, this extension provides the xref:refguide:extensions:index/quartz/context/JobExecutionData.adoc[] class, which simplifies the API of Quartz's job data map. - - - -=== Injecting domain services into jobs - -If we want to inject domain services into the Quartz `Job`, then we should define a number of additional beans. -These instantiate xref:refguide:extensions:index/quartz/spring/AutowiringSpringBeanJobFactory.adoc[] as the job factory: - -[source,java] -.QuartzModule.java ----- -import org.apache.causeway.extensions.quartz.spring.AutowiringSpringBeanJobFactory; - -@Configuration -@ComponentScan -public class QuartzModule { - - // ... - - @Bean - public SpringBeanJobFactory springBeanJobFactory() { - val jobFactory = new AutowiringSpringBeanJobFactory(); // <.> - jobFactory.setApplicationContext(applicationContext); - return jobFactory; - } - - @Bean - public SchedulerFactoryBean scheduler( - final Trigger trigger, - final JobDetail jobDetail, - final SpringBeanJobFactory sbjf) { - val schedulerFactory = new SchedulerFactoryBean(); - - schedulerFactory.setJobFactory(sbjf); - schedulerFactory.setJobDetails(jobDetail); - schedulerFactory.setTriggers(trigger); - - return schedulerFactory; - } - - @Bean - public Scheduler scheduler( - final Trigger trigger, - final JobDetail job, - final SchedulerFactoryBean factory) - throws SchedulerException { - val scheduler = factory.getScheduler(); - scheduler.start(); - return scheduler; - } ----- -<.> as provided by this extension - - diff --git a/extensions/core/quartz/adoc/modules/quartz/partials/module-nav.adoc b/extensions/core/quartz/adoc/modules/quartz/partials/module-nav.adoc deleted file mode 100644 index 69152125ba..0000000000 --- a/extensions/core/quartz/adoc/modules/quartz/partials/module-nav.adoc +++ /dev/null @@ -1,5 +0,0 @@ - - -** xref:userguide:quartz:about.adoc[Quartz] - - diff --git a/extensions/core/quartz/impl/pom.xml b/extensions/core/quartz/impl/pom.xml deleted file mode 100644 index 17606a273e..0000000000 --- a/extensions/core/quartz/impl/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- 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. --> -<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>org.apache.causeway.extensions</groupId> - <artifactId>causeway-extensions-quartz</artifactId> - <version>2.0.0-SNAPSHOT</version> - </parent> - - <artifactId>causeway-extensions-quartz-impl</artifactId> - <name>Apache Causeway Ext - Quartz Impl</name> - - <properties> - <jar-plugin.automaticModuleName>org.apache.causeway.extensions.quartz.impl</jar-plugin.automaticModuleName> - <git-plugin.propertiesDir>org/apache/causeway/extensions/quartz/impl</git-plugin.propertiesDir> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.causeway.core</groupId> - <artifactId>causeway-core-config</artifactId> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-quartz</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.causeway.core</groupId> - <artifactId>causeway-core-security</artifactId> - </dependency> - - </dependencies> - -</project> diff --git a/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/CausewayModuleExtQuartzImpl.java b/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/CausewayModuleExtQuartzImpl.java deleted file mode 100644 index f0f7e320c1..0000000000 --- a/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/CausewayModuleExtQuartzImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ -package org.apache.causeway.extensions.quartz; - -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; - -/** - * @since 2.0 {@index} - */ -@Configuration -@Import({ - // @Configuration's - - // @DomainService's - -}) - -public class CausewayModuleExtQuartzImpl { -} diff --git a/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/context/JobExecutionData.java b/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/context/JobExecutionData.java deleted file mode 100644 index 4a011df094..0000000000 --- a/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/context/JobExecutionData.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ -package org.apache.causeway.extensions.quartz.context; - -import org.quartz.JobExecutionContext; - -import lombok.RequiredArgsConstructor; -import lombok.extern.log4j.Log4j2; - -/** - * Requires that the job is annotated with the {@link org.quartz.PersistJobDataAfterExecution} annotation. - * - * @since 2.0 {@index} - */ -@Log4j2 -@RequiredArgsConstructor -public class JobExecutionData { - - private final JobExecutionContext context; - - /** - * Lookup property from the job detail. - */ - public String getString(String key, final String defaultValue) { - try { - String v = context.getJobDetail().getJobDataMap().getString(key); - return v != null ? v : defaultValue; - } catch (Exception e) { - return defaultValue; - } - } - /** - * Save key into the job detail obtained from context. - */ - public void setString(String key, String value) { - context.getJobDetail().getJobDataMap().put(key, value); - } - -} - diff --git a/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/spring/AutowiringSpringBeanJobFactory.java b/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/spring/AutowiringSpringBeanJobFactory.java deleted file mode 100644 index dcf02128a3..0000000000 --- a/extensions/core/quartz/impl/src/main/java/org/apache/causeway/extensions/quartz/spring/AutowiringSpringBeanJobFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ -package org.apache.causeway.extensions.quartz.spring; - -import org.quartz.spi.TriggerFiredBundle; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.scheduling.quartz.SpringBeanJobFactory; - -/** - * @since 2.0 {@index} - */ -public class AutowiringSpringBeanJobFactory - extends SpringBeanJobFactory - implements ApplicationContextAware { - - private transient AutowireCapableBeanFactory beanFactory; - - @Override - public void setApplicationContext( - final ApplicationContext context) { - beanFactory = context.getAutowireCapableBeanFactory(); - } - - @Override - protected Object createJobInstance( - final TriggerFiredBundle bundle) - throws Exception { - final Object job = super.createJobInstance(bundle); - beanFactory.autowireBean(job); - return job; - } - - -} diff --git a/extensions/core/quartz/pom.xml b/extensions/core/quartz/pom.xml deleted file mode 100644 index 928bbf0748..0000000000 --- a/extensions/core/quartz/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- 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. --> -<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>org.apache.causeway.extensions</groupId> - <artifactId>causeway-extensions</artifactId> - <version>2.0.0-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - - <artifactId>causeway-extensions-quartz</artifactId> - <name>Apache Causeway Ext - Quartz</name> - <description>Integrates Quartz</description> - - <packaging>pom</packaging> - - <dependencyManagement> - <dependencies> - </dependencies> - </dependencyManagement> - - <modules> - <module>impl</module> - </modules> - -</project>
