Can you manage file lock's in Java? How? Juan Pablo Lorandi Chief Software Architect Code Foundry Ltd. [EMAIL PROTECTED]
Barberstown, Straffan, Co. Kildare, Ireland. Tel: +353-1-6012050 Fax: +353-1-6012051 Mobile: +353-86-2157900 www.codefoundry.com > -----Original Message----- > From: A mailing list for Enterprise JavaBeans development > [mailto:[EMAIL PROTECTED]] On Behalf Of Ramakrishna N > Sent: Thursday, May 23, 2002 4:12 PM > To: [EMAIL PROTECTED] > Subject: Re: Off Topic : ClassLoaders > > > Hi Chaung, > What is this file-lock ? How do we lock a file ? Could > you be a bit clear on that? > Thanks in advance. > regards, > kris > > -----Original Message----- > From: Gene Chuang [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 23, 2002 2:15 AM > To: [EMAIL PROTECTED] > Subject: Re: Off Topic : ClassLoaders > > > Please clarify: do you want an Instance singleton or a Class > singleton across multiple VM's? These are two very distinct concepts. > > An Instance singleton across multiple VMs is accomplishable > in one of many ways, as already described by previous posts. > > A Class singleton across multiple VMs isn't difficult either; > simple overload the classloading method to > > 1) check for a file lock > 2) load class if no lock, or throw ClassNotFoundException if > lock exists > 3) place file lock if Class successfully loaded > > Gene > --- Ramakrishna N <[EMAIL PROTECTED]> wrote: > > Hi, > > This is an off topic suggestion that I am seeking but its urgent > > and so > I > > am posting it here. > > I want only one Instance of a particular Class to be running > > across multiple VMs. I mean if I am executing a class in one of the > > VMs then If I say run the same Class in another VM of the > same machine > > it should not > run. > > How do I achieve this behaviour ? > > Currently we have a configuration xml file where in the > > Application registers when it has opened and registers > again when it > > has successfully closed so that in between if I try to open the > > application in another VM > the > > application first reads the configuration xml and > understands that one > > istance of the application is running and so it exits. > > I would like to achieve it through ClassLoaders. Say custom > > ClassLoaders. I am sure there should be a way to achieve > this without > doing > > any I/O operations like opening a socket when the > application starts.. > > Any help on this would be of great help. Thanks in advance. > > > > Thanks & Regards, > > kris > > > > > ============================================================== > ============= > > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the > body > > of the message "signoff EJB-INTEREST". For general help, > send email > > to [EMAIL PROTECTED] and include in the body of the message > > "help". > > > > > __________________________________________________ > Do You Yahoo!? > LAUNCH - Your Yahoo! Music Experience > http://launch.yahoo.com > > ============================================================== > ============= > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body of the message "signoff EJB-INTEREST". > For general help, send email to [EMAIL PROTECTED] and > include in the body of the message "help". > > ============================================================== > ============= > To unsubscribe, send email to [EMAIL PROTECTED] and > include in the body of the message "signoff EJB-INTEREST". > For general help, send email to [EMAIL PROTECTED] and > include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
