Search in sources :

Example 1 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class QueueDataSerializerHook method createFactory.

public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[TXN_COMMIT_BACKUP + 1];
    constructors[OFFER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new OfferOperation();
        }
    };
    constructors[OFFER_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new OfferBackupOperation();
        }
    };
    constructors[POLL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PollOperation();
        }
    };
    constructors[POLL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PollBackupOperation();
        }
    };
    constructors[PEEK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PeekOperation();
        }
    };
    constructors[ADD_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AddAllBackupOperation();
        }
    };
    constructors[ADD_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AddAllOperation();
        }
    };
    constructors[CLEAR_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ClearBackupOperation();
        }
    };
    constructors[CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ClearOperation();
        }
    };
    constructors[COMPARE_AND_REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CompareAndRemoveBackupOperation();
        }
    };
    constructors[COMPARE_AND_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CompareAndRemoveOperation();
        }
    };
    constructors[CONTAINS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ContainsOperation();
        }
    };
    constructors[DRAIN_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new DrainBackupOperation();
        }
    };
    constructors[DRAIN] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new DrainOperation();
        }
    };
    constructors[ITERATOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new IteratorOperation();
        }
    };
    constructors[QUEUE_EVENT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueEvent();
        }
    };
    constructors[QUEUE_EVENT_FILTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueEventFilter();
        }
    };
    constructors[QUEUE_ITEM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueItem();
        }
    };
    constructors[QUEUE_REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueReplicationOperation();
        }
    };
    constructors[REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemoveBackupOperation();
        }
    };
    constructors[REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemoveOperation();
        }
    };
    constructors[SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SizeOperation();
        }
    };
    constructors[TXN_OFFER_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnOfferBackupOperation();
        }
    };
    constructors[TXN_OFFER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnOfferOperation();
        }
    };
    constructors[TXN_POLL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPollBackupOperation();
        }
    };
    constructors[TXN_POLL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPollOperation();
        }
    };
    constructors[TXN_PREPARE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPrepareBackupOperation();
        }
    };
    constructors[TXN_PREPARE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPrepareOperation();
        }
    };
    constructors[TXN_RESERVE_OFFER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnReserveOfferOperation();
        }
    };
    constructors[TXN_RESERVE_OFFER_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnReserveOfferBackupOperation();
        }
    };
    constructors[TXN_RESERVE_POLL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnReservePollOperation();
        }
    };
    constructors[TXN_RESERVE_POLL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnReservePollBackupOperation();
        }
    };
    constructors[TXN_ROLLBACK_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRollbackBackupOperation();
        }
    };
    constructors[TXN_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnRollbackOperation();
        }
    };
    constructors[CHECK_EVICT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CheckAndEvictOperation();
        }
    };
    constructors[QUEUE_CONTAINER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueContainer(null);
        }
    };
    constructors[TRANSACTION_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueTransactionRollbackOperation();
        }
    };
    constructors[TX_QUEUE_ITEM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxQueueItem();
        }
    };
    constructors[TXN_PEEK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnPeekOperation();
        }
    };
    constructors[IS_EMPTY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new IsEmptyOperation();
        }
    };
    constructors[REMAINING_CAPACITY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RemainingCapacityOperation();
        }
    };
    constructors[TXN_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnCommitOperation();
        }
    };
    constructors[TXN_COMMIT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxnCommitBackupOperation();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : TxnPollBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPollBackupOperation) TxnReservePollBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReservePollBackupOperation) PollBackupOperation(com.hazelcast.collection.impl.queue.operations.PollBackupOperation) ClearBackupOperation(com.hazelcast.collection.impl.queue.operations.ClearBackupOperation) DrainOperation(com.hazelcast.collection.impl.queue.operations.DrainOperation) IteratorOperation(com.hazelcast.collection.impl.queue.operations.IteratorOperation) CompareAndRemoveBackupOperation(com.hazelcast.collection.impl.queue.operations.CompareAndRemoveBackupOperation) TxnReservePollOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReservePollOperation) TxnCommitOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnCommitOperation) TxnPrepareOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPrepareOperation) TxnReserveOfferOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReserveOfferOperation) TxQueueItem(com.hazelcast.collection.impl.txnqueue.TxQueueItem) TxnOfferOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnOfferOperation) SizeOperation(com.hazelcast.collection.impl.queue.operations.SizeOperation) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) TxnRollbackOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnRollbackOperation) ContainsOperation(com.hazelcast.collection.impl.queue.operations.ContainsOperation) TxnPeekOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPeekOperation) CompareAndRemoveOperation(com.hazelcast.collection.impl.queue.operations.CompareAndRemoveOperation) RemoveOperation(com.hazelcast.collection.impl.queue.operations.RemoveOperation) CompareAndRemoveOperation(com.hazelcast.collection.impl.queue.operations.CompareAndRemoveOperation) TxnPeekOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPeekOperation) PeekOperation(com.hazelcast.collection.impl.queue.operations.PeekOperation) PollOperation(com.hazelcast.collection.impl.queue.operations.PollOperation) TxnReservePollOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReservePollOperation) TxnPollOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPollOperation) TxQueueItem(com.hazelcast.collection.impl.txnqueue.TxQueueItem) TxnRollbackBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnRollbackBackupOperation) RemoveBackupOperation(com.hazelcast.collection.impl.queue.operations.RemoveBackupOperation) CompareAndRemoveBackupOperation(com.hazelcast.collection.impl.queue.operations.CompareAndRemoveBackupOperation) RemainingCapacityOperation(com.hazelcast.collection.impl.queue.operations.RemainingCapacityOperation) TxnPollOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPollOperation) TxnReserveOfferBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReserveOfferBackupOperation) TxnOfferBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnOfferBackupOperation) OfferBackupOperation(com.hazelcast.collection.impl.queue.operations.OfferBackupOperation) AddAllOperation(com.hazelcast.collection.impl.queue.operations.AddAllOperation) QueueReplicationOperation(com.hazelcast.collection.impl.queue.operations.QueueReplicationOperation) TxnPrepareBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPrepareBackupOperation) AddAllBackupOperation(com.hazelcast.collection.impl.queue.operations.AddAllBackupOperation) IsEmptyOperation(com.hazelcast.collection.impl.queue.operations.IsEmptyOperation) TxnPollBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnPollBackupOperation) TxnReserveOfferBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReserveOfferBackupOperation) TxnReservePollBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReservePollBackupOperation) CheckAndEvictOperation(com.hazelcast.collection.impl.queue.operations.CheckAndEvictOperation) TxnReserveOfferOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnReserveOfferOperation) TxnOfferOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnOfferOperation) OfferOperation(com.hazelcast.collection.impl.queue.operations.OfferOperation) TxnOfferBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnOfferBackupOperation) ClearOperation(com.hazelcast.collection.impl.queue.operations.ClearOperation) ConstructorFunction(com.hazelcast.util.ConstructorFunction) QueueTransactionRollbackOperation(com.hazelcast.collection.impl.txnqueue.operations.QueueTransactionRollbackOperation) TxnCommitBackupOperation(com.hazelcast.collection.impl.txnqueue.operations.TxnCommitBackupOperation) DrainBackupOperation(com.hazelcast.collection.impl.queue.operations.DrainBackupOperation) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)

