Skip to content

Commit

Permalink
add final for every classes
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Apr 6, 2017
1 parent 7aabb80 commit ca78fd4
Show file tree
Hide file tree
Showing 96 changed files with 138 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @author zhangliang
*/
@RequiredArgsConstructor
public class CloudJobFacade implements JobFacade {
public final class CloudJobFacade implements JobFacade {

private final ShardingContexts shardingContexts;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author caohao
*/
public class JobConfigurationContext implements JobRootConfiguration {
public final class JobConfigurationContext implements JobRootConfiguration {

private static final String IGNORE_CRON = "ignoredCron";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @author caohao
*/
@RequiredArgsConstructor
public class CloudAppConfigurationService {
public final class CloudAppConfigurationService {

private final CoordinatorRegistryCenter regCenter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @author zhangliang
* @author caohao
*/
public class CloudJobConfigurationListener implements TreeCacheListener {
public final class CloudJobConfigurationListener implements TreeCacheListener {

private final CoordinatorRegistryCenter regCenter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @author zhangliang
*/
@RequiredArgsConstructor
public class CloudJobConfigurationService {
public final class CloudJobConfigurationService {

private final CoordinatorRegistryCenter regCenter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @author gaohongtao
*/
@RequiredArgsConstructor
public class FrameworkIDService {
public final class FrameworkIDService {

private final CoordinatorRegistryCenter regCenter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author gaohongtao
*/
public class HANode {
public final class HANode {

/**
* HA根节点.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @author caohao
*/
public class SchedulerElectionCandidate implements ElectionCandidate {
public final class SchedulerElectionCandidate implements ElectionCandidate {

private final CoordinatorRegistryCenter regCenter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @author caohao
*/
@Slf4j
public class FacadeService {
public final class FacadeService {

private final CloudAppConfigurationService appConfigService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @author zhangliang
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class LeasesQueue {
public final class LeasesQueue {

private static final LeasesQueue INSTANCE = new LeasesQueue();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
*/
@RequiredArgsConstructor
@Slf4j
public class TaskLaunchScheduledService extends AbstractScheduledService {
public final class TaskLaunchScheduledService extends AbstractScheduledService {

private final SchedulerDriver schedulerDriver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* @author zhangliang
*/
@Slf4j
public class ProducerManager {
public final class ProducerManager {

private final CloudAppConfigurationService appConfigService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author caohao
* @author zhangliang
*/
class TransientProducerRepository {
final class TransientProducerRepository {

private final ConcurrentHashMap<JobKey, List<String>> cronTasks = new ConcurrentHashMap<>(256, 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*
* @author caohao
*/
class TransientProducerScheduler {
final class TransientProducerScheduler {

private final TransientProducerRepository repository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @author caohao
*/
public class RestfulService {
public final class RestfulService {

private static final String CONSOLE_PATH = "console";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* @author zhangliang
*/
@Slf4j
public class FailoverService {
public final class FailoverService {

private final BootstrapEnvironment env = BootstrapEnvironment.getInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @author liguangyun
*/
@Slf4j
public class ReadyService {
public final class ReadyService {

private final BootstrapEnvironment env = BootstrapEnvironment.getInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @author zhangliang
*/
@RequiredArgsConstructor
public class RunningService {
public final class RunningService {

private static final int TASK_INITIAL_SIZE = 1024;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*/
@Slf4j
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class StatisticManager {
public final class StatisticManager {

private static volatile StatisticManager instance;

Expand Down Expand Up @@ -286,11 +286,10 @@ public List<JobRegisterStatistics> findJobRegisterStatisticsSinceOnline() {

private Date getOnlineDate() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date onlineDate = null;
try {
onlineDate = formatter.parse("2016-12-16");
return formatter.parse("2016-12-16");
} catch (final ParseException ex) {
return null;
}
return onlineDate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,24 @@

package com.dangdang.ddframe.job.cloud.scheduler.statistics;

import java.util.Map;
import java.util.Properties;

import com.dangdang.ddframe.job.cloud.scheduler.statistics.job.StatisticJob;
import com.dangdang.ddframe.job.exception.JobStatisticException;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.plugins.management.ShutdownHookPlugin;
import org.quartz.simpl.SimpleThreadPool;

import com.dangdang.ddframe.job.cloud.scheduler.statistics.job.StatisticJob;
import com.dangdang.ddframe.job.exception.JobStatisticException;
import java.util.Map;
import java.util.Properties;

/**
* 统计作业调度器.
*
* @author liguangyun
*/
class StatisticsScheduler {
final class StatisticsScheduler {

private final StdSchedulerFactory factory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author liguangyun
*/
public class TaskResultMetaData {
public final class TaskResultMetaData {

private final AtomicInteger successCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@Setter
@NoArgsConstructor
@Slf4j
public class JobRunningStatisticJob extends AbstractStatisticJob {
public final class JobRunningStatisticJob extends AbstractStatisticJob {

private RunningService runningService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class RegisteredJobStatisticJob extends AbstractStatisticJob {
public final class RegisteredJobStatisticJob extends AbstractStatisticJob {

private CloudJobConfigurationService configurationService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,28 @@

package com.dangdang.ddframe.job.cloud.scheduler.statistics.job;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.quartz.CronScheduleBuilder;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;

import com.dangdang.ddframe.job.cloud.scheduler.statistics.TaskResultMetaData;
import com.dangdang.ddframe.job.cloud.scheduler.statistics.util.StatisticTimeUtils;
import com.dangdang.ddframe.job.statistics.StatisticInterval;
import com.dangdang.ddframe.job.statistics.rdb.StatisticRdbRepository;
import com.dangdang.ddframe.job.statistics.type.task.TaskResultStatistics;
import com.google.common.base.Optional;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.quartz.CronScheduleBuilder;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* 任务运行结果统计作业.
Expand All @@ -51,7 +49,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class TaskResultStatisticJob extends AbstractStatisticJob {
public final class TaskResultStatisticJob extends AbstractStatisticJob {

private StatisticInterval statisticInterval;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author caohao
*/
@Slf4j
public class JobEventBus {
public final class JobEventBus {

private final JobEventConfiguration jobEventConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author zhangliang
*/
public class JobEventListenerConfigurationException extends Exception {
public final class JobEventListenerConfigurationException extends Exception {

private static final long serialVersionUID = 4069519372148227761L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
@RequiredArgsConstructor
@Getter
public class JobEventRdbConfiguration extends JobEventRdbIdentity implements JobEventConfiguration, Serializable {
public final class JobEventRdbConfiguration extends JobEventRdbIdentity implements JobEventConfiguration, Serializable {

private static final long serialVersionUID = 3344410699286435226L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*/
@RequiredArgsConstructor
@Slf4j
public class JobEventRdbSearch {
public final class JobEventRdbSearch {

private static final String TABLE_JOB_EXECUTION_LOG = "JOB_EXECUTION_LOG";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @author caohao
*/
@Slf4j
class JobEventRdbStorage {
final class JobEventRdbStorage {

private static final String TABLE_JOB_EXECUTION_LOG = "JOB_EXECUTION_LOG";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@RequiredArgsConstructor
@AllArgsConstructor
@Getter
public class JobExecutionEvent implements JobEvent {
public final class JobExecutionEvent implements JobEvent {

private String id = UUID.randomUUID().toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@AllArgsConstructor
@Getter
@ToString(of = "plainText")
public class JobExecutionEventThrowable {
public final class JobExecutionEventThrowable {

private final Throwable throwable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@RequiredArgsConstructor
@AllArgsConstructor
@Getter
public class JobStatusTraceEvent implements JobEvent {
public final class JobStatusTraceEvent implements JobEvent {

private String id = UUID.randomUUID().toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author caohao
*/
public class AppConfigurationException extends RuntimeException {
public final class AppConfigurationException extends RuntimeException {

private static final long serialVersionUID = -1466479389299512371L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author caohao
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ExceptionUtil {
public final class ExceptionUtil {

public static String transform(final Throwable cause) {
if (null == cause) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author zhangliang
*/
public class JobConfigurationException extends RuntimeException {
public final class JobConfigurationException extends RuntimeException {

private static final long serialVersionUID = 3244988974343209468L;

Expand Down
Loading

0 comments on commit ca78fd4

Please sign in to comment.