org.apache.jackrabbit.rmi.client
Class SafeClientRepository

java.lang.Object
  extended by org.apache.jackrabbit.rmi.client.ClientObject
      extended by org.apache.jackrabbit.rmi.client.SafeClientRepository
All Implemented Interfaces:
javax.jcr.Repository

public abstract class SafeClientRepository
extends ClientObject
implements javax.jcr.Repository

A "safe" local adapter for the JCR-RMI RemoteRepository interface. This class uses an abstract factory method for loading (and reloading) the remote repository instance that is made locally available through the JCR Repository interface. If the remote reference breaks (a RemoteException is thrown by a remote call), then this adapter attempts to reload the remote reference once before failing.

See Also:
Repository, RemoteRepository

Field Summary
 
Fields inherited from interface javax.jcr.Repository
LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_VERSIONING_SUPPORTED, QUERY_XPATH_DOC_ORDER, QUERY_XPATH_POS_INDEX, REP_NAME_DESC, REP_VENDOR_DESC, REP_VENDOR_URL_DESC, REP_VERSION_DESC, SPEC_NAME_DESC, SPEC_VERSION_DESC
 
Constructor Summary
SafeClientRepository(LocalAdapterFactory factory)
          Creates a client adapter for the given remote repository.
 
Method Summary
 String getDescriptor(String name)
          
 String[] getDescriptorKeys()
          
protected abstract  RemoteRepository getRemoteRepository()
          Abstract factory class for getting the remote repository.
 javax.jcr.Session login()
          
 javax.jcr.Session login(javax.jcr.Credentials credentials)
          
 javax.jcr.Session login(javax.jcr.Credentials credentials, String workspace)
          
 javax.jcr.Session login(String workspace)
          
 
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientObject
getFactory, getItem, getNode, getNodeTypeArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeClientRepository

public SafeClientRepository(LocalAdapterFactory factory)
Creates a client adapter for the given remote repository.

Parameters:
remote - remote repository
factory - local adapter factory
Method Detail

getRemoteRepository

protected abstract RemoteRepository getRemoteRepository()
                                                 throws RemoteException
Abstract factory class for getting the remote repository.

Returns:
remote repository
Throws:
RemoteException - if the remote repository could not be accessed

getDescriptor

public String getDescriptor(String name)

Specified by:
getDescriptor in interface javax.jcr.Repository

getDescriptorKeys

public String[] getDescriptorKeys()

Specified by:
getDescriptorKeys in interface javax.jcr.Repository

login

public javax.jcr.Session login(javax.jcr.Credentials credentials,
                               String workspace)
                        throws javax.jcr.RepositoryException

Specified by:
login in interface javax.jcr.Repository
Throws:
javax.jcr.RepositoryException

login

public javax.jcr.Session login(String workspace)
                        throws javax.jcr.RepositoryException

Specified by:
login in interface javax.jcr.Repository
Throws:
javax.jcr.RepositoryException

login

public javax.jcr.Session login(javax.jcr.Credentials credentials)
                        throws javax.jcr.RepositoryException

Specified by:
login in interface javax.jcr.Repository
Throws:
javax.jcr.RepositoryException

login

public javax.jcr.Session login()
                        throws javax.jcr.RepositoryException

Specified by:
login in interface javax.jcr.Repository
Throws:
javax.jcr.RepositoryException


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.