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


Java Logger类代码示例

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


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


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