File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -335,35 +335,33 @@ public synchronized void export() {
335335 }
336336
337337 if (shouldDelay ()) {
338- delayExportExecutor .schedule (this ::doExport , delay , TimeUnit .MILLISECONDS );
338+ delayExportExecutor .schedule (this ::doExport , getDelay () , TimeUnit .MILLISECONDS );
339339 } else {
340340 doExport ();
341341 }
342342 }
343343
344344 private boolean shouldExport () {
345- Boolean shouldExport = getExport ();
346- if (shouldExport == null && provider != null ) {
347- shouldExport = provider .getExport ();
348- }
349-
345+ Boolean export = getExport ();
350346 // default value is true
351- if (shouldExport == null ) {
352- return true ;
353- }
347+ return export == null ? true : export ;
348+ }
354349
355- return shouldExport ;
350+ @ Override
351+ public Boolean getExport () {
352+ return (export == null && provider != null ) ? provider .getExport () : export ;
356353 }
357354
358355 private boolean shouldDelay () {
359356 Integer delay = getDelay ();
360- if (delay == null && provider != null ) {
361- delay = provider .getDelay ();
362- }
363- this .delay = delay ;
364357 return delay != null && delay > 0 ;
365358 }
366359
360+ @ Override
361+ public Integer getDelay () {
362+ return (delay == null && provider != null ) ? provider .getDelay () : delay ;
363+ }
364+
367365 protected synchronized void doExport () {
368366 if (unexported ) {
369367 throw new IllegalStateException ("The service " + interfaceClass .getName () + " has already unexported!" );
You can’t perform that action at this time.
0 commit comments