You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/16 11:41:30 UTC
[shardingsphere-elasticjob] branch master updated: Revert #1088
(#1090)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git
The following commit(s) were added to refs/heads/master by this push:
new 353a237 Revert #1088 (#1090)
353a237 is described below
commit 353a23714bef06f13c23a1d6eec14e6d91714c0c
Author: Liang Zhang <te...@163.com>
AuthorDate: Thu Jul 16 19:41:23 2020 +0800
Revert #1088 (#1090)
---
.../lite/internal/schedule/JobScheduler.java | 6 +--
.../elasticjob/lite/internal/util/ProxyUtils.java | 50 ----------------------
2 files changed, 2 insertions(+), 54 deletions(-)
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java
index 959148c..12e7229 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java
@@ -20,13 +20,12 @@ package org.apache.shardingsphere.elasticjob.lite.internal.schedule;
import lombok.Getter;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener;
import org.apache.shardingsphere.elasticjob.api.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance;
+import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener;
import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService;
import org.apache.shardingsphere.elasticjob.lite.internal.setup.SetUpFacade;
-import org.apache.shardingsphere.elasticjob.lite.internal.util.ProxyUtils;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.quartz.JobBuilder;
@@ -90,8 +89,7 @@ public final class JobScheduler {
this.tracingConfig = tracingConfig;
setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), this.elasticJobListeners);
schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName());
- String jobClassName = ProxyUtils.isCglibProxy(elasticJob) ? ProxyUtils.getTargetClass(elasticJob).getName() : elasticJob.getClass().getName();
- this.jobConfig = setUpFacade.setUpJobConfiguration(jobClassName, jobConfig);
+ this.jobConfig = setUpFacade.setUpJobConfiguration(elasticJob.getClass().getName(), jobConfig);
setGuaranteeServiceForElasticJobListeners(regCenter, this.elasticJobListeners);
jobScheduleController = createJobScheduleController();
}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/ProxyUtils.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/ProxyUtils.java
deleted file mode 100644
index 1ca8838..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/ProxyUtils.java
+++ /dev/null
@@ -1,50 +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.shardingsphere.elasticjob.lite.internal.util;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-/**
- * Aop target Utility.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ProxyUtils {
-
- /**
- * Get target class.
- *
- * @param proxy proxy object
- * @return target class
- */
- public static Class<?> getTargetClass(final Object proxy) {
- if (!isCglibProxy(proxy)) {
- return proxy.getClass();
- }
- return proxy.getClass().getSuperclass();
- }
-
- /**
- * Check whether the given object is a CGLIB proxy.
- * @param object job object
- * @return if the object is cglib proxy
- */
- public static boolean isCglibProxy(final Object object) {
- return object.getClass().getName().contains("$$EnhancerBySpringCGLIB");
- }
-}