当前位置: 首页>>代码示例>>Java>>正文


Java ILogger.severe方法代码示例

本文整理汇总了Java中com.hazelcast.logging.ILogger.severe方法的典型用法代码示例。如果您正苦于以下问题:Java ILogger.severe方法的具体用法?Java ILogger.severe怎么用?Java ILogger.severe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hazelcast.logging.ILogger的用法示例。


在下文中一共展示了ILogger.severe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: withTryCatch

import com.hazelcast.logging.ILogger; //导入方法依赖的package包/类
/**
 * Utility to make sure exceptions inside
 * {@link java.util.concurrent.CompletionStage#whenComplete(BiConsumer)} are not swallowed.
 * Exceptions will be caught and logged using the supplied logger and message.
 */
@Nonnull
public static <T> BiConsumer<T, ? super Throwable> withTryCatch(
        @Nonnull ILogger logger, @Nonnull String message, @Nonnull BiConsumer<T, ? super Throwable> consumer
) {
    return (r, t) -> {
        try {
            consumer.accept(r, t);
        } catch (Throwable e) {
            logger.severe(message, e);
        }
    };
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:18,代码来源:ExceptionUtil.java

示例2: init

import com.hazelcast.logging.ILogger; //导入方法依赖的package包/类
@Override
public void init(List<URI> etcdUris,
                 String etcdUsername,
                 String etcdPassword,
		         String etcdServiceName,
		         DiscoveryNode localDiscoveryNode,
		         Map<String, Object> registratorConfig,
		         ILogger logger) throws Exception {
	
	this.logger = logger;
	this.etcdUsername = etcdUsername;
	this.etcdPassword = etcdPassword;
	this.etcdServiceName = etcdServiceName;
	this.etcdUris = etcdUris;

	try {
		/**
		 * Determine my local address
		 */
		this.myLocalAddress = determineMyLocalAddress(localDiscoveryNode, registratorConfig);
		logger.info("Determined local DiscoveryNode address to use: " + myLocalAddress);
		
	} catch(Exception e) {
		String msg = "Unexpected error in configuring LocalDiscoveryNodeRegistration: " + e.getMessage();
		logger.severe(msg,e);
		throw new Exception(msg,e);
	}
	
}
 
开发者ID:bitsofinfo,项目名称:hazelcast-etcd-discovery-spi,代码行数:30,代码来源:BaseRegistrator.java

示例3: init

import com.hazelcast.logging.ILogger; //导入方法依赖的package包/类
@Override
public void init(String consulHost, 
		         Integer consulPort,
		         String consulServiceName,
		         String[] consulTags,
		         String consulAclToken,
		         boolean consulSslEnabled,
				 String	consulSslServerCertFilePath,
				 String consulSslServerCertBase64,
				 boolean consulServerHostnameVerify,
		         DiscoveryNode localDiscoveryNode,
		         Map<String, Object> registratorConfig,
		         ILogger logger) throws Exception {
	
	this.logger = logger;
	this.tags = consulTags;
	this.consulHost = consulHost;
	this.consulPort = consulPort;
	this.consulServiceName = consulServiceName;
	this.consulAclToken = consulAclToken;
	this.registratorConfig = registratorConfig;
	
	try {
		/**
		 * Determine my local address
		 */
		this.myLocalAddress = determineMyLocalAddress(localDiscoveryNode, registratorConfig);
		logger.info("Determined local DiscoveryNode address to use: " + myLocalAddress);
		
		
		//Build our consul client to use. We pass in optional TLS information
		ConsulBuilder builder = ConsulClientBuilder.class.newInstance();
		Consul consul = builder.buildConsul(consulHost, 
											consulPort, 
											consulSslEnabled, 
											consulSslServerCertFilePath, 
											consulSslServerCertBase64, 
											consulServerHostnameVerify,
											consulAclToken);
		
		 
		// build my Consul agent client that we will register with
		this.consulAgentClient =  consul.agentClient();
		
	} catch(Exception e) {
		String msg = "Unexpected error in configuring LocalDiscoveryNodeRegistration: " + e.getMessage();
		logger.severe(msg,e);
		throw new Exception(msg,e);
	}
	
}
 
开发者ID:bitsofinfo,项目名称:hazelcast-consul-discovery-spi,代码行数:52,代码来源:BaseRegistrator.java


注:本文中的com.hazelcast.logging.ILogger.severe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。