| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <html> |
| <head> |
| <script type="text/javascript">var xookiConfig = {level: 1};</script> |
| <script type="text/javascript" src="../xooki/xooki.js"></script> |
| </head> |
| <body> |
| <textarea id="xooki-source"> |
| <b>Tag:</b> lock-strategies <span class="since">since 2.0</span> |
| |
| <span class="tagdoc" id="ivysettings.lock-strategies">Defines a list of lock strategies usable in Ivy.</span> |
| |
| A lock strategy is used by a cache manager to decide when and how locking should be performed (see [[settings/cache]] to see how to configure the lock strategy to use). |
| |
| The following strategies are registered by default: |
| <ul> |
| <li><b>no-lock</b></li> This lock strategy actually performs no locking at all, and thus should not be used in an environment where the cache is shared by multiple processes. |
| |
| <li><b>artifact-lock</b></li> This strategy acquires a lock whenever a module descriptor or an artifact is downloaded to the cache, which makes a good solution when you want to share your repository cache. |
| Note that this strategy is based on file locking, performed by default using the java.io.File.createNewFile() atomicity (which is documented as atomic in the javadoc, but not recommended to perform locks). |
| |
| <li><b>artifact-lock-nio (<span class="since">since 2.4</span>)</b></li> Like the <i>artifact-lock</i>-strategy, this one also acquires a lock whenever a module descriptor or artifact is downloaded to the cache. But here the implementation is done with a java.nio.FileLock. |
| </ul> |
| |
| The child tag used for the lock strategy must be equal to a name of a lock strategy type (added with the typedef tag). |
| |
| <h1>Child elements</h1> |
| <table class="ivy-children"> |
| <thead> |
| <tr><th class="ivy-chld">Element</th><th class="ivy-chld-desc">Description</th><th class="ivy-chld-card">Cardinality</th></tr> |
| </thead> |
| <tbody> |
| <tr><td>any lock strategy</td><td>adds a lock strategy to the list of available ones</td> |
| <td>0..n</td></tr> |
| </tbody> |
| </table></textarea> |
| <script type="text/javascript">xooki.postProcess();</script> |
| </body> |
| </html> |