本文整理汇总了Java中ninja.lifecycle.Start类的典型用法代码示例。如果您正苦于以下问题:Java Start类的具体用法?Java Start怎么用?Java Start使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Start类属于ninja.lifecycle包,在下文中一共展示了Start类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import ninja.lifecycle.Start; //导入依赖的package包/类
@Start(order = 90)
public void start() {
CountDownLatch countDownLatch = new CountDownLatch(1);
Handler<AsyncResult<String>> handler = stringAsyncResult -> {
countDownLatch.countDown();
};
verticleID = GuiceVerticleFactory.PREFIX + ":" + NinjaVerticle.class.getName();
runner = vertex -> {
try {
if (deploymentOptions != null) {
vertex.deployVerticle(verticleID, deploymentOptions, handler);
} else {
vertex.deployVerticle(verticleID, handler);
}
} catch (Throwable t) {
log.error(t.getMessage(), t);
}
};
runner.accept(vertx);
await(countDownLatch);
}
开发者ID:kuangcao,项目名称:ninja-vertx-standalone,代码行数:25,代码来源:VertxInitializer.java
示例2: startReceiving
import ninja.lifecycle.Start; //导入依赖的package包/类
@Start(order = 90)
public void startReceiving() throws IOException {
log.info("Starting UDP listener on port 19876");
serverSocket = new DatagramSocket(19876);
receiveThread = new Thread(new Runnable() {
@Override
public void run() {
byte[] receiveData = new byte[1024];
try {
while (true) {
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
serverSocket.receive(receivePacket);
log.info("Received UDP packet from " + receivePacket.getAddress() + ": " +
new String(receivePacket.getData(), 0, receivePacket.getLength()));
count.incrementAndGet();
}
} catch (IOException e) {
// Ignore, it just means we've been shut down
}
}
});
receiveThread.start();
}
开发者ID:kpacha,项目名称:ninja-mustache,代码行数:26,代码来源:UdpPingController.java
示例3: configureObjectMapper
import ninja.lifecycle.Start; //导入依赖的package包/类
@Start(order = 90)
public void configureObjectMapper() {
mapper.setDateFormat(df);
mapper.setTimeZone(TimeZone.getDefault());
mapper.enable(SerializationFeature.INDENT_OUTPUT);
}
开发者ID:bentolor,项目名称:microframeworks-showcase,代码行数:7,代码来源:DefaultModelSerializer.java
示例4: generateDummyDataWhenInTest
import ninja.lifecycle.Start; //导入依赖的package包/类
@Start(order=100)
public void generateDummyDataWhenInTest() {
if (!ninjaProperties.isProd()) {
setupDao.setup();
}
}
开发者ID:mysu,项目名称:jade4ninja,代码行数:11,代码来源:StartupActions.java
示例5: generateDummyDataWhenInTest
import ninja.lifecycle.Start; //导入依赖的package包/类
@Start(order = 100)
public void generateDummyDataWhenInTest() {
if (!ninjaProperties.isProd()) {
// setupDao.setup();
}
}
开发者ID:mysu,项目名称:uma,代码行数:11,代码来源:StartupActions.java
注:本文中的ninja.lifecycle.Start类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论