com.hazelcast.map.impl
Class MapService

java.lang.Object
  extended by com.hazelcast.map.impl.MapService
All Implemented Interfaces:
EventPublishingService<EventData,EntryListener>, ManagedService, MigrationAwareService, PostJoinAwareService, RemoteService, ReplicationSupportingService, SplitBrainHandlerService, TransactionalService

public final class MapService
extends Object
implements ManagedService, MigrationAwareService, TransactionalService, RemoteService, EventPublishingService<EventData,EntryListener>, PostJoinAwareService, SplitBrainHandlerService, ReplicationSupportingService

Defines map service behavior.

See Also:
MapManagedService, MapMigrationAwareService, MapTransactionalService, MapRemoteService, MapEventPublishingService, MapPostJoinAwareService, MapSplitBrainHandlerService, MapReplicationSupportingService

Field Summary
static String SERVICE_NAME
          Service name of map service used to register ServiceManager.registerService(java.lang.String, java.lang.Object)
 
Method Summary
 void beforeMigration(PartitionMigrationEvent event)
           
 void clearPartitionReplica(int partitionId)
           
 void commitMigration(PartitionMigrationEvent event)
           
static MapService create(NodeEngine nodeEngine)
          Static factory method which creates a new map service object.
 DistributedObject createDistributedObject(String objectName)
           
<T extends TransactionalObject>
T
createTransactionalObject(String name, TransactionSupport transaction)
           
 void destroyDistributedObject(String objectName)
           
 void dispatchEvent(EventData event, EntryListener listener)
           
 MapServiceContext getMapServiceContext()
           
 Operation getPostJoinOperation()
          Post join operations must be lock free; means no locks at all; no partition locks, no key-based locks, no service level locks or no database interaction!
 void init(NodeEngine nodeEngine, Properties properties)
          Initializes this ManagedService
 void onReplicationEvent(WanReplicationEvent replicationEvent)
           
 Runnable prepareMergeRunnable()
           
 Operation prepareReplicationOperation(PartitionReplicationEvent event)
           
 void reset()
          reset this ManagedService back to initial state.
 void rollbackMigration(PartitionMigrationEvent event)
           
 void rollbackTransaction(String transactionId)
           
 void setMapServiceContext(MapServiceContext mapServiceContext)
           
 void shutdown(boolean terminate)
          Shuts down this ManagedService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
Service name of map service used to register ServiceManager.registerService(java.lang.String, java.lang.Object)

See Also:
Constant Field Values
Method Detail

dispatchEvent

public void dispatchEvent(EventData event,
                          EntryListener listener)
Specified by:
dispatchEvent in interface EventPublishingService<EventData,EntryListener>

init

public void init(NodeEngine nodeEngine,
                 Properties properties)
Description copied from interface: ManagedService
Initializes this ManagedService

Specified by:
init in interface ManagedService
Parameters:
nodeEngine - the NodeEngine this ManagedService belongs to.
properties - the Properties. Can be used to pass settings to the service.

reset

public void reset()
Description copied from interface: ManagedService
reset this ManagedService back to initial state. todo: what is the purpose of reset

Specified by:
reset in interface ManagedService

shutdown

public void shutdown(boolean terminate)
Description copied from interface: ManagedService
Shuts down this ManagedService. todo: what is the purpose of the terminate variable.

Specified by:
shutdown in interface ManagedService

prepareReplicationOperation

public Operation prepareReplicationOperation(PartitionReplicationEvent event)
Specified by:
prepareReplicationOperation in interface MigrationAwareService

beforeMigration

public void beforeMigration(PartitionMigrationEvent event)
Specified by:
beforeMigration in interface MigrationAwareService

commitMigration

public void commitMigration(PartitionMigrationEvent event)
Specified by:
commitMigration in interface MigrationAwareService

rollbackMigration

public void rollbackMigration(PartitionMigrationEvent event)
Specified by:
rollbackMigration in interface MigrationAwareService

clearPartitionReplica

public void clearPartitionReplica(int partitionId)
Specified by:
clearPartitionReplica in interface MigrationAwareService

getPostJoinOperation

public Operation getPostJoinOperation()
Description copied from interface: PostJoinAwareService
Post join operations must be lock free; means no locks at all; no partition locks, no key-based locks, no service level locks or no database interaction!

Post join operations should return response, at least a null response.

Specified by:
getPostJoinOperation in interface PostJoinAwareService

createDistributedObject

public DistributedObject createDistributedObject(String objectName)
Specified by:
createDistributedObject in interface RemoteService

destroyDistributedObject

public void destroyDistributedObject(String objectName)
Specified by:
destroyDistributedObject in interface RemoteService

onReplicationEvent

public void onReplicationEvent(WanReplicationEvent replicationEvent)
Specified by:
onReplicationEvent in interface ReplicationSupportingService

prepareMergeRunnable

public Runnable prepareMergeRunnable()
Specified by:
prepareMergeRunnable in interface SplitBrainHandlerService

createTransactionalObject

public <T extends TransactionalObject> T createTransactionalObject(String name,
                                                                   TransactionSupport transaction)
Specified by:
createTransactionalObject in interface TransactionalService

rollbackTransaction

public void rollbackTransaction(String transactionId)
Specified by:
rollbackTransaction in interface TransactionalService

setMapServiceContext

public void setMapServiceContext(MapServiceContext mapServiceContext)

getMapServiceContext

public MapServiceContext getMapServiceContext()

create

public static MapService create(NodeEngine nodeEngine)
Static factory method which creates a new map service object.

Parameters:
nodeEngine - node engine.
Returns:
new map service object.


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.