public void submitTask(final Runnable command)
        throws InterruptedException
    {
        semaphore.acquire();
        try
        {
            //exec.execute(command);
            exec.execute(new Runnable()
            {
                
                public void run()
                {
                    try
                    {
                        command.run();
                        
                    }
                    finally
                    {
                        semaphore.release();
                    }
                    
                }
            });
        }
        catch (Exception e)
        {
            semaphore.release();
        }
    }