com.hazelcast.queue.impl
Class QueueService

java.lang.Object
  extended by com.hazelcast.queue.impl.QueueService
All Implemented Interfaces:
EventPublishingService<QueueEvent,ItemListener>, ManagedService, MigrationAwareService, RemoteService, TransactionalService

public class QueueService
extends Object
implements ManagedService, MigrationAwareService, TransactionalService, RemoteService, EventPublishingService<QueueEvent,ItemListener>

Provides important services via methods for the the Queue such as QueueEvictionProcessor


Field Summary
static String SERVICE_NAME
          Service name.
 
Constructor Summary
QueueService(NodeEngine nodeEngine)
           
 
Method Summary
 void addContainer(String name, QueueContainer container)
           
 String addItemListener(String name, ItemListener listener, boolean includeValue)
           
 void beforeMigration(PartitionMigrationEvent partitionMigrationEvent)
           
 void cancelEviction(String name)
           
 void clearPartitionReplica(int partitionId)
           
 void commitMigration(PartitionMigrationEvent event)
           
 boolean containsQueue(String name)
           
 QueueProxyImpl createDistributedObject(String objectId)
           
 LocalQueueStats createLocalQueueStats(String name, int partitionId)
           
 TransactionalQueueProxy createTransactionalObject(String name, TransactionSupport transaction)
           
 void destroyDistributedObject(String name)
           
 void dispatchEvent(QueueEvent event, ItemListener listener)
           
 LocalQueueStatsImpl getLocalQueueStatsImpl(String name)
           
 NodeEngine getNodeEngine()
           
 QueueContainer getOrCreateContainer(String name, boolean fromBackup)
           
 void init(NodeEngine nodeEngine, Properties properties)
          Initializes this ManagedService
 Operation prepareReplicationOperation(PartitionReplicationEvent event)
           
 boolean removeItemListener(String name, String registrationId)
           
 void reset()
          reset this ManagedService back to initial state.
 void rollbackMigration(PartitionMigrationEvent event)
           
 void rollbackTransaction(String transactionId)
           
 void scheduleEviction(String name, long delay)
           
 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.

See Also:
Constant Field Values
Constructor Detail

QueueService

public QueueService(NodeEngine nodeEngine)
Method Detail

scheduleEviction

public void scheduleEviction(String name,
                             long delay)

cancelEviction

public void cancelEviction(String name)

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

getOrCreateContainer

public QueueContainer getOrCreateContainer(String name,
                                           boolean fromBackup)
                                    throws Exception
Throws:
Exception

addContainer

public void addContainer(String name,
                         QueueContainer container)

containsQueue

public boolean containsQueue(String name)

beforeMigration

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

prepareReplicationOperation

public Operation prepareReplicationOperation(PartitionReplicationEvent event)
Specified by:
prepareReplicationOperation 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

dispatchEvent

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

createDistributedObject

public QueueProxyImpl createDistributedObject(String objectId)
Specified by:
createDistributedObject in interface RemoteService

destroyDistributedObject

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

addItemListener

public String addItemListener(String name,
                              ItemListener listener,
                              boolean includeValue)

removeItemListener

public boolean removeItemListener(String name,
                                  String registrationId)

getNodeEngine

public NodeEngine getNodeEngine()

createLocalQueueStats

public LocalQueueStats createLocalQueueStats(String name,
                                             int partitionId)

getLocalQueueStatsImpl

public LocalQueueStatsImpl getLocalQueueStatsImpl(String name)

createTransactionalObject

public TransactionalQueueProxy createTransactionalObject(String name,
                                                         TransactionSupport transaction)
Specified by:
createTransactionalObject in interface TransactionalService

rollbackTransaction

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


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