org.nervousync.launcher.StartupLauncher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils-jdk11 Show documentation
Show all versions of utils-jdk11 Show documentation
Java utility collections, development by Nervousync Studio (NSYC)
/*
* Licensed to the Nervousync Studio (NSYC) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.nervousync.launcher;
/**
* Interface class for startup launcher
*
* Launcher class must implement current interface and add annotation
* org.nervousync.annotations.launcher.Launcher at launcher class.
* StartupManager will load launcher instance by Java SPI, and invoke startup method at system start,
* invoke destroy method at system shutdown.
* Users can add parameter value (type: int) at annotation org.nervousync.annotations.launcher.Launcher
* to move the sort of launcher execute, sort type: DESC
*
* 启动器接口
*
* 启动器实现类必须实现当前接口并添加注解org.nervousync.annotations.launcher.Launcher到启动器实现类上。
* 启动管理器会使用Java的SPI机制自动加载所有启动器实例,启动管理器会在系统启动时调用startup方法,在系统退出时调用destroy方法。
* 用户可以通过设置一个int类型的参数值在注解org.nervousync.annotations.launcher.Launcher上,
* 用于调整启动器的执行顺序,排序方式为:倒叙
*
*.0
* @author Steven Wee [email protected]
* @version $Revision: 1.0.0 $ $Date: Nov 3, 2017 16:39:41 $
*/
public interface StartupLauncher {
/**
* Startup method
* StartupManager invoke this method to execute current launcher
* 启动方法
* 启动管理器调用此方法来执行当前的启动器
*
* @param basePath Base path for launcher execute
* 启动器执行的基本目录
*/
void startup(final String basePath);
/**
* Destroy current launcher instance
* 销毁当前启动器实例
*/
void destroy();
}