org.apache.jackrabbit.rmi.server.iterator
Class ServerIterator
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.apache.jackrabbit.rmi.server.ServerObject
org.apache.jackrabbit.rmi.server.iterator.ServerIterator
- All Implemented Interfaces:
- java.io.Serializable, java.rmi.Remote, RemoteIterator
- Direct Known Subclasses:
- ServerAccessControlPolicyIterator, ServerNodeIterator, ServerNodeTypeIterator, ServerPrincipalIterator, ServerPropertyIterator, ServerRowIterator, ServerVersionIterator
public abstract class ServerIterator
- extends ServerObject
- implements RemoteIterator
Remote adapter for the JCR RangeIterator
interface. This
class makes a local iterator available as an RMI service using teh
RemoteIterator
interface.
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Method Summary |
protected abstract java.lang.Object |
getRemoteObject(java.lang.Object object)
Returns a remote adapter for the given local object. |
long |
getSize()
Returns the size of the iterator. |
java.lang.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. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
ServerIterator
public ServerIterator(javax.jcr.RangeIterator iterator,
RemoteAdapterFactory factory,
int maxBufferSize)
throws java.rmi.RemoteException
- Creates a remote adapter for the given local item.
- Parameters:
iterator
- local iterator to be adaptedfactory
- remote adapter factorymaxBufferSize
- maximum buffer size
- Throws:
java.rmi.RemoteException
- on RMI errors
getSize
public long getSize()
throws java.rmi.RemoteException
- Returns the size of the iterator. The size is cached by invoking the
adapted local iterator when this method is first called or by
determining the size from an end-of-iterator condition in nextObjects().
- Specified by:
getSize
in interface RemoteIterator
- Returns:
- size of the iterator
- Throws:
java.rmi.RemoteException
- on RMI errors- See Also:
RemoteIterator.getSize()
,
RangeIterator.getSize()
skip
public void skip(long items)
throws java.util.NoSuchElementException,
java.rmi.RemoteException
- Skips the given number of elements.
- Specified by:
skip
in interface RemoteIterator
- Parameters:
items
- number of elements to skip
- Throws:
java.util.NoSuchElementException
- if skipped past the last element
java.rmi.RemoteException
- on RMI errors- See Also:
RangeIterator.skip(long)
getRemoteObject
protected abstract java.lang.Object getRemoteObject(java.lang.Object object)
throws java.rmi.RemoteException
- Returns a remote adapter for the given local object. This abstract
method is used by
#nextObjects(int)
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.
- Parameters:
object
- local object
- Returns:
- remote adapter
- Throws:
java.rmi.RemoteException
- on RMI errors
nextObjects
public java.lang.Object[] nextObjects()
throws java.rmi.RemoteException
- Returns an array of remote references to the next elements in this
iteration.
- Specified by:
nextObjects
in interface RemoteIterator
- Returns:
- array of remote references, or
null
- Throws:
java.rmi.RemoteException
- on RMI errors- See Also:
RemoteIterator#nextObjects(int)
,
Iterator.next()
Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.