package IAO.SP.utils.sema;

public class SemaphoreManager {
  private static final java.util.Map<String, IAO.com.utils.Semaphore> semas = null;
  private String appid = "";

  public SemaphoreManager(String arg0) { 
  }

  public void setState(String arg0,int arg1) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman"); shell.emit("setState", String.class,int.class,arg0,arg1);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

  public void setState(String arg0,String arg1,int arg2) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman"); shell.emit("setState", String.class,String.class,int.class,arg0,arg1,arg2);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

  public void waitState(String arg0,String arg1,int arg2) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman"); shell.emit("waitState", String.class,String.class,int.class,arg0,arg1,arg2);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

  public void waitState(String arg0,int arg1) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman"); shell.emit("waitState", String.class,int.class,arg0,arg1);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

  public void waitStateAll(String arg0,int arg1) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman"); shell.emit("waitStateAll", String.class,int.class,arg0,arg1);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

  private void waitStateAllX(String arg0,int arg1) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman"); shell.emit("waitStateAllX", String.class,int.class,arg0,arg1);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

  private synchronized IAO.com.utils.Semaphore getSema(String arg0,String arg1) { 
    try { IAO.SP.sphere.Shell shell = IAO.SP.sphere.Shell.getInstance("PI", "semaman");return (IAO.com.utils.Semaphore)shell.emit("getSema", String.class,String.class,arg0,arg1);    } catch(Exception ee) { ee.printStackTrace(); throw new RuntimeException(ee.getMessage()); }
  }

}

