Module: ODBA

Defined in:
lib/odba/odba.rb,
lib/odba/stub.rb,
lib/odba/cache.rb,
lib/odba/index.rb,
lib/odba/marshal.rb,
lib/odba/storage.rb,
lib/odba/id_server.rb,
lib/odba/drbwrapper.rb,
lib/odba/odba_error.rb,
lib/odba/cache_entry.rb,
lib/odba/persistable.rb,
lib/odba/connection_pool.rb,
lib/odba/index_definition.rb

Overview

– IndexDefinition – odba – 20.09.2004 – [email protected]

Defined Under Namespace

Modules: Marshal, Persistable Classes: Cache, CacheEntry, ConditionIndex, ConnectionPool, DRbIdConv, DRbWrapper, FulltextIndex, IdServer, Index, IndexCommon, IndexDefinition, OdbaDuplicateIdError, OdbaError, OdbaResultLimitError, Storage, Stub

Class Method Summary collapse

Class Method Details

.cacheObject

reader for the Cache server. Defaults to ODBA::Cache.instance



6
7
8
# File 'lib/odba/odba.rb', line 6

def ODBA.cache
	@cache ||= ODBA::Cache.instance
end

.cache=(cache_server) ⇒ Object

writer for the Cache server. You will probably never need this.



10
11
12
# File 'lib/odba/odba.rb', line 10

def ODBA.cache=(cache_server)
	@cache = cache_server
end

.marshallerObject

reader for the Marshaller. Defaults to ODBA.Marshal



14
15
16
# File 'lib/odba/odba.rb', line 14

def ODBA.marshaller
	@marshaller ||= ODBA::Marshal
end

.marshaller=(marshaller) ⇒ Object

writer for the Marshaller. Example: override the default Marshaller to serialize your objects in a custom format (yaml, xml, …).



19
20
21
# File 'lib/odba/odba.rb', line 19

def ODBA.marshaller=(marshaller)
	@marshaller = marshaller
end

.peer(peer) ⇒ Object

peer two instances of ODBA::Cache



23
24
25
26
# File 'lib/odba/odba.rb', line 23

def ODBA.peer peer
  peer.register_peer ODBA.cache
  ODBA.cache.register_peer peer
end

.storageObject

reader for the Storage Server. Defaults to ODBA::Storage.instance



28
29
30
# File 'lib/odba/odba.rb', line 28

def ODBA.storage
	@storage ||= ODBA::Storage.instance
end

.storage=(storage) ⇒ Object

writer for the Storage Server. Example: override the default Storage Server to dump all your data in a flatfile.



33
34
35
# File 'lib/odba/odba.rb', line 33

def ODBA.storage=(storage)	
	@storage = storage
end

.transaction(&block) ⇒ Object

Convenience method. Delegates the transaction-call to the Cache server.



42
43
44
# File 'lib/odba/odba.rb', line 42

def ODBA.transaction(&block)
	ODBA.cache.transaction(&block)
end

.unpeer(peer) ⇒ Object

unpeer two instances of ODBA::Cache



37
38
39
40
# File 'lib/odba/odba.rb', line 37

def ODBA.unpeer peer
  peer.unregister_peer ODBA.cache
  ODBA.cache.unregister_peer peer
end