Method: Sequent::Configuration#initialize

Defined in:
lib/sequent/configuration.rb

#initializeConfiguration

Returns a new instance of Configuration.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/sequent/configuration.rb', line 88

def initialize
  self.command_handlers = []
  self.command_filters = []
  self.event_handlers = []
  self.command_middleware = Sequent::Core::Middleware::Chain.new

  self.aggregate_repository = Sequent::Core::AggregateRepository.new
  self.event_store = Sequent::Core::EventStore.new
  self.command_service = Sequent::Core::CommandService.new
  self.event_record_class = Sequent::Core::EventRecord
  self.snapshot_record_class = Sequent::Core::SnapshotRecord
  self.stream_record_class = Sequent::Core::StreamRecord
  self.transaction_provider = Sequent::Core::Transactions::ActiveRecordTransactionProvider.new
  self.uuid_generator = Sequent::Core::RandomUuidGenerator
  self.event_publisher = Sequent::Core::EventPublisher.new
  self.disable_event_handlers = false
  self.versions_table_name = DEFAULT_VERSIONS_TABLE_NAME
  self.migration_sql_files_directory = DEFAULT_MIGRATION_SQL_FILES_DIRECTORY
  self.view_schema_name = DEFAULT_VIEW_SCHEMA_NAME
  self.event_store_schema_name = DEFAULT_EVENT_STORE_SCHEMA_NAME
  self.migrations_class_name = MIGRATIONS_CLASS_NAME
  self.number_of_replay_processes = DEFAULT_NUMBER_OF_REPLAY_PROCESSES
  self.replay_group_target_size = DEFAULT_REPLAY_GROUP_TARGET_SIZE

  self.event_record_hooks_class = DEFAULT_EVENT_RECORD_HOOKS_CLASS

  self.offline_replay_persistor_class = DEFAULT_OFFLINE_REPLAY_PERSISTOR_CLASS
  self.online_replay_persistor_class = DEFAULT_ONLINE_REPLAY_PERSISTOR_CLASS
  self.database_config_directory = DEFAULT_DATABASE_CONFIG_DIRECTORY
  self.database_schema_directory = DEFAULT_DATABASE_SCHEMA_DIRECTORY
  self.strict_check_attributes_on_apply_events = DEFAULT_STRICT_CHECK_ATTRIBUTES_ON_APPLY_EVENTS

  self.logger = Logger.new(STDOUT).tap { |l| l.level = Logger::INFO }
  self.error_locale_resolver = DEFAULT_ERROR_LOCALE_RESOLVER

  self.enable_multiple_database_support = false
  self.primary_database_role = :writing
  self.primary_database_key = :primary

  self.time_precision = DEFAULT_TIME_PRECISION

  self.enable_autoregistration = false
end