org.apache.jackrabbit.rmi.server
Class ServerItem

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.apache.jackrabbit.rmi.server.ServerObject
                  extended by org.apache.jackrabbit.rmi.server.ServerItem
All Implemented Interfaces:
Serializable, Remote, RemoteItem
Direct Known Subclasses:
ServerNode, ServerProperty

public class ServerItem
extends ServerObject
implements RemoteItem

Remote adapter for the JCR Item interface. This class makes a local item available as an RMI service using the RemoteItem interface. Used mainly as the base class for the ServerProperty and ServerNode adapters.

See Also:
Item, RemoteItem, Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ServerItem(Item item, RemoteAdapterFactory factory)
          Creates a remote adapter for the given local item.
 
Method Summary
 RemoteItem getAncestor(int level)
          Remote version of the Item.getAncestor(int) method.
 int getDepth()
          Remote version of the Item.getDepth() method.
 String getName()
          Remote version of the Item.getName() method.
 RemoteNode getParent()
          Remote version of the Item.getParent() method.
 String getPath()
          Remote version of the Item.getPath() method.
 boolean isModified()
          Remote version of the Item.isModified() method.
 boolean isNew()
          Remote version of the Item.isNew() method.
 void refresh(boolean keepChanges)
          Remote version of the Item.refresh(boolean) method.
 void remove()
          Remote version of the Item.remove() method.
 void save()
          Remote version of the Item.save() method.
 
Methods inherited from class org.apache.jackrabbit.rmi.server.ServerObject
getFactory, getRemoteItem, getRemoteNode, getRemoteNodeTypeArray, getRepositoryException, getSerialValue, getSerialValues
 
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
 

Constructor Detail

ServerItem

public ServerItem(Item item,
                  RemoteAdapterFactory factory)
           throws RemoteException
Creates a remote adapter for the given local item.

Parameters:
item - local item to be adapted
factory - remote adapter factory
Throws:
RemoteException - on RMI errors
Method Detail

getPath

public String getPath()
               throws RepositoryException,
                      RemoteException
Remote version of the Item.getPath() method.

Specified by:
getPath in interface RemoteItem
Returns:
item path
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getName

public String getName()
               throws RepositoryException,
                      RemoteException
Remote version of the Item.getName() method.

Specified by:
getName in interface RemoteItem
Returns:
item name
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

save

public void save()
          throws RepositoryException,
                 RemoteException
Remote version of the Item.save() method.

Specified by:
save in interface RemoteItem
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getAncestor

public RemoteItem getAncestor(int level)
                       throws RepositoryException,
                              RemoteException
Remote version of the Item.getAncestor(int) method.

Specified by:
getAncestor in interface RemoteItem
Parameters:
level - ancestor level
Returns:
ancestor item
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getDepth

public int getDepth()
             throws RepositoryException,
                    RemoteException
Remote version of the Item.getDepth() method.

Specified by:
getDepth in interface RemoteItem
Returns:
item depth
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getParent

public RemoteNode getParent()
                     throws RepositoryException,
                            RemoteException
Remote version of the Item.getParent() method.

Specified by:
getParent in interface RemoteItem
Returns:
parent node
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

isModified

public boolean isModified()
                   throws RemoteException
Remote version of the Item.isModified() method.

Specified by:
isModified in interface RemoteItem
Returns:
true if the item is modified, false otherwise
Throws:
RemoteException - on RMI errors

isNew

public boolean isNew()
              throws RemoteException
Remote version of the Item.isNew() method.

Specified by:
isNew in interface RemoteItem
Returns:
true if the item is new, false otherwise
Throws:
RemoteException - on RMI errors

refresh

public void refresh(boolean keepChanges)
             throws RepositoryException,
                    RemoteException
Remote version of the Item.refresh(boolean) method.

Specified by:
refresh in interface RemoteItem
Parameters:
keepChanges - flag to keep transient changes
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

remove

public void remove()
            throws RepositoryException,
                   RemoteException
Remote version of the Item.remove() method.

Specified by:
remove in interface RemoteItem
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.