public abstract class CartierApplication extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static CartierApplication |
application |
protected static Properties |
applicationProperties |
protected CartierApplicationContext |
context |
protected static String |
root |
| Constructor and Description |
|---|
CartierApplication() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
checkOptions(Map<String,String> options)
Deprecated.
use set properties on [appliation.properties] instead of
|
abstract void |
init(CartierApplicationContext context)
New init method for sub-application
|
protected static Map<String,String> |
parseMainArgs(String[] args)
Parse Main method input parameters into Map
|
protected static void |
registerShutdownHook(CartierApplicationContext context) |
protected static <T extends CartierApplication> |
run(String[] args,
Class<T> clazz)
参数格式 ,
|
protected static <T extends CartierApplication> |
run(String[] args,
Class<T> clazz,
String root)
New Run Method ,auto support application runtime root path :
root |
abstract void |
shutdown(CartierApplicationContext context)
程序停止
|
abstract void |
start(CartierApplicationContext context)
程序运行
|
protected static CartierApplication application
protected static Properties applicationProperties
protected CartierApplicationContext context
protected static String root
protected static <T extends CartierApplication> void run(String[] args, Class<T> clazz)
Runner Command for JAVA_OPT:
1.-O<name>=<value> set a system property
Examples : ('-O options' must be set after *.jar)
java -jar demo.jar -Oprofile=production // set an option profile = production
Code Usage Example :
String profile = Applications.getOption("profile");
Recommend Package :
if you don't want write start shell for you application ,we support some shells ,
like : start.sh
stop.sh
restart.sh
server.sh
dump.sh
Also Support Windows:
start.bat
See : ApplicationRunner
Code Conf:
Create "resources/META-INF/xyz.vopen.cartier.surface.CartierApplication" File
Like this :
# conf you application into upper file
application=xyz.vopen.cartier.iosresign.runnable.IOSResignApplication
Maven Conf:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>xyz.vopen.cartier</groupId>
<artifactId>cartier-surface</artifactId>
<version>${project.parent.version}</version>
<outputDirectory>${project.build.directory}/bin</outputDirectory>
<includes>assembly/bin/**</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
args - 程序执行参数protected static <T extends CartierApplication> void run(String[] args, Class<T> clazz, String root)
rootprotected static Map<String,String> parseMainArgs(String[] args)
args - parameterprotected static void registerShutdownHook(CartierApplicationContext context)
public abstract void init(CartierApplicationContext context) throws Exception
context - application contextExceptionpublic abstract void start(CartierApplicationContext context) throws Exception
Exception - exceptionpublic abstract void shutdown(CartierApplicationContext context) throws Exception
Exception - exception@Deprecated public abstract void checkOptions(Map<String,String> options) throws CartierOptionException
CartierOptionExceptionoptions - option mapCartierOptionException - option exceptionCopyright © 2017 CiNC0. All rights reserved.