Example 2 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class CacheDataSerializerHook method createFactory.

public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
    constructors[GET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetOperation();
        }
    };
    constructors[CONTAINS_KEY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheContainsKeyOperation();
        }
    };
    constructors[PUT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePutOperation();
        }
    };
    constructors[PUT_IF_ABSENT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePutIfAbsentOperation();
        }
    };
    constructors[REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheRemoveOperation();
        }
    };
    constructors[GET_AND_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetAndRemoveOperation();
        }
    };
    constructors[REPLACE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheReplaceOperation();
        }
    };
    constructors[GET_AND_REPLACE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetAndReplaceOperation();
        }
    };
    constructors[PUT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePutBackupOperation();
        }
    };
    constructors[PUT_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePutAllBackupOperation();
        }
    };
    constructors[REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheRemoveBackupOperation();
        }
    };
    constructors[SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheSizeOperation();
        }
    };
    constructors[SIZE_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheSizeOperationFactory();
        }
    };
    constructors[CLEAR_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheClearOperationFactory();
        }
    };
    constructors[GET_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetAllOperation();
        }
    };
    constructors[GET_ALL_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetAllOperationFactory();
        }
    };
    constructors[LOAD_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheLoadAllOperation();
        }
    };
    constructors[LOAD_ALL_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheLoadAllOperationFactory();
        }
    };
    constructors[EXPIRY_POLICY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new HazelcastExpiryPolicy();
        }
    };
    constructors[KEY_ITERATOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheKeyIteratorOperation();
        }
    };
    constructors[KEY_ITERATION_RESULT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheKeyIterationResult();
        }
    };
    constructors[ENTRY_PROCESSOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheEntryProcessorOperation();
        }
    };
    constructors[CLEAR_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheClearResponse();
        }
    };
    constructors[CREATE_CONFIG] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheCreateConfigOperation();
        }
    };
    constructors[GET_CONFIG] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetConfigOperation();
        }
    };
    constructors[MANAGEMENT_CONFIG] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheManagementConfigOperation();
        }
    };
    constructors[LISTENER_REGISTRATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheListenerRegistrationOperation();
        }
    };
    constructors[DESTROY_CACHE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheDestroyOperation();
        }
    };
    constructors[CACHE_EVENT_DATA] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheEventDataImpl();
        }
    };
    constructors[CACHE_EVENT_DATA_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheEventSet();
        }
    };
    constructors[BACKUP_ENTRY_PROCESSOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        @Override
        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheBackupEntryProcessorOperation();
        }
    };
    constructors[CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheClearOperation();
        }
    };
    constructors[CLEAR_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheClearBackupOperation();
        }
    };
    constructors[REMOVE_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheRemoveAllOperation();
        }
    };
    constructors[REMOVE_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheRemoveAllBackupOperation();
        }
    };
    constructors[REMOVE_ALL_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheRemoveAllOperationFactory();
        }
    };
    constructors[PUT_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePutAllOperation();
        }
    };
    constructors[MERGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheMergeOperation();
        }
    };
    constructors[ENTRY_ITERATOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheEntryIteratorOperation();
        }
    };
    constructors[ENTRY_ITERATION_RESULT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheEntryIterationResult();
        }
    };
    constructors[CACHE_PARTITION_LOST_EVENT_FILTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePartitionLostEventFilter();
        }
    };
    constructors[DEFAULT_CACHE_ENTRY_VIEW] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new DefaultCacheEntryView();
        }
    };
    constructors[CACHE_REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheReplicationOperation();
        }
    };
    constructors[CACHE_POST_JOIN] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PostJoinCacheOperation();
        }
    };
    constructors[CACHE_DATA_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheDataRecord();
        }
    };
    constructors[CACHE_OBJECT_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheObjectRecord();
        }
    };
    constructors[CACHE_PARTITION_EVENT_DATA] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CachePartitionEventData();
        }
    };
    constructors[CACHE_INVALIDATION_METADATA] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetInvalidationMetaDataOperation();
        }
    };
    constructors[CACHE_INVALIDATION_METADATA_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheGetInvalidationMetaDataOperation.MetaDataResponse();
        }
    };
    constructors[CACHE_ASSIGN_AND_GET_UUIDS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheAssignAndGetUuidsOperation();
        }
    };
    constructors[CACHE_ASSIGN_AND_GET_UUIDS_FACTORY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheAssignAndGetUuidsOperationFactory();
        }
    };
    constructors[CACHE_NEAR_CACHE_STATE_HOLDER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheNearCacheStateHolder();
        }
    };
    constructors[CACHE_EVENT_LISTENER_ADAPTOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CacheEventListenerAdaptor();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : CacheGetOperation(com.hazelcast.cache.impl.operation.CacheGetOperation) CacheLoadAllOperation(com.hazelcast.cache.impl.operation.CacheLoadAllOperation) CacheEntryIteratorOperation(com.hazelcast.cache.impl.operation.CacheEntryIteratorOperation) CacheCreateConfigOperation(com.hazelcast.cache.impl.operation.CacheCreateConfigOperation) CacheRemoveAllOperationFactory(com.hazelcast.cache.impl.operation.CacheRemoveAllOperationFactory) HazelcastExpiryPolicy(com.hazelcast.cache.HazelcastExpiryPolicy) CacheAssignAndGetUuidsOperationFactory(com.hazelcast.client.impl.protocol.task.cache.CacheAssignAndGetUuidsOperationFactory) CacheGetAndRemoveOperation(com.hazelcast.cache.impl.operation.CacheGetAndRemoveOperation) CacheGetAllOperationFactory(com.hazelcast.cache.impl.operation.CacheGetAllOperationFactory) CacheEntryProcessorOperation(com.hazelcast.cache.impl.operation.CacheEntryProcessorOperation) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) CacheRemoveAllOperation(com.hazelcast.cache.impl.operation.CacheRemoveAllOperation) CacheAssignAndGetUuidsOperation(com.hazelcast.client.impl.protocol.task.cache.CacheAssignAndGetUuidsOperation) CachePutOperation(com.hazelcast.cache.impl.operation.CachePutOperation) CacheReplicationOperation(com.hazelcast.cache.impl.operation.CacheReplicationOperation) CacheClearOperation(com.hazelcast.cache.impl.operation.CacheClearOperation) CachePutAllBackupOperation(com.hazelcast.cache.impl.operation.CachePutAllBackupOperation) CacheSizeOperationFactory(com.hazelcast.cache.impl.operation.CacheSizeOperationFactory) CacheGetAndReplaceOperation(com.hazelcast.cache.impl.operation.CacheGetAndReplaceOperation) DefaultCacheEntryView(com.hazelcast.cache.impl.merge.entry.DefaultCacheEntryView) CacheRemoveBackupOperation(com.hazelcast.cache.impl.operation.CacheRemoveBackupOperation) CacheGetAllOperation(com.hazelcast.cache.impl.operation.CacheGetAllOperation) CacheObjectRecord(com.hazelcast.cache.impl.record.CacheObjectRecord) CacheDestroyOperation(com.hazelcast.cache.impl.operation.CacheDestroyOperation) CacheNearCacheStateHolder(com.hazelcast.cache.impl.operation.CacheNearCacheStateHolder) CacheLoadAllOperationFactory(com.hazelcast.cache.impl.operation.CacheLoadAllOperationFactory) CacheSizeOperation(com.hazelcast.cache.impl.operation.CacheSizeOperation) CacheClearBackupOperation(com.hazelcast.cache.impl.operation.CacheClearBackupOperation) CachePutIfAbsentOperation(com.hazelcast.cache.impl.operation.CachePutIfAbsentOperation) CacheGetInvalidationMetaDataOperation(com.hazelcast.cache.impl.operation.CacheGetInvalidationMetaDataOperation) CacheRemoveAllBackupOperation(com.hazelcast.cache.impl.operation.CacheRemoveAllBackupOperation) CacheListenerRegistrationOperation(com.hazelcast.cache.impl.operation.CacheListenerRegistrationOperation) CacheKeyIteratorOperation(com.hazelcast.cache.impl.operation.CacheKeyIteratorOperation) CacheContainsKeyOperation(com.hazelcast.cache.impl.operation.CacheContainsKeyOperation) CachePutBackupOperation(com.hazelcast.cache.impl.operation.CachePutBackupOperation) PostJoinCacheOperation(com.hazelcast.cache.impl.operation.PostJoinCacheOperation) CacheRemoveOperation(com.hazelcast.cache.impl.operation.CacheRemoveOperation) CacheClearOperationFactory(com.hazelcast.cache.impl.operation.CacheClearOperationFactory) ConstructorFunction(com.hazelcast.util.ConstructorFunction) CacheBackupEntryProcessorOperation(com.hazelcast.cache.impl.operation.CacheBackupEntryProcessorOperation) CacheReplaceOperation(com.hazelcast.cache.impl.operation.CacheReplaceOperation) CacheManagementConfigOperation(com.hazelcast.cache.impl.operation.CacheManagementConfigOperation) CacheDataRecord(com.hazelcast.cache.impl.record.CacheDataRecord) CacheGetConfigOperation(com.hazelcast.cache.impl.operation.CacheGetConfigOperation) CachePutAllOperation(com.hazelcast.cache.impl.operation.CachePutAllOperation) CachePartitionLostEventFilter(com.hazelcast.cache.impl.event.CachePartitionLostEventFilter) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) CacheMergeOperation(com.hazelcast.cache.impl.operation.CacheMergeOperation)

