Method: Arrow::Session.create_lock
- Defined in:
- lib/arrow/session.rb
.create_lock(config, store, id) ⇒ Object
Create an Arrow::Session::Lock object for the specified store and id.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/arrow/session.rb', line 128 def self::create_lock( config, store, id ) lockuri = Arrow::Session.parse_uri( config.lockType ) lock = nil # If the configuration says to use the recommended locker, ask the # backing store for a lock object. if lockuri.scheme == 'recommended' Arrow::Logger[self].debug "Creating recommended lock" lock = store.create_recommended_lock( id ) or raise Arrow::SessionError, "No recommended locker for %s" % store.class.name else Arrow::Logger[self].debug "Creating a session lock: %p" % lockuri lock = Arrow::Session::Lock.create( lockuri, id ) end return lock end |