generified FactoryBeans and further Java 5 code style updates

This commit is contained in:
Juergen Hoeller
2009-02-25 00:34:22 +00:00
parent 555fa3b4c8
commit 160249c012
48 changed files with 346 additions and 335 deletions

View File

@@ -53,7 +53,7 @@ import org.springframework.jndi.JndiLocatorSupport;
* @see commonj.timers.TimerListener
*/
public class TimerManagerFactoryBean extends JndiLocatorSupport
implements FactoryBean, InitializingBean, DisposableBean, Lifecycle {
implements FactoryBean<TimerManager>, InitializingBean, DisposableBean, Lifecycle {
private TimerManager timerManager;
@@ -169,11 +169,11 @@ public class TimerManagerFactoryBean extends JndiLocatorSupport
// Implementation of FactoryBean interface
//---------------------------------------------------------------------
public Object getObject() {
public TimerManager getObject() {
return this.timerManager;
}
public Class getObjectType() {
public Class<? extends TimerManager> getObjectType() {
return (this.timerManager != null ? this.timerManager.getClass() : TimerManager.class);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ import org.springframework.util.MethodInvoker;
* @see #setConcurrent
*/
public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethodInvoker
implements FactoryBean, BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, InitializingBean {
implements FactoryBean<Object>, BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, InitializingBean {
private String name;
@@ -171,7 +171,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
String name = (this.name != null ? this.name : this.beanName);
// Consider the concurrent flag to choose between stateful and stateless job.
Class jobClass = (this.concurrent ? (Class) MethodInvokingJob.class : StatefulMethodInvokingJob.class);
Class jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class);
// Build JobDetail instance.
this.jobDetail = new JobDetail(name, this.group, jobClass);
@@ -181,8 +181,8 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
// Register job listener names.
if (this.jobListenerNames != null) {
for (int i = 0; i < this.jobListenerNames.length; i++) {
this.jobDetail.addJobListener(this.jobListenerNames[i]);
for (String jobListenerName : this.jobListenerNames) {
this.jobDetail.addJobListener(jobListenerName);
}
}
@@ -229,7 +229,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
return this.jobDetail;
}
public Class getObjectType() {
public Class<?> getObjectType() {
return JobDetail.class;
}

View File

@@ -87,7 +87,7 @@ import org.springframework.util.CollectionUtils;
* @see org.springframework.transaction.interceptor.TransactionProxyFactoryBean
*/
public class SchedulerFactoryBean extends SchedulerAccessor
implements FactoryBean, BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, Lifecycle {
implements FactoryBean<Scheduler>, BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, Lifecycle {
public static final String PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount";
@@ -665,11 +665,11 @@ public class SchedulerFactoryBean extends SchedulerAccessor
return this.scheduler;
}
public Object getObject() {
public Scheduler getObject() {
return this.scheduler;
}
public Class getObjectType() {
public Class<? extends Scheduler> getObjectType() {
return (this.scheduler != null) ? this.scheduler.getClass() : Scheduler.class;
}

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2006 the original author or authors.
*
* Copyright 2002-2009 the original author or authors.
*
* 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.
@@ -51,7 +51,7 @@ import org.springframework.context.ResourceLoaderAware;
* @see org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
*/
public class FreeMarkerConfigurationFactoryBean extends FreeMarkerConfigurationFactory
implements FactoryBean, InitializingBean, ResourceLoaderAware {
implements FactoryBean<Configuration>, InitializingBean, ResourceLoaderAware {
private Configuration configuration;
@@ -61,11 +61,11 @@ public class FreeMarkerConfigurationFactoryBean extends FreeMarkerConfigurationF
}
public Object getObject() {
public Configuration getObject() {
return this.configuration;
}
public Class getObjectType() {
public Class<? extends Configuration> getObjectType() {
return Configuration.class;
}

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2006 the original author or authors.
*
* Copyright 2002-2009 the original author or authors.
*
* 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.
@@ -48,7 +48,7 @@ import org.springframework.context.ResourceLoaderAware;
* @see org.springframework.web.servlet.view.velocity.VelocityConfigurer
*/
public class VelocityEngineFactoryBean extends VelocityEngineFactory
implements FactoryBean, InitializingBean, ResourceLoaderAware {
implements FactoryBean<VelocityEngine>, InitializingBean, ResourceLoaderAware {
private VelocityEngine velocityEngine;
@@ -58,11 +58,11 @@ public class VelocityEngineFactoryBean extends VelocityEngineFactory
}
public Object getObject() {
public VelocityEngine getObject() {
return this.velocityEngine;
}
public Class getObjectType() {
public Class<? extends VelocityEngine> getObjectType() {
return VelocityEngine.class;
}