forked from StarOpenSource/Engine
Add SubsystemMainClass
This commit is contained in:
parent
78154962ef
commit
e6fa60e287
2 changed files with 53 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
|
||||
package de.staropensource.sosengine.base;
|
||||
|
||||
import de.staropensource.sosengine.base.classes.SubsystemMainClass;
|
||||
import de.staropensource.sosengine.base.data.info.EngineInformation;
|
||||
import de.staropensource.sosengine.base.events.EngineShutdownEvent;
|
||||
import de.staropensource.sosengine.base.events.internal.InternalEngineShutdownEvent;
|
||||
|
@ -42,7 +43,7 @@ import java.util.Map;
|
|||
* @since 1-alpha0
|
||||
*/
|
||||
@SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" })
|
||||
public final class Engine {
|
||||
public final class Engine implements SubsystemMainClass {
|
||||
/**
|
||||
* Instance.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* STAROPENSOURCE ENGINE SOURCE FILE
|
||||
* Copyright (c) 2024 The StarOpenSource Engine Contributors
|
||||
* Licensed under the GNU Affero General Public License v3
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.staropensource.sosengine.base.classes;
|
||||
|
||||
import de.staropensource.sosengine.base.Engine;
|
||||
import de.staropensource.sosengine.base.annotations.EventListener;
|
||||
import de.staropensource.sosengine.base.events.internal.InternalEngineShutdownEvent;
|
||||
import de.staropensource.sosengine.base.logging.LoggerInstance;
|
||||
|
||||
/**
|
||||
* The interface for engine subsystem main classes.
|
||||
*
|
||||
* @since 1-alpha0
|
||||
*/
|
||||
@SuppressWarnings({ "unused" })
|
||||
public interface SubsystemMainClass {
|
||||
/**
|
||||
* Logger instance.
|
||||
*
|
||||
* @see LoggerInstance
|
||||
* @since 1-alpha0
|
||||
*/
|
||||
LoggerInstance logger = null;
|
||||
|
||||
/**
|
||||
* Called when the engine shuts down.
|
||||
*
|
||||
* @see Engine#shutdown()
|
||||
* @see Engine#shutdown(int)
|
||||
* @since 1-alpha0
|
||||
*/
|
||||
@EventListener(event = InternalEngineShutdownEvent.class)
|
||||
static void shutdown() {}
|
||||
}
|
Loading…
Reference in a new issue