• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Logger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Logger类属于com.hazelcast.logging包,在下文中一共展示了Logger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: shutdown

import com.hazelcast.logging.Logger; //导入依赖的package包/类
/**
 * Stop the management service
 */
public static void shutdown() {
    synchronized (LOCK) {
        if (counter.get() > 0) {
            return;
        }
        MBeanServer mbs = mBeanServer();
        Set<ObjectName> entries;
        try {
            entries = mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "*"), null);
            for (ObjectName name : entries) {
                // Double check, in case the entry has been removed in the meantime
                if (mbs.isRegistered(name)) {
                    mbs.unregisterMBean(name);
                }
            }
        } catch (Exception e) {
            Logger.getLogger("hz.ManagementCenter").log(Level.FINEST, "Error unregistering MBeans", e);
        }
        if (statCollectors != null) {
            statCollectors.shutdownNow();
            statCollectors = null;
        }
    }
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:28,代码来源:ManagementService.java


示例2: get

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static ThreadContext get() {
    Thread currentThread = Thread.currentThread();
    ThreadContext threadContext = mapContexts.get(currentThread);
    if (threadContext == null) {
        threadContext = new ThreadContext(Thread.currentThread());
        mapContexts.put(currentThread, threadContext);
        Iterator<Thread> threads = mapContexts.keySet().iterator();
        while (threads.hasNext()) {
            Thread thread = threads.next();
            if (!thread.isAlive()) {
                threads.remove();
            }
        }
        if (mapContexts.size() > 1000) {
            String msg = " ThreadContext is created!! You might have too many threads. Is that normal?";
            Logger.getLogger(ThreadContext.class.getName()).log(Level.WARNING, mapContexts.size() + msg);
        }
    }
    return threadContext;
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:21,代码来源:ThreadContext.java


示例3: shutdown

import com.hazelcast.logging.Logger; //导入依赖的package包/类
/**
 * Stop the management service
 */
public synchronized static void shutdown() {
    MBeanServer mbs = mBeanServer();
    try {
        Set<ObjectName> entries = mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "*"), null);
        for (ObjectName name : entries) {
            // Double check, in case the entry has been removed in the meantime
            if (mbs.isRegistered(name)) {
                mbs.unregisterMBean(name);
            }
        }
    } catch (Exception e) {
        Logger.getLogger("hz.ManagementCenter").log(Level.FINEST, "Error unregistering MBeans", e);
    }
    stopStatsCollector();
}
 
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:19,代码来源:ManagementService.java


示例4: get

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static ThreadContext get() {
    Thread currentThread = Thread.currentThread();
    ThreadContext threadContext = mapContexts.get(currentThread);
    if (threadContext == null) {
        try {
            threadContext = new ThreadContext(Thread.currentThread());
            mapContexts.put(currentThread, threadContext);
            Iterator<Thread> threads = mapContexts.keySet().iterator();
            while (threads.hasNext()) {
                Thread thread = threads.next();
                if (!thread.isAlive()) {
                    threads.remove();
                }
            }
        } catch (OutOfMemoryError e) {
            OutOfMemoryErrorDispatcher.onOutOfMemory(e);
            throw e;
        }
        if (mapContexts.size() > 1000) {
            String msg = " ThreadContext is created!! You might have too many threads. Is that normal?";
            Logger.getLogger(ThreadContext.class.getName()).log(Level.WARNING, mapContexts.size() + msg);
        }
    }
    return threadContext;
}
 
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:26,代码来源:ThreadContext.java


