The FileChannel class in java.nio implements a FileLock mechanism.  You can
lock something for writing while having allowing other processes to read.
There are also shared locks.

Apache Commons VFS supports the kind of multi-file system approach that you
mention.  There's been some working on providing pluggable support for
version control systems as a file system.  Although I haven't seen what the
current state of the implementation is.  I have used the WebDAV support and
written an NFS plugin for it.  I don't recall whether the API has any
support for file locking though.

Regards,

Mark

On Sat, Mar 28, 2009 at 12:59 AM, Linus Tolke <[email protected]> wrote:

> Hello Christian!
>
> This sounds like a good idea but I wouldn't want us to design our own
> locking mechanism. Is there java support for a locking mechanism that uses
> lockf (on NFS/lockd) and whatever is appropriate (for Windows/SMB and Mac)?
>
> On second thought, if the zargo file is under version control we would like
> the locking function to reserve it (svn, cvs) or check it out (rcs,
> clearcase, sourcesafe, pvcs). Checking it out may also modify the contents
> of the file so it will have to be reread. This complexity of this is huge!
> The first big challenge would be to detect if the file is read-only and if
> so, make the model read-only. That would help most of our users to avoid
> making misstakes if they have set up their file correctly in the version
> control system (at least for svn, cvs, rcs, clearcase).
>
>         /Linus
>
> 2009/3/26 Christian Heinrich <[email protected]>
>
> Hi there,
>>
>> currently, it is possible to work on a .zargo file with several
>> instances of ArgoUML. I was just wondering if this might lead to
>> inconsistencies and whether we should use some kind of lock mechanism
>> for that.
>>
>> What do you think?
>>
>> Christian
>>
>> ------------------------------------------------------
>>
>> http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=1431963
>>
>> To unsubscribe from this discussion, e-mail: [
>> [email protected]].
>> To be allowed to post to the list contact the mailing list moderator,
>> email: [[email protected]]
>>
>
>


-- 
Mark Fortner

blog: http://feeds.feedburner.com/jroller/ideafactory

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=1457541

To unsubscribe from this discussion, e-mail: 
[[email protected]].
To be allowed to post to the list contact the mailing list moderator, email: 
[[email protected]]

Reply via email to