Friday, October 21, 2011

Declaring Constructors, Methods, and Variables in an enum

NOTE: the order of the line of the code is important for the following:

public enum SORT_ORDER
{
  ACCESSED_ASCENDING("accessed_ascending"),   
  ACCESSED_DESCENDING("accessed_descending");
   
  private SORT_ORDER(String p_value)
  {
   this.m_value = p_value;
  }

  private final String m_value;

  @Override
  public String toString()
  {
    return m_value;
  }
}

Wednesday, October 12, 2011

Linux: java.io.IOException: Too many open files

http://lj4newbies.blogspot.com/2007/04/too-many-open-files.html
http://www.karakas-online.de/forum/viewtopic.php?t=9834

1. check max file descriptor

cat /proc/sys/fs/file-max

change to higher if needed

2. add to
/etc/security/limits.conf

something like

* soft nofile 65535
* hard nofile 65535
 
3. log out and log back in