Example 3 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class CollectionDataSerializerHook method createFactory.

@Override
public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[QUEUE_TRANSACTION_LOG_RECORD + 1];
    constructors[COLLECTION_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddOperation();
        }
    };
    constructors[COLLECTION_ADD_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddBackupOperation();
        }
    };
    constructors[LIST_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListAddOperation();
        }
    };
    constructors[LIST_GET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListGetOperation();
        }
    };
    constructors[COLLECTION_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRemoveOperation();
        }
    };
    constructors[COLLECTION_REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRemoveBackupOperation();
        }
    };
    constructors[COLLECTION_SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionSizeOperation();
        }
    };
    constructors[COLLECTION_CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionClearOperation();
        }
    };
    constructors[COLLECTION_CLEAR_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionClearBackupOperation();
        }
    };
    constructors[LIST_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListSetOperation();
        }
    };
    constructors[LIST_SET_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListSetBackupOperation();
        }
    };
    constructors[LIST_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListRemoveOperation();
        }
    };
    constructors[LIST_INDEX_OF] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListIndexOfOperation();
        }
    };
    constructors[COLLECTION_CONTAINS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionContainsOperation();
        }
    };
    constructors[COLLECTION_ADD_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddAllOperation();
        }
    };
    constructors[COLLECTION_ADD_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddAllBackupOperation();
        }
    };
    constructors[LIST_ADD_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListAddAllOperation();
        }
    };
    constructors[LIST_SUB] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListSubOperation();
        }
    };
    constructors[COLLECTION_COMPARE_AND_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionCompareAndRemoveOperation();
        }
    };
    constructors[COLLECTION_GET_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionGetAllOperation();
        }
    };
    constructors[COLLECTION_EVENT_FILTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionEventFilter();
        }
    };
    constructors[COLLECTION_EVENT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionEvent();
        }
    };
    constructors[COLLECTION_ITEM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionItem();
        }
    };
    constructors[COLLECTION_RESERVE_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionReserveAddOperation();
        }
    };
    constructors[COLLECTION_RESERVE_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionReserveRemoveOperation();
        }
    };
    constructors[COLLECTION_TXN_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnAddOperation();
        }
    };
    constructors[COLLECTION_TXN_ADD_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnAddBackupOperation();
        }
    };
    constructors[COLLECTION_TXN_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnRemoveOperation();
        }
    };
    constructors[COLLECTION_TXN_REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnRemoveBackupOperation();
        }
    };
    constructors[COLLECTION_PREPARE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionPrepareOperation();
        }
    };
    constructors[COLLECTION_PREPARE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionPrepareBackupOperation();
        }
    };
    constructors[COLLECTION_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRollbackOperation();
        }
    };
    constructors[COLLECTION_ROLLBACK_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRollbackBackupOperation();
        }
    };
    constructors[TX_COLLECTION_ITEM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxCollectionItem();
        }
    };
    constructors[TX_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTransactionRollbackOperation();
        }
    };
    constructors[LIST_REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListReplicationOperation();
        }
    };
    constructors[SET_REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SetReplicationOperation();
        }
    };
    constructors[COLLECTION_IS_EMPTY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionIsEmptyOperation();
        }
    };
    constructors[TXN_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionCommitOperation();
        }
    };
    constructors[TXN_COMMIT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionCommitBackupOperation();
        }
    };
    constructors[SET_CONTAINER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SetContainer();
        }
    };
    constructors[LIST_CONTAINER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListContainer();
        }
    };
    constructors[COLLECTION_TRANSACTION_LOG_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTransactionLogRecord();
        }
    };
    constructors[QUEUE_TRANSACTION_LOG_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueTransactionLogRecord();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : CollectionAddAllBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddAllBackupOperation) ListAddAllOperation(com.hazelcast.collection.impl.list.operations.ListAddAllOperation) CollectionTransactionLogRecord(com.hazelcast.collection.impl.txncollection.CollectionTransactionLogRecord) CollectionReserveAddOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionReserveAddOperation) ListSetBackupOperation(com.hazelcast.collection.impl.list.operations.ListSetBackupOperation) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) CollectionClearBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionClearBackupOperation) ListReplicationOperation(com.hazelcast.collection.impl.list.operations.ListReplicationOperation) CollectionPrepareBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionPrepareBackupOperation) ListGetOperation(com.hazelcast.collection.impl.list.operations.ListGetOperation) CollectionTransactionRollbackOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTransactionRollbackOperation) CollectionRollbackOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionRollbackOperation) ListIndexOfOperation(com.hazelcast.collection.impl.list.operations.ListIndexOfOperation) SetReplicationOperation(com.hazelcast.collection.impl.set.operations.SetReplicationOperation) CollectionContainsOperation(com.hazelcast.collection.impl.collection.operations.CollectionContainsOperation) CollectionCompareAndRemoveOperation(com.hazelcast.collection.impl.collection.operations.CollectionCompareAndRemoveOperation) CollectionClearOperation(com.hazelcast.collection.impl.collection.operations.CollectionClearOperation) CollectionTxnAddBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnAddBackupOperation) CollectionAddBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddBackupOperation) CollectionSizeOperation(com.hazelcast.collection.impl.collection.operations.CollectionSizeOperation) CollectionCommitOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionCommitOperation) CollectionGetAllOperation(com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation) CollectionAddOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddOperation) SetContainer(com.hazelcast.collection.impl.set.SetContainer) CollectionTxnAddOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnAddOperation) CollectionRemoveOperation(com.hazelcast.collection.impl.collection.operations.CollectionRemoveOperation) ListContainer(com.hazelcast.collection.impl.list.ListContainer) ListAddOperation(com.hazelcast.collection.impl.list.operations.ListAddOperation) CollectionIsEmptyOperation(com.hazelcast.collection.impl.collection.operations.CollectionIsEmptyOperation) QueueTransactionLogRecord(com.hazelcast.collection.impl.txnqueue.QueueTransactionLogRecord) CollectionReserveRemoveOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionReserveRemoveOperation) CollectionTxnRemoveBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnRemoveBackupOperation) CollectionRemoveBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionRemoveBackupOperation) CollectionPrepareOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionPrepareOperation) ConstructorFunction(com.hazelcast.util.ConstructorFunction) ListSubOperation(com.hazelcast.collection.impl.list.operations.ListSubOperation) CollectionTxnRemoveOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnRemoveOperation) CollectionAddAllOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddAllOperation) CollectionRollbackBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionRollbackBackupOperation) ListSetOperation(com.hazelcast.collection.impl.list.operations.ListSetOperation) ListRemoveOperation(com.hazelcast.collection.impl.list.operations.ListRemoveOperation) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) CollectionCommitBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionCommitBackupOperation)

Example 4 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class ClusterDataSerializerHook method createFactory.

@Override
public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
    constructors[AUTH_FAILURE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AuthenticationFailureOperation();
        }
    };
    constructors[ADDRESS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new Address();
        }
    };
    constructors[MEMBER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MemberImpl();
        }
    };
    constructors[HEARTBEAT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new HeartbeatOperation();
        }
    };
    constructors[CONFIG_CHECK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ConfigCheck();
        }
    };
    constructors[BIND_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new BindMessage();
        }
    };
    constructors[MEMBER_INFO_UPDATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MemberInfoUpdateOperation();
        }
    };
    constructors[FINALIZE_JOIN] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new FinalizeJoinOperation();
        }
    };
    constructors[AUTHORIZATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AuthorizationOperation();
        }
    };
    constructors[BEFORE_JOIN_CHECK_FAILURE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new BeforeJoinCheckFailureOperation();
        }
    };
    constructors[CHANGE_CLUSTER_STATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ChangeClusterStateOperation();
        }
    };
    constructors[CONFIG_MISMATCH] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ConfigMismatchOperation();
        }
    };
    constructors[GROUP_MISMATCH] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new GroupMismatchOperation();
        }
    };
    constructors[SPLIT_BRAIN_MERGE_VALIDATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SplitBrainMergeValidationOperation();
        }
    };
    constructors[JOIN_REQUEST_OP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new JoinRequestOperation();
        }
    };
    constructors[LOCK_CLUSTER_STATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new LockClusterStateOperation();
        }
    };
    constructors[MASTER_CLAIM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MasterClaimOperation();
        }
    };
    constructors[MASTER_CONFIRM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MasterConfirmationOperation();
        }
    };
    constructors[MASTER_DISCOVERY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MasterDiscoveryOperation();
        }
    };
    constructors[MEMBER_ATTR_CHANGED] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MemberAttributeChangedOperation();
        }
    };
    constructors[MEMBER_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MemberRemoveOperation();
        }
    };
    constructors[MERGE_CLUSTERS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MergeClustersOperation();
        }
    };
    constructors[POST_JOIN] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PostJoinOperation();
        }
    };
    constructors[ROLLBACK_CLUSTER_STATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new RollbackClusterStateOperation();
        }
    };
    constructors[SET_MASTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SetMasterOperation();
        }
    };
    constructors[SHUTDOWN_NODE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ShutdownNodeOperation();
        }
    };
    constructors[TRIGGER_MEMBER_LIST_PUBLISH] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TriggerMemberListPublishOperation();
        }
    };
    constructors[CLUSTER_STATE_TRANSACTION_LOG_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ClusterStateTransactionLogRecord();
        }
    };
    constructors[MEMBER_INFO] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MemberInfo();
        }
    };
    constructors[JOIN_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new JoinMessage();
        }
    };
    constructors[JOIN_REQUEST] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new JoinRequest();
        }
    };
    constructors[MIGRATION_INFO] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MigrationInfo();
        }
    };
    constructors[MEMBER_VERSION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MemberVersion();
        }
    };
    constructors[CLUSTER_STATE_CHANGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ClusterStateChange();
        }
    };
    constructors[SPLIT_BRAIN_JOIN_MESSAGE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SplitBrainJoinMessage();
        }
    };
    constructors[VERSION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new Version();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : MemberAttributeChangedOperation(com.hazelcast.internal.cluster.impl.operations.MemberAttributeChangedOperation) MigrationInfo(com.hazelcast.internal.partition.MigrationInfo) Address(com.hazelcast.nio.Address) MergeClustersOperation(com.hazelcast.internal.cluster.impl.operations.MergeClustersOperation) PostJoinOperation(com.hazelcast.internal.cluster.impl.operations.PostJoinOperation) SetMasterOperation(com.hazelcast.internal.cluster.impl.operations.SetMasterOperation) MemberVersion(com.hazelcast.version.MemberVersion) TriggerMemberListPublishOperation(com.hazelcast.internal.cluster.impl.operations.TriggerMemberListPublishOperation) MasterDiscoveryOperation(com.hazelcast.internal.cluster.impl.operations.MasterDiscoveryOperation) ConfigMismatchOperation(com.hazelcast.internal.cluster.impl.operations.ConfigMismatchOperation) MemberInfo(com.hazelcast.internal.cluster.MemberInfo) SplitBrainMergeValidationOperation(com.hazelcast.internal.cluster.impl.operations.SplitBrainMergeValidationOperation) Version(com.hazelcast.version.Version) MemberVersion(com.hazelcast.version.MemberVersion) BeforeJoinCheckFailureOperation(com.hazelcast.internal.cluster.impl.operations.BeforeJoinCheckFailureOperation) ChangeClusterStateOperation(com.hazelcast.internal.cluster.impl.operations.ChangeClusterStateOperation) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) LockClusterStateOperation(com.hazelcast.internal.cluster.impl.operations.LockClusterStateOperation) MemberImpl(com.hazelcast.instance.MemberImpl) MemberRemoveOperation(com.hazelcast.internal.cluster.impl.operations.MemberRemoveOperation) HeartbeatOperation(com.hazelcast.internal.cluster.impl.operations.HeartbeatOperation) MasterClaimOperation(com.hazelcast.internal.cluster.impl.operations.MasterClaimOperation) ShutdownNodeOperation(com.hazelcast.internal.cluster.impl.operations.ShutdownNodeOperation) ConstructorFunction(com.hazelcast.util.ConstructorFunction) MemberInfoUpdateOperation(com.hazelcast.internal.cluster.impl.operations.MemberInfoUpdateOperation) GroupMismatchOperation(com.hazelcast.internal.cluster.impl.operations.GroupMismatchOperation) FinalizeJoinOperation(com.hazelcast.internal.cluster.impl.operations.FinalizeJoinOperation) AuthorizationOperation(com.hazelcast.internal.cluster.impl.operations.AuthorizationOperation) MasterConfirmationOperation(com.hazelcast.internal.cluster.impl.operations.MasterConfirmationOperation) AuthenticationFailureOperation(com.hazelcast.internal.cluster.impl.operations.AuthenticationFailureOperation) JoinRequestOperation(com.hazelcast.internal.cluster.impl.operations.JoinRequestOperation) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) RollbackClusterStateOperation(com.hazelcast.internal.cluster.impl.operations.RollbackClusterStateOperation)

Example 5 with IdentifiedDataSerializable

use of com.hazelcast.nio.serialization.IdentifiedDataSerializable in project hazelcast by hazelcast.

the class PartitionDataSerializerHook method createFactory.

@Override
public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
    constructors[PARTITION_RUNTIME_STATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PartitionRuntimeState();
        }
    };
    constructors[ASSIGN_PARTITIONS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new AssignPartitions();
        }
    };
    constructors[CHECK_REPLICA_VERSION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CheckReplicaVersion();
        }
    };
    constructors[FETCH_PARTITION_STATE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new FetchPartitionStateOperation();
        }
    };
    constructors[HAS_ONGOING_MIGRATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new HasOngoingMigration();
        }
    };
    constructors[MIGRATION_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MigrationCommitOperation();
        }
    };
    constructors[MIGRATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MigrationOperation();
        }
    };
    constructors[MIGRATION_REQUEST] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new MigrationRequestOperation();
        }
    };
    constructors[PARTITION_STATE_OP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PartitionStateOperation();
        }
    };
    constructors[PROMOTION_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new PromotionCommitOperation();
        }
    };
    constructors[REPLICA_SYNC_REQUEST] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ReplicaSyncRequest();
        }
    };
    constructors[REPLICA_SYNC_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ReplicaSyncResponse();
        }
    };
    constructors[REPLICA_SYNC_RETRY_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ReplicaSyncRetryResponse();
        }
    };
    constructors[SAFE_STATE_CHECK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SafeStateCheckOperation();
        }
    };
    constructors[SHUTDOWN_REQUEST] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ShutdownRequestOperation();
        }
    };
    constructors[SHUTDOWN_RESPONSE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ShutdownResponseOperation();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) HasOngoingMigration(com.hazelcast.internal.partition.operation.HasOngoingMigration) ShutdownResponseOperation(com.hazelcast.internal.partition.operation.ShutdownResponseOperation) MigrationOperation(com.hazelcast.internal.partition.operation.MigrationOperation) MigrationRequestOperation(com.hazelcast.internal.partition.operation.MigrationRequestOperation) AssignPartitions(com.hazelcast.internal.partition.operation.AssignPartitions) CheckReplicaVersion(com.hazelcast.internal.partition.operation.CheckReplicaVersion) FetchPartitionStateOperation(com.hazelcast.internal.partition.operation.FetchPartitionStateOperation) PartitionStateOperation(com.hazelcast.internal.partition.operation.PartitionStateOperation) ConstructorFunction(com.hazelcast.util.ConstructorFunction) ReplicaSyncRequest(com.hazelcast.internal.partition.operation.ReplicaSyncRequest) MigrationCommitOperation(com.hazelcast.internal.partition.operation.MigrationCommitOperation) PromotionCommitOperation(com.hazelcast.internal.partition.operation.PromotionCommitOperation) ReplicaSyncRetryResponse(com.hazelcast.internal.partition.operation.ReplicaSyncRetryResponse) SafeStateCheckOperation(com.hazelcast.internal.partition.operation.SafeStateCheckOperation) PartitionRuntimeState(com.hazelcast.internal.partition.PartitionRuntimeState) ReplicaSyncResponse(com.hazelcast.internal.partition.operation.ReplicaSyncResponse) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) ShutdownRequestOperation(com.hazelcast.internal.partition.operation.ShutdownRequestOperation) FetchPartitionStateOperation(com.hazelcast.internal.partition.operation.FetchPartitionStateOperation)

Aggregations

IdentifiedDataSerializable (com.hazelcast.nio.serialization.IdentifiedDataSerializable)18 ConstructorFunction (com.hazelcast.util.ConstructorFunction)14 ArrayDataSerializableFactory (com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory)13 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 HazelcastExpiryPolicy (com.hazelcast.cache.HazelcastExpiryPolicy)1 CachePartitionLostEventFilter (com.hazelcast.cache.impl.event.CachePartitionLostEventFilter)1 DefaultCacheEntryView (com.hazelcast.cache.impl.merge.entry.DefaultCacheEntryView)1 CacheBackupEntryProcessorOperation (com.hazelcast.cache.impl.operation.CacheBackupEntryProcessorOperation)1 CacheClearBackupOperation (com.hazelcast.cache.impl.operation.CacheClearBackupOperation)1 CacheClearOperation (com.hazelcast.cache.impl.operation.CacheClearOperation)1 CacheClearOperationFactory (com.hazelcast.cache.impl.operation.CacheClearOperationFactory)1 CacheContainsKeyOperation (com.hazelcast.cache.impl.operation.CacheContainsKeyOperation)1 CacheCreateConfigOperation (com.hazelcast.cache.impl.operation.CacheCreateConfigOperation)1 CacheDestroyOperation (com.hazelcast.cache.impl.operation.CacheDestroyOperation)1 CacheEntryIteratorOperation (com.hazelcast.cache.impl.operation.CacheEntryIteratorOperation)1 CacheEntryProcessorOperation (com.hazelcast.cache.impl.operation.CacheEntryProcessorOperation)1 CacheGetAllOperation (com.hazelcast.cache.impl.operation.CacheGetAllOperation)1 CacheGetAllOperationFactory (com.hazelcast.cache.impl.operation.CacheGetAllOperationFactory)1