Search in sources :

Example 1 with SystemTaskJob

use of org.exist.scheduler.SystemTaskJob in project exist by eXist-db.

the class LocalDatabaseInstanceManager method shutdown.

@Override
public void shutdown(final long delay) throws XMLDBException {
    if (!user.hasDbaRole()) {
        throw new XMLDBException(ErrorCodes.PERMISSION_DENIED, "only users in group dba may shut down the database");
    }
    final SystemTaskJob shutdownJob = new SystemTaskJobImpl("xmldb:local-api.shutdown", new ShutdownTask());
    brokerPool.getScheduler().createPeriodicJob(0, shutdownJob, delay, new Properties(), 0);
}
Also used : SystemTaskJob(org.exist.scheduler.SystemTaskJob) ShutdownTask(org.exist.scheduler.impl.ShutdownTask) XMLDBException(org.xmldb.api.base.XMLDBException) SystemTaskJobImpl(org.exist.scheduler.impl.SystemTaskJobImpl) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)1 SystemTaskJob (org.exist.scheduler.SystemTaskJob)1 ShutdownTask (org.exist.scheduler.impl.ShutdownTask)1 SystemTaskJobImpl (org.exist.scheduler.impl.SystemTaskJobImpl)1 XMLDBException (org.xmldb.api.base.XMLDBException)1