
com.bigdata.service.proxy.RemoteRunnableBufferImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bigdata-core Show documentation
Show all versions of bigdata-core Show documentation
Blazegraph(TM) DB Core Platform. It contains all Blazegraph DB dependencies other than Blueprints.
/*
Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016. All rights reserved.
Contact:
SYSTAP, LLC DBA Blazegraph
2501 Calvert ST NW #106
Washington, DC 20008
licenses@blazegraph.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Created on Jun 5, 2009
*/
package com.bigdata.service.proxy;
import java.io.IOException;
import java.rmi.Remote;
import java.util.concurrent.Future;
import com.bigdata.relation.accesspath.IBlockingBuffer;
import com.bigdata.relation.accesspath.IRunnableBuffer;
/**
* A helper object that provides the API of {@link IBlockingBuffer} but whose
* methods throw {@link IOException} and are therefore compatible with
* {@link Remote} and Exporter.
*
* @author Bryan Thompson
* @version $Id$
* @param
* The generic type of the elements in the buffer.
* @param
* The generic type of the result of the method call.
*/
public class RemoteRunnableBufferImpl extends RemoteBufferImpl implements
RemoteRunnableBuffer {
private final IRunnableBuffer localBuffer;
private final Future futureProxy;
/**
* @param localBuffer
* @param futureProxy
*/
public RemoteRunnableBufferImpl(final IRunnableBuffer localBuffer,
final Future futureProxy) {
super(localBuffer);
this.localBuffer = localBuffer;
this.futureProxy = futureProxy;
}
public void abort(Throwable cause) throws IOException {
localBuffer.abort(cause);
}
public void close() throws IOException {
localBuffer.close();
}
public boolean isOpen() throws IOException {
return localBuffer.isOpen();
}
public Future getFuture() throws IOException {
return futureProxy;
}
}