示例5: Hibernate5CacheEntrySerializerHook

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public Hibernate5CacheEntrySerializerHook() {
    Class<?> cacheEntryClass = null;
    if (UnsafeHelper.UNSAFE_AVAILABLE) {
        try {
            cacheEntryClass = Class.forName("org.hibernate.cache.spi.entry.StandardCacheEntryImpl");
        } catch (Exception e) {
            Logger.getLogger(Hibernate5CacheEntrySerializerHook.class).finest(SKIP_INIT_MSG);
        }
    }
    this.cacheEntryClass = cacheEntryClass;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:12,代码来源:Hibernate5CacheEntrySerializerHook.java


示例6: getTimeout

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static int getTimeout(final HazelcastInstance instance, final String regionName) {
    try {
        final MapConfig cfg = instance.getConfig().findMapConfig(regionName);
        if (cfg.getTimeToLiveSeconds() > 0) {
            // TTL in ms
            return cfg.getTimeToLiveSeconds() * SEC_TO_MS;
        }
    } catch (UnsupportedOperationException e) {
        // HazelcastInstance is instance of HazelcastClient.
        Logger.getLogger(HazelcastTimestamper.class).finest(e);
    }
    return CacheEnvironment.getDefaultCacheTimeoutInMillis();
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:14,代码来源:HazelcastTimestamper.java


示例7: getMaxOperationTimeout

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static long getMaxOperationTimeout(final HazelcastInstance instance) {
    String maxOpTimeoutProp = null;
    try {
        Config config = instance.getConfig();
        maxOpTimeoutProp = config.getProperty(CacheEnvironment.HAZELCAST_OPERATION_TIMEOUT);
    } catch (UnsupportedOperationException e) {
        // HazelcastInstance is instance of HazelcastClient.
        Logger.getLogger(HazelcastTimestamper.class).finest(e);
    }
    if (maxOpTimeoutProp != null) {
        return Long.parseLong(maxOpTimeoutProp);
    }
    return Long.MAX_VALUE;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:15,代码来源:HazelcastTimestamper.java


示例8: getLockTimeoutInMillis

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static int getLockTimeoutInMillis(final Properties props) {
    int timeout = -1;
    try {
        timeout = ConfigurationHelper.getInt(LOCK_TIMEOUT, props, -1);
    } catch (Exception e) {
        Logger.getLogger(CacheEnvironment.class).finest(e);
    }
    if (timeout < 0) {
        timeout = MAXIMUM_LOCK_TIMEOUT;
    }
    return timeout;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:13,代码来源:CacheEnvironment.java


示例9: getLogger

import com.hazelcast.logging.Logger; //导入依赖的package包/类
@Override
public final ILogger getLogger() {
    final String name = getClass().getName();
    try {
        return instance.getLoggingService().getLogger(name);
    } catch (UnsupportedOperationException e) {
        // HazelcastInstance is instance of HazelcastClient.
        return Logger.getLogger(name);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:11,代码来源:AbstractHazelcastRegion.java


示例10: evict

import com.hazelcast.logging.Logger; //导入依赖的package包/类
@Override
public void evict(final Object key) throws CacheException {
    try {
        getCache().remove(key);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:AbstractGeneralRegion.java


示例11: evictAll

import com.hazelcast.logging.Logger; //导入依赖的package包/类
@Override
public void evictAll() throws CacheException {
    try {
        getCache().clear();
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:AbstractGeneralRegion.java


示例12: put

import com.hazelcast.logging.Logger; //导入依赖的package包/类
@Override
public void put(final SessionImplementor session, final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, nextTimestamp(), null);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:AbstractGeneralRegion.java


示例13: setUp

import com.hazelcast.logging.Logger; //导入依赖的package包/类
@Before
public void setUp() {
    ILogger log = Logger.getLogger(ReadWriteAccessDelegateTest.class);

    cache = mock(RegionCache.class);

    HazelcastRegion region = mock(HazelcastRegion.class);
    when(region.getLogger()).thenReturn(log);
    when(region.getCache()).thenReturn(cache);

    delegate = new ReadWriteAccessDelegate<HazelcastRegion>(region, null);
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:13,代码来源:ReadWriteAccessDelegateTest.java


示例14: Hibernate5CacheEntrySerializerHook

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public Hibernate5CacheEntrySerializerHook() {
    Class<?> cacheEntryClass = null;
    if (UnsafeHelper.UNSAFE_AVAILABLE) {
        try {
            // check if Hibernate is available
            Class.forName("org.hibernate.cache.spi.entry.CacheEntry");
            cacheEntryClass = CacheEntryImpl.class;
        } catch (Exception e) {
            Logger.getLogger(Hibernate5CacheEntrySerializerHook.class).finest(SKIP_INIT_MSG);
        }
    }
    this.cacheEntryClass = cacheEntryClass;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:14,代码来源:Hibernate5CacheEntrySerializerHook.java


示例15: put

import com.hazelcast.logging.Logger; //导入依赖的package包/类
@Override
public void put(final SharedSessionContractImplementor session, final Object key, final Object value) throws CacheException {
    try {
        getCache().put(key, value, nextTimestamp(), null);
    } catch (OperationTimeoutException e) {
        Logger.getLogger(AbstractGeneralRegion.class).finest(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:AbstractGeneralRegion.java


示例16: Hibernate4CacheKeySerializerHook

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public Hibernate4CacheKeySerializerHook() {
    Class<?> cacheKeyClass = null;
    if (UnsafeHelper.UNSAFE_AVAILABLE) {
        try {
            cacheKeyClass = Class.forName("org.hibernate.cache.spi.CacheKey");
        } catch (Exception e) {
            Logger.getLogger(Hibernate4CacheKeySerializerHook.class).finest(SKIP_INIT_MSG);
        }
    }
    this.cacheKeyClass = cacheKeyClass;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:12,代码来源:Hibernate4CacheKeySerializerHook.java


示例17: Hibernate4CacheEntrySerializerHook

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public Hibernate4CacheEntrySerializerHook() {
    Class<?> cacheEntryClass = null;
    if (UnsafeHelper.UNSAFE_AVAILABLE) {
        try {
            cacheEntryClass = Class.forName("org.hibernate.cache.spi.entry.CacheEntry");
        } catch (Exception e) {
            Logger.getLogger(Hibernate4CacheEntrySerializerHook.class).finest(SKIP_INIT_MSG);
        }
    }
    this.cacheEntryClass = cacheEntryClass;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:12,代码来源:Hibernate4CacheEntrySerializerHook.java


示例18: getTimeout

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static int getTimeout(HazelcastInstance instance, String regionName) {
    try {
        final MapConfig cfg = instance.getConfig().findMapConfig(regionName);
        if (cfg.getTimeToLiveSeconds() > 0) {
            // TTL in ms
            return cfg.getTimeToLiveSeconds() * SEC_TO_MS;
        }
    } catch (UnsupportedOperationException e) {
        // HazelcastInstance is instance of HazelcastClient.
        Logger.getLogger(HazelcastTimestamper.class).finest(e);
    }
    return CacheEnvironment.getDefaultCacheTimeoutInMillis();
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:14,代码来源:HazelcastTimestamper.java


示例19: getMaxOperationTimeout

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static long getMaxOperationTimeout(HazelcastInstance instance) {
    String maxOpTimeoutProp = null;
    try {
        Config config = instance.getConfig();
        maxOpTimeoutProp = config.getProperty(CacheEnvironment.HAZELCAST_OPERATION_TIMEOUT);
    } catch (UnsupportedOperationException e) {
        // HazelcastInstance is instance of HazelcastClient.
        Logger.getLogger(HazelcastTimestamper.class).finest(e);
    }
    if (maxOpTimeoutProp != null) {
        return Long.parseLong(maxOpTimeoutProp);
    }
    return Long.MAX_VALUE;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:15,代码来源:HazelcastTimestamper.java


示例20: getLockTimeoutInMillis

import com.hazelcast.logging.Logger; //导入依赖的package包/类
public static int getLockTimeoutInMillis(Properties props) {
    int timeout = -1;
    try {
        timeout = ConfigurationHelper.getInt(LOCK_TIMEOUT, props, -1);
    } catch (Exception e) {
        Logger.getLogger(CacheEnvironment.class).finest(e);
    }
    if (timeout < 0) {
        timeout = MAXIMUM_LOCK_TIMEOUT;
    }
    return timeout;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:13,代码来源:CacheEnvironment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IntervalCategoryDataset类代码示例发布时间:2022-05-21
下一篇:
Java DigitalOutput类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap