org.egothor.lock.server
Class LockServer

java.lang.Object
  extended by org.egothor.lock.server.LockServer

public class LockServer
extends java.lang.Object

Server for locking. It waits for LockRequest and processes them in a new thread. The new thread sends back a LockResponse. It uses UDP.

Author:
Jakub Podhorny

Field Summary
static java.util.HashMap<java.lang.String,java.lang.Long> constMap
          Map of location -> longest constancy expiration time.
protected static long idCounter
          counter for ids for locks and reservations
static java.util.HashMap<java.lang.String,LockServerThread.LockServerRecord> lockMap
          Map of location -> lock record.
protected static java.lang.String lockServerConfigFilename
           
 
Constructor Summary
LockServer()
          Constructor with no arguments creates a server on default port.
LockServer(int port)
          Constructor with port argument creates a server on specified port
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lockMap

public static final java.util.HashMap<java.lang.String,LockServerThread.LockServerRecord> lockMap
Map of location -> lock record. Every location has record that holds all the data about its state


constMap

public static final java.util.HashMap<java.lang.String,java.lang.Long> constMap
Map of location -> longest constancy expiration time.


idCounter

protected static long idCounter
counter for ids for locks and reservations


lockServerConfigFilename

protected static java.lang.String lockServerConfigFilename
Constructor Detail

LockServer

public LockServer()
           throws java.lang.Exception
Constructor with no arguments creates a server on default port.

Throws:
java.lang.Exception

LockServer

public LockServer(int port)
           throws java.lang.Exception
Constructor with port argument creates a server on specified port

Throws:
java.lang.Exception
Method Detail

main

public static void main(java.lang.String[] args)