javax.annotation.PostConstruct.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(273)

本文整理了Java中javax.annotation.PostConstruct.<init>()方法的一些代码示例,展示了PostConstruct.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PostConstruct.<init>()方法的具体详情如下:
包路径:javax.annotation.PostConstruct
类名称:PostConstruct
方法名:<init>

PostConstruct.<init>介绍

暂无

代码示例

代码示例来源:origin: ctripcorp/apollo

@PostConstruct
private void initialize() {
 logger.info(
   "SampleRedisConfig initialized - expireSeconds: {}, clusterNodes: {}, commandTimeout: {}, someMap: {}, someList: {}",
   expireSeconds, clusterNodes, commandTimeout, someMap, someList);
}

代码示例来源:origin: apache/usergrid

@PostConstruct
public void initLockManager() throws Exception {
  this.lockManager = injector.getInstance(LockManager.class);
  if (this.lockManager != null) {
    logger.info("LockManager injection successful");
  } else {
    logger.error("LockManager injection unsuccessful");
  }
}

代码示例来源:origin: Netflix/eureka

@PostConstruct
@Override
public void initialize() {
  logger.info("Initializing ...");
  peerEurekaNodes.start();
  try {
    registry.init(peerEurekaNodes);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  logger.info("Initialized");
}

代码示例来源:origin: Netflix/eureka

@PostConstruct
public void init() {
  try {
    // Must set the initial status
    currentStatus = client.getInstanceRemoteStatus();
    LOG.info("Initial status set to {}", currentStatus);
    eventBus.registerSubscriber(this);
  } catch (InvalidSubscriberException e) {
    LOG.error("Error registring for discovery status change events.", e);
  }
}

代码示例来源:origin: alibaba/canal

@PostConstruct
public synchronized void init() {
  if (running) {
    return;
  }
  try {
    logger.info("## start the canal client adapters.");
    adapterLoader = new CanalAdapterLoader(adapterCanalConfig);
    adapterLoader.init();
    running = true;
    logger.info("## the canal client adapters are running now ......");
  } catch (Exception e) {
    logger.error("## something goes wrong when starting up the canal client adapters:", e);
  }
}

代码示例来源:origin: shopizer-ecommerce/shopizer

@PostConstruct
void init() {
 this.rootName = ((CMSManager) cacheManager).getRootName();
 LOGGER.info("init " + getClass().getName() + " setting root" + this.rootName);
}

代码示例来源:origin: shopizer-ecommerce/shopizer

@PostConstruct
void init() {
 this.rootName = ((CMSManager) cacheManager).getRootName();
 LOGGER.info("init " + getClass().getName() + " setting root" + this.rootName);
}

代码示例来源:origin: shopizer-ecommerce/shopizer

@PostConstruct
void init() {
 this.rootName = ((CMSManager) cacheManager).getRootName();
 LOGGER.info("init " + getClass().getName() + " setting root" + this.rootName);
}

代码示例来源:origin: shopizer-ecommerce/shopizer

@PostConstruct
void init() {
 this.rootName = ((CMSManager) cacheManager).getRootName();
 LOGGER.info("init " + getClass().getName() + " setting root" + this.rootName);
}

代码示例来源:origin: ethereum/ethereumj

/**
 * The method is called after all EthereumJ instances are created
 */
@PostConstruct
private void springInit() {
  setupLogging();
  // adding the main EthereumJ callback to be notified on different kind of events
  ethereum.addListener(listener);
  logger.info("Sample component created. Listening for ethereum events...");
  // starting lifecycle tracking method run()
  new Thread(this, "SampleWorkThread").start();
}

代码示例来源:origin: jooby-project/jooby

@PostConstruct
public void start() throws Exception {
 for (Entry<JobDetail, Trigger> job : jobs) {
  JobDetail detail = job.getKey();
  Trigger trigger = job.getValue();
  log.info("  {} {}", detail.getKey(), describe(trigger));
  scheduler.scheduleJob(detail, trigger);
 }
 scheduler.start();
}

代码示例来源:origin: alibaba/jetcache

@PostConstruct
public synchronized void start() {
  if (future != null) {
    return;
  }
  long delay = firstDelay(resetTime, resetTimeUnit);
  future = JetCacheExecutor.defaultExecutor().scheduleAtFixedRate(
      cmd, delay, resetTimeUnit.toMillis(resetTime), TimeUnit.MILLISECONDS);
  logger.info("cache stat period at " + resetTime + " " + resetTimeUnit);
}

代码示例来源:origin: crossoverJie/cim

/**
 * 启动 cim server
 *
 * @return
 * @throws InterruptedException
 */
@PostConstruct
public void start() throws InterruptedException {
  ServerBootstrap bootstrap = new ServerBootstrap()
      .group(boss, work)
      .channel(NioServerSocketChannel.class)
      .localAddress(new InetSocketAddress(nettyPort))
      //保持长连接
      .childOption(ChannelOption.SO_KEEPALIVE, true)
      .childHandler(new CIMServerInitializer());
  ChannelFuture future = bootstrap.bind().sync();
  if (future.isSuccess()) {
    LOGGER.info("启动 cim server 成功");
  }
}

代码示例来源:origin: kaaproject/kaa

/**
 * Bean init-method.
 */
@PostConstruct
public void initBean() {
 LOG.info("Init default event service.");
 listeners = Collections.newSetFromMap(new ConcurrentHashMap<EventServiceListener, Boolean>());
 neighbors = new Neighbors<>(KaaThriftService.OPERATIONS_SERVICE, new MessageTemplate(this),
   operationsServerConfig.getMaxNumberNeighborConnections());
}

代码示例来源:origin: apache/usergrid

@PostConstruct
public void start(){
  boolean shouldRun = new Boolean(properties.getProperty("usergrid.queues.listener.run", "true"));
    logger.info("QueueListener: never started due to config value usergrid.queues.listener.run.");

代码示例来源:origin: gocd/gocd

@PostConstruct
  public void init() {
    if (!environment.getAgentStatusEnabled()) {
      LOG.info("Agent status HTTP API server has been disabled.");
      return;
    }
    try {
      start();
      LOG.info("Agent status HTTP API server running on http://{}:{}.", getHostname() == null ? "0.0.0.0" : getHostname(), getListeningPort());
    } catch (Exception e) {
      LOG.warn("Could not start agent status HTTP API server on host {}, port {}.", getHostname(), port, e);
    }
  }
}

代码示例来源:origin: ethereum/ethereumj

/**
 * The method is called after all EthereumJ instances are created
 */
@PostConstruct
private void springInit() {
  logger = LoggerFactory.getLogger(loggerName);
  // adding the main EthereumJ callback to be notified on different kind of events
  ethereum.addListener(listener);
  logger.info("Sample component created. Listening for ethereum events...");
  // starting lifecycle tracking method run()
  new Thread(this, "SampleWorkThread").start();
}

代码示例来源:origin: ethereum/ethereumj

/**
 * The method is called after all EthereumJ instances are created
 */
@PostConstruct
private void springInit() {
  logger = LoggerFactory.getLogger(loggerName);
  // adding the main EthereumJ callback to be notified on different kind of events
  ethereum.addListener(listener);
  logger.info("Sample component created. Listening for ethereum events...");
  // starting lifecycle tracking method run()
  new Thread(this, "SampleWorkThread").start();
}

代码示例来源:origin: alibaba/nacos

@PostConstruct
public void init() {
  serverPort = System.getProperty("nacos.server.port", "8848");
  envIdUrl = "http://" + domainName + ":" + addressPort + "/env";
  defaultLog.info("ServerListService address-server port:" + serverPort);
  defaultLog.info("ADDRESS_SERVER_URL:" + addressServerUrl);
  isHealthCheck = PropertyUtil.isHealthCheck();
  maxFailCount = PropertyUtil.getMaxHealthCheckFailCount();

代码示例来源:origin: kaaproject/kaa

/**
 * Bean init-method.
 */
@PostConstruct
public void initBean() {
 LOG.info("Init default cluster service.");
 neighbors = new Neighbors<>(KaaThriftService.OPERATIONS_SERVICE, new MessageTemplate(),
     operationsServerConfig.getMaxNumberNeighborConnections());
}

相关文章

PostConstruct类方法