本文整理汇总了Java中org.apache.nifi.annotation.lifecycle.OnDisabled类的典型用法代码示例。如果您正苦于以下问题:Java OnDisabled类的具体用法?Java OnDisabled怎么用?Java OnDisabled使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OnDisabled类属于org.apache.nifi.annotation.lifecycle包,在下文中一共展示了OnDisabled类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shutdown
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void shutdown() {
this.closed = true;
CommsSession commsSession;
while ((commsSession = queue.poll()) != null) {
try (final DataOutputStream dos = new DataOutputStream(commsSession.getOutputStream())) {
dos.writeUTF("close");
dos.flush();
commsSession.close();
} catch (final IOException e) { /* empty */ }
}
if (logger.isDebugEnabled() && getIdentifier() != null) {
logger.debug("Closed {}", new Object[]{getIdentifier()});
}
}
示例2: shutdownServer
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void shutdownServer() {
if (httpServer != null) {
httpServer.close(res -> {
if (res.succeeded()) {
getLogger().info("server stopped");
} else {
getLogger().error("server stop failed!");
}
});
}
if (eventBus != null) {
eventBus.close(res -> {
if (res.succeeded()) {
getLogger().info("eventBus closed");
} else {
getLogger().error("eventBus close failed!");
}
});
}
if (vertx != null) {
vertx.close();
}
}
示例3: shutdown
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void shutdown() {
if (cache != null) {
cache.removeAll();
}
cache = null;
}
示例4: stop
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void stop() throws IOException {
stopServer();
cache.removeAll();
cache = null;
}
示例5: onDisabled
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void onDisabled() {
try {
mongoClient.close();
} catch (final Exception e) {
throw new ProcessException(e);
}
}
示例6: shutdown
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void shutdown() {
try {
driver.close();
} catch (final Neo4jException e) {
throw new ProcessException(e);
}
}
示例7: disable
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
/**
*
*/
@OnDisabled
public void disable() {
this.connectionFactory = null;
this.configured = false;
}
示例8: shutdown
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void shutdown() {
if (connector != null) {
connector = null;
}
}
示例9: shutdown
import org.apache.nifi.annotation.lifecycle.OnDisabled; //导入依赖的package包/类
@OnDisabled
public void shutdown() {
}