Code example for SynchronousQueue

Methods: put

0
            InvalidationsQueue eventQueue, MapperClientInfo info)
            throws Throwable { 
        super(name);
        this.repository = repository;
        this.eventQueue = eventQueue;
        this.methodCalls = new SynchronousQueue<MethodCall>();
        this.clientInfo = info;
        start();
        init(); 
    } 
 
    // called in the main thread 
    public void init() throws Throwable { 
        call(INVOKER_INIT);
    } 
 
    // called in the main thread 
    public void close() throws Throwable { 
        try { 
            call(INVOKER_CLOSE);
        } finally { 
            interrupt();
            join();
        } 
    } 
 
    // called in the main thread 
    public Object call(String methodName, Object... args) throws Throwable {
        MethodCall call = new MethodCall(methodName, args);
        methodCalls.put(call);
        return call.getResult();
    } 
 
    @Override 
    public void run() {