本文整理汇总了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;
}
示例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;
}
示例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));
}
}
示例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;
}
示例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));
}
}