@Override public IdentifiedDataSerializable create(int typeId) { if (typeId >= 0 && typeId < len) { ConstructorFunction<Integer, IdentifiedDataSerializable> factory = constructors[typeId]; return factory != null ? factory.createNew(typeId) : null; } return null; }
@Override public IdentifiedDataSerializable create(int typeId) { if (typeId >= 0 && typeId < len) { ConstructorFunction<Integer, IdentifiedDataSerializable> factory = constructors[typeId]; return factory != null ? factory.createNew(typeId) : null; } return null; }
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public Portable create(int classId) { return (classId > 0 && classId <= constructors.length) ? constructors[classId].createNew(classId) : null; } };
public void regenerateUuid(int partitionId) { uuids.put(partitionId, uuidConstructor.createNew(partitionId)); }
public void regenerateUuid(int partitionId) { uuids.put(partitionId, uuidConstructor.createNew(partitionId)); }
public static <K, V> V getOrPutIfAbsent(ConcurrentMap<K, V> map, K key, ConstructorFunction<K, V> func) { V value = map.get(key); if (value == null) { value = func.createNew(key); V current = map.putIfAbsent(key, value); value = current == null ? value : current; } return value; }
public static <K, V> V getOrPutIfAbsent(ConcurrentMap<K, V> map, K key, ConstructorFunction<K, V> func) { V value = map.get(key); if (value == null) { value = func.createNew(key); V current = map.putIfAbsent(key, value); value = current == null ? value : current; } return value; }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param mapListener a {@link com.hazelcast.map.listener.MapListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, MapListener mapListener) { final ConstructorFunction<MapListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(mapListener); }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param listener a {@link EntryListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) { final ConstructorFunction<EntryListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(listener); }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param mapListener a {@link com.hazelcast.map.listener.MapListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, MapListener mapListener) { final ConstructorFunction<MapListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(mapListener); }
/** * Creates a {@link ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType}. * * @param eventType an {@link com.hazelcast.core.EntryEventType}. * @param listener a {@link EntryListener} instance. * @return {@link com.hazelcast.map.impl.ListenerAdapter} for a specific {@link com.hazelcast.core.EntryEventType} */ private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) { final ConstructorFunction<EntryListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(listener); }
static ListenerAdapter[] createQueryCacheListenerAdapters(MapListener mapListener) { ListenerAdapter[] mapListenerAdapters = MapListenerAdaptors.createListenerAdapters(mapListener); ListenerAdapter eventLostAdapter = EVENT_LOST_LISTENER_ADAPTER.createNew(mapListener); ListenerAdapter[] adapters = new ListenerAdapter[mapListenerAdapters.length + 1]; System.arraycopy(mapListenerAdapters, 0, adapters, 0, mapListenerAdapters.length); adapters[mapListenerAdapters.length] = eventLostAdapter; return adapters; }
public static <K, V> V getOrPutSynchronized(ConcurrentMap<K, V> map, K key, final Object mutex, ConstructorFunction<K, V> func) { if (mutex == null) { throw new NullPointerException(); } V value = map.get(key); if (value == null) { synchronized (mutex) { value = map.get(key); if (value == null) { value = func.createNew(key); map.put(key, value); } } } return value; }
public static <K, V> V getOrPutSynchronized(ConcurrentMap<K, V> map, K key, final Object mutex, ConstructorFunction<K, V> func) { if (mutex == null) { throw new NullPointerException(); } V value = map.get(key); if (value == null) { synchronized (mutex) { value = map.get(key); if (value == null) { value = func.createNew(key); map.put(key, value); } } } return value; }
static ListenerAdapter[] createQueryCacheListenerAdapters(MapListener mapListener) { ListenerAdapter[] mapListenerAdapters = MapListenerAdaptors.createListenerAdapters(mapListener); ListenerAdapter eventLostAdapter = EVENT_LOST_LISTENER_ADAPTER.createNew(mapListener); ListenerAdapter[] adapters = new ListenerAdapter[mapListenerAdapters.length + 1]; System.arraycopy(mapListenerAdapters, 0, adapters, 0, mapListenerAdapters.length); adapters[mapListenerAdapters.length] = eventLostAdapter; return adapters; }
@Override public IdentifiedDataSerializable create(int typeId, Version version) { if (typeId >= 0 && typeId < len) { ConstructorFunction<Integer, IdentifiedDataSerializable> factory = constructors[typeId]; if (factory == null) { return null; } if (factory instanceof VersionAwareConstructorFunction) { return ((VersionAwareConstructorFunction<Integer, IdentifiedDataSerializable>) factory) .createNew(typeId, version); } else { return factory.createNew(typeId); } } return null; } }
@Override public IdentifiedDataSerializable create(int typeId, Version version) { if (typeId >= 0 && typeId < len) { ConstructorFunction<Integer, IdentifiedDataSerializable> factory = constructors[typeId]; if (factory == null) { return null; } if (factory instanceof VersionAwareConstructorFunction) { return ((VersionAwareConstructorFunction<Integer, IdentifiedDataSerializable>) factory) .createNew(typeId, version); } else { return factory.createNew(typeId); } } return null; } }