public abstract class ServerIterator extends ServerObject implements RemoteIterator
RangeIterator
interface. This
class makes a local iterator available as an RMI service using the
RemoteIterator
interface.ref
Constructor and Description |
---|
ServerIterator(RangeIterator iterator,
RemoteAdapterFactory factory,
int maxBufferSize)
Creates a remote adapter for the given local item.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
getRemoteObject(Object object)
Returns a remote adapter for the given local object.
|
long |
getSize()
Returns the size of the iterator.
|
Object[] |
nextObjects()
Returns an array of remote references to the next elements in this
iteration.
|
void |
skip(long items)
Skips the given number of elements.
|
getFactory, getRemoteItem, getRemoteNode, getRemoteNodeTypeArray, getRepositoryException, getSerialValue, getSerialValues
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
public ServerIterator(RangeIterator iterator, RemoteAdapterFactory factory, int maxBufferSize) throws RemoteException
iterator
- local iterator to be adaptedfactory
- remote adapter factorymaxBufferSize
- maximum buffer sizeRemoteException
- on RMI errorspublic long getSize() throws RemoteException
getSize
in interface RemoteIterator
RemoteException
- on RMI errorsRangeIterator.getSize()
public void skip(long items) throws NoSuchElementException, RemoteException
skip
in interface RemoteIterator
items
- number of elements to skipNoSuchElementException
- if skipped past the last elementRemoteException
- on RMI errorsRangeIterator.skip(long)
protected abstract Object getRemoteObject(Object object) throws RemoteException
nextObjects()
to convert the local
objects to remote references to be sent to the client.
Subclasses should implement this method to use the remote adapter factory to create remote adapters of the specific element type.
object
- local objectRemoteException
- on RMI errorspublic Object[] nextObjects() throws RemoteException
nextObjects
in interface RemoteIterator
null
RemoteException
- on RMI errorsIterator.next()
Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.