
org.ow2.bonita.runtime.event.WebTokensCleaner Maven / Gradle / Ivy
The newest version!
/**
* Copyright (C) 2013 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library 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 Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.ow2.bonita.runtime.event;
/**
* Clean expired web tokens
* @author Elias Ricken de Medeiros
*
*/
public class WebTokensCleaner extends EventExecutorThread {
private final int cleanWebTokensInterval;
WebTokensCleaner(final EventExecutor executor, final String name, final int cleanWebTokensInterval) {
super(executor, name);
this.cleanWebTokensInterval = cleanWebTokensInterval;
}
@Override
protected void activate() {
// nothing to do
}
@Override
protected void execute() throws InterruptedException {
getCommandService().execute(new CleanExpiredWebTokens());
}
@Override
protected String getJobExecutorName() {
return "Web tokens cleaner";
}
@Override
protected Long getNextDueDate() {
return System.currentTimeMillis() + cleanWebTokensInterval;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy