Class: Synapse::Configuration::LockingRepositoryDefinitionBuilder Abstract

Inherits:
DefinitionBuilder
  • Object
show all
Defined in:
lib/synapse/configuration/component/repository/locking_repository.rb

Overview

This class is abstract.

Definition builder that serves a base for building specific implementations of a locking repository

Instance Attribute Summary

Attributes inherited from DefinitionBuilder

#id

Instance Method Summary collapse

Methods inherited from DefinitionBuilder

#anonymous, #as_prototype, #as_singleton, build, #build_composite, #build_definition, #clear_tags, #identified_by, #initialize, #register_definition, #replace_tags, #tag, #use_factory, #use_instance

Constructor Details

This class inherits a constructor from Synapse::Configuration::DefinitionBuilder

Instance Method Details

#use_event_bus(event_bus) ⇒ undefined

Changes the event bus used to publish aggregate events to

Parameters:

  • event_bus (Symbol)

Returns:

  • (undefined)

See Also:



15
16
17
# File 'lib/synapse/configuration/component/repository/locking_repository.rb', line 15

def use_event_bus(event_bus)
  @event_bus = event_bus
end

#use_lock_manager(lock_manager) ⇒ undefined

Changes the lock manager used to prevent concurrent aggregate modification

Parameters:

  • lock_manager (Symbol)

Returns:

  • (undefined)

See Also:



48
49
50
# File 'lib/synapse/configuration/component/repository/locking_repository.rb', line 48

def use_lock_manager(lock_manager)
  @lock_manager = lock_manager
end

#use_no_lockingundefined

Uses the lock manager with no locking

Returns:

  • (undefined)

See Also:



23
24
25
# File 'lib/synapse/configuration/component/repository/locking_repository.rb', line 23

def use_no_locking
  @lock_manager_type = Repository::NullLockManager
end

#use_optimistic_lockingundefined

Uses the lock manager with optimistic locking

Returns:

  • (undefined)

See Also:



39
40
41
# File 'lib/synapse/configuration/component/repository/locking_repository.rb', line 39

def use_optimistic_locking
  @lock_manager_type = Repository::OptimisticLockManager
end

#use_pessimistic_lockingundefined

Uses the lock manager with pessimistic locking

Returns:

  • (undefined)

See Also:



31
32
33
# File 'lib/synapse/configuration/component/repository/locking_repository.rb', line 31

def use_pessimistic_locking
  @lock_manager_type = Repository::PessimisticLockManager
end

#use_unit_provider(unit_provider) ⇒ undefined

Changes the provider used to get the current unit of work

Parameters:

  • unit_provider (Symbol)

Returns:

  • (undefined)

See Also:



57
58
59
# File 'lib/synapse/configuration/component/repository/locking_repository.rb', line 57

def use_unit_provider(unit_provider)
  @unit_provider = unit_provider
end