/*
* Copyright 2007-2010 Sun Microsystems, Inc.
*
* This file is part of Project Darkstar Server.
*
* Project Darkstar Server is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation and
* distributed hereunder to you.
*
* Project Darkstar Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --
*/
package com.sun.sgs.impl.app.profile;
import com.sun.sgs.app.PeriodicTaskHandle;
import com.sun.sgs.app.Task;
import com.sun.sgs.app.TaskManager;
/**
* This is implementation of {@code TaskManager} simply calls its backing
* manager for each manager method.
*/
public class ProfileTaskManager implements TaskManager {
// the task manager that this manager calls through to
private final TaskManager backingManager;
/**
* Creates an instance of <code>ProfileTaskManager</code>.
*
* @param backingManager the <code>TaskManager</code> to call through to
*/
public ProfileTaskManager(TaskManager backingManager) {
this.backingManager = backingManager;
}
/**
* {@inheritDoc}
*/
public void scheduleTask(Task task) {
backingManager.scheduleTask(task);
}
/**
* {@inheritDoc}
*/
public void scheduleTask(Task task, long delay) {
backingManager.scheduleTask(task, delay);
}
/**
* {@inheritDoc}
*/
public PeriodicTaskHandle schedulePeriodicTask(Task task, long delay,
long period)
{
return backingManager.schedulePeriodicTask(task, delay, period);
}
/**
* {@inheritDoc}
*/
public boolean shouldContinue() {
return backingManager.shouldContinue();
}
}