Class TicketLocker
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.util.locker.TicketLocker
-
-
Constructor Summary
Constructors Constructor Description TicketLocker(String lockerName, int port)
Public constructor.TicketLocker(String lockerName, int port, String description)
Public constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
lock()
Wait the token and then lock the resource.static void
main(String[] args)
Main method.void
unlock()
Unlock the resource.
-
-
-
Constructor Detail
-
TicketLocker
public TicketLocker(String lockerName, int port)
Public constructor.- Parameters:
lockerName
- The name of the lockerport
- port to use
-
-
Method Detail
-
lock
public void lock() throws IOException
Description copied from interface:Locker
Wait the token and then lock the resource.- Specified by:
lock
in interfaceLocker
- Throws:
IOException
- if an error occurs while locking the resource
-
unlock
public void unlock() throws IOException
Description copied from interface:Locker
Unlock the resource.- Specified by:
unlock
in interfaceLocker
- Throws:
IOException
- if an error occurs while unlocking the resource
-
main
public static void main(String[] args) throws RemoteException, MalformedURLException
Main method.- Parameters:
args
- command line arguments- Throws:
RemoteException
- if an error occurs while inspecting ticketsMalformedURLException
- if the URL of the server is malformed
-
-