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


Java EventType.values方法代码示例

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


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

示例1: rebuildListenerPresent

import javax.cache.event.EventType; //导入方法依赖的package包/类
/**
 * Rebuild the listenerPresent lookup array 
 */
private void rebuildListenerPresent()
{
	short listenerPresentXnew = 0;
	for (ListenerEntry<K, V> listener : listeners)
	{
		for (EventType eventType : EventType.values())
		{
			if (listener.isListeningFor(eventType))
			{
				listenerPresentXnew |= (1 << eventType.ordinal());
			}
		}
	}

	listenerPresentMask = listenerPresentXnew;
}
 
开发者ID:trivago,项目名称:triava,代码行数:20,代码来源:ListenerCollection.java

示例2: enableCacheEntryListener

import javax.cache.event.EventType; //导入方法依赖的package包/类
/**
 * Enables a listener, without adding it to the Configuration. An  enabled listener can send events after this method returns.  
 * The caller must make sure that the
 * corresponding Configuration object reflects the change.
 * 
 * @param listenerConfiguration
 * @return
 */
private synchronized boolean enableCacheEntryListener(CacheEntryListenerConfiguration<K, V> listenerConfiguration)
{
	DispatchMode dispatchMode = listenerConfiguration.isSynchronous() ? DispatchMode.SYNC : DispatchMode.ASYNC_TIMED;
	ListenerEntry<K, V> newListener = new ListenerEntry<K, V>(listenerConfiguration, tcache, dispatchMode);
	boolean added = listeners.add(newListener);
	for (EventType eventType : EventType.values())
	{
		if (newListener.isListeningFor(eventType))
		{
			listenerPresentMask |= (1 << eventType.ordinal());
		}
	}

	return added;
}
 
开发者ID:trivago,项目名称:triava,代码行数:24,代码来源:ListenerCollection.java

示例3: CacheEntryListenerServer

import javax.cache.event.EventType; //导入方法依赖的package包/类
/**
 * Constructs an CacheLoaderServer.
 *
 * @param port        the port on which to accept {@link org.jsr107.tck.integration.CacheLoaderClient} request.
 * @param keyClass    the class for entry key
 * @param valueClass  the class for entry value
 */
public CacheEntryListenerServer(int port, Class keyClass, Class valueClass) {
  super(port);
  this.listeners = new HashSet<CacheEntryListener<K, V>>();

  // establish the client-server operation handlers
  for (EventType eventType : EventType.values()) {
    addOperationHandler(new CacheEntryEventOperationHandler(eventType, keyClass, valueClass));
  }
}
 
开发者ID:cache2k,项目名称:cache2k,代码行数:17,代码来源:CacheEntryListenerServer.java

示例4: removeAsyncListener

import javax.cache.event.EventType; //导入方法依赖的package包/类
boolean removeAsyncListener(CacheEntryListenerConfiguration<K,V> cfg) {
  boolean _found = false;
  for (EventType t : EventType.values()) {
    _found |= EventHandling.removeCfgMatch(cfg, asyncListenerByType.get(t));
  }
  return _found;
}
 
开发者ID:cache2k,项目名称:cache2k,代码行数:8,代码来源:AsyncDispatcher.java

示例5: collectListeners

import javax.cache.event.EventType; //导入方法依赖的package包/类
void collectListeners(Collection<Listener<K, V>> l) {
  for (EventType t : EventType.values()) {
    l.addAll(asyncListenerByType.get(t));
  }
}
 
开发者ID:cache2k,项目名称:cache2k,代码行数:6,代码来源:AsyncDispatcher.java


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