@Override
    public SemiLease write(final ISemiSpaceTuple entry, final long leaseTimeMs) {
        if (entry == null) {
            return null;
        }
//    	log.logDebug( "WRITE: "+entry.getJSON());

//System.out.println("SemiSpace.write-1 "+entry);
        WrappedInternalWriter write = new WrappedInternalWriter(entry, leaseTimeMs);
        
        ExecutorService thd = admin.getThreadPool();
//System.out.println("SemiSpace.write-2 "+thd.isShutdown()+" "+thd.isTerminated());
        
        Future<?> future = thd.submit(write);
        Exception exception = null;
        try {
            future.get();
        } catch ( CancellationException e ) {
            log.logError("Got exception", e);
            exception = e;            
        } catch (InterruptedException e) {
            log.logError("Got exception", e);
            exception = e;
        } catch (ExecutionException e) {
            log.logError("Got exception", e);
            exception = e;
        } 
//System.out.println("SemiSpace.write-3 "+write.getException());
        
        if (write.getException() != null || exception != null) {
            String error = " Writing object (of type " + entry.getClass().getName()
                    + ") to space gave exception. XML version: " /*+ objectToXml(entry)*/;
            if ( write.getException() != null ) {
                exception = write.getException();
            }
            throw new SemiSpaceObjectException(error, exception);
        }
//System.out.println("SemiSpace.write-4 "+write.getLease());
        return write.getLease();
    }