summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchanghyun1.lee <changhyun1.lee@samsung.com>2014-07-03 14:40:19 +0900
committerchanghyun1.lee <changhyun1.lee@samsung.com>2014-07-03 14:40:19 +0900
commitb3d2f147744ebc966b6c8ec4ed190e6450434b9b (patch)
treeadc2de58445d81e394ee570003dc50db658c48b4
parentcd8b1a02e2951abe392b88880e499859b15b596d (diff)
downloadcommon-eplugin-b3d2f147744ebc966b6c8ec4ed190e6450434b9b.tar.gz
common-eplugin-b3d2f147744ebc966b6c8ec4ed190e6450434b9b.tar.bz2
common-eplugin-b3d2f147744ebc966b6c8ec4ed190e6450434b9b.zip
COMMON: Removed unused class
- Delete a DefferedTaskManager.java Change-Id: I2e9a3c723dc47f08bb76eebb0b0fd27796637df8 Signed-off-by: changhyun1.lee <changhyun1.lee@samsung.com>
-rwxr-xr-xorg.tizen.common/src/org/tizen/common/util/DefferedTaskManager.java206
1 files changed, 0 insertions, 206 deletions
diff --git a/org.tizen.common/src/org/tizen/common/util/DefferedTaskManager.java b/org.tizen.common/src/org/tizen/common/util/DefferedTaskManager.java
deleted file mode 100755
index cf212229d..000000000
--- a/org.tizen.common/src/org/tizen/common/util/DefferedTaskManager.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
-* Common
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact:
-* BonYong Lee <bonyong.lee@samsung.com>
-*
-* 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.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-* Contributors:
-* - S-Core Co., Ltd
-*
-*/
-package org.tizen.common.util;
-
-import static org.tizen.common.util.Assert.notNull;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * DefferedTaskManager.
- *
- * Object to manage a deffered task.
- *
- * When {@code #tick()} is called, it is scheduled.
- *
- * If no interaction during idle time, run task.
- *
- * @author BonYong Lee{@literal <bonyong.lee@samsung.com>} (S-Core)
- */
-public class
-DefferedTaskManager
-{
- /**
- * Default value for idle time
- *
- * 3 seconds
- */
- protected static final long DEFAULT_IDLE_TIME = 3 * 1000;
-
- /**
- * Logger for this class
- */
- protected final Logger logger = LoggerFactory.getLogger( getClass() );
-
- /**
- * Idle time
- */
- protected long idleTime;
-
- /**
- * last scheduled time
- */
- protected long scheduledTime = DEFAULT_IDLE_TIME;
-
- /**
- * timer for schedule
- */
- protected Timer timer = null;
-
- /**
- * Task
- */
- protected final Runnable task;
-
- /**
- * Constructor with task
- *
- * @param task task to run
- *
- * @see #DefferedTaskManager(Runnable, long)
- */
- public
- DefferedTaskManager(
- final Runnable task
- )
- {
- this( task, DEFAULT_IDLE_TIME );
- }
-
- /**
- * Constructor with task and ide time
- *
- * @param task taask to run
- * @param idleTime time to waiting
- *
- * @see #setIdleTime(long)
- */
- public
- DefferedTaskManager(
- final Runnable task,
- final long idleTime
- )
- {
- // Fast-fail
- notNull( task );
- this.task = task;
- this.idleTime = idleTime;
- logger.debug( "Idle time: {}", idleTime );
- }
-
- /**
- * Return idle time for deffering
- *
- * @return idle time
- */
- synchronized public
- long
- getIdleTime()
- {
- return this.idleTime;
- }
-
- /**
- * Set idle time for deffering
- *
- * @param idleTime time to wait
- */
- synchronized public
- void
- setIdleTime( final long idleTime )
- {
- this.idleTime = idleTime;
-
- if ( null != this.timer )
- {
- schedule( this.idleTime + this.scheduledTime - System.currentTimeMillis() );
- }
-
- }
-
- /**
- * Schedule to run task after {@code delay}
- *
- * @param delay delay time in milliseconds
- */
- synchronized public
- void
- schedule( long delay )
- {
- cancel();
- if ( 0 < delay )
- {
- this.timer = new Timer();
- scheduledTime = System.currentTimeMillis();
- this.timer.schedule( new TimerTask()
- {
-
- @Override
- public void run()
- {
- task.run();
- logger.debug( "{} was run", task );
- }
- }, delay );
- logger.debug( "{} will be run after {}", task, delay );
- }
- else
- {
- task.run();
- logger.debug( "{} was run", task );
- }
-
- }
-
- /**
- * Notify any change
- */
- public
- void
- tick()
- {
- schedule( this.idleTime );
- }
-
- /**
- * Cancel scheduled task
- */
- synchronized public
- void
- cancel()
- {
- if ( null != timer )
- {
- timer.cancel();
- timer = null;
- logger.debug( "{} canceled", task );
- }
- }
-
-}