org.apache.jackrabbit.rmi.client
Class ClientRepositoryFactory

java.lang.Object
  extended byorg.apache.jackrabbit.rmi.client.ClientRepositoryFactory
All Implemented Interfaces:
ObjectFactory

public class ClientRepositoryFactory
extends Object
implements ObjectFactory

Object factory for JCR-RMI clients. This factory can be used either directly or as a JNDI object factory.

Author:
Jukka Zitting
See Also:
ClientRepository

Field Summary
static String URL_PARAMETER
          The JNDI parameter name for configuring the RMI URL of a remote repository.
 
Constructor Summary
ClientRepositoryFactory()
          Creates a JCR-RMI client factory with the default adapter factory.
ClientRepositoryFactory(LocalAdapterFactory factory)
          Creates a JCR-RMI client factory with the given adapter factory.
 
Method Summary
 Object getObjectInstance(Object object, Name name, Context context, Hashtable environment)
          JNDI factory method for creating JCR-RMI clients.
 Repository getRepository(String url)
          Returns a client wrapper for a remote content repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_PARAMETER

public static final String URL_PARAMETER
The JNDI parameter name for configuring the RMI URL of a remote repository.

See Also:
Constant Field Values
Constructor Detail

ClientRepositoryFactory

public ClientRepositoryFactory()
Creates a JCR-RMI client factory with the default adapter factory.


ClientRepositoryFactory

public ClientRepositoryFactory(LocalAdapterFactory factory)
Creates a JCR-RMI client factory with the given adapter factory.

Parameters:
factory - local adapter factory
Method Detail

getRepository

public Repository getRepository(String url)
                         throws ClassCastException,
                                MalformedURLException,
                                NotBoundException,
                                RemoteException
Returns a client wrapper for a remote content repository. The remote repository is looked up from the RMI registry using the given URL and wrapped into a ClientRepository adapter.

Parameters:
url - the RMI URL of the remote repository
Returns:
repository client
Throws:
ClassCastException - if the URL points to an unknown object
MalformedURLException - if the URL is malformed
NotBoundException - if the URL points to nowhere
RemoteException - on RMI errors

getObjectInstance

public Object getObjectInstance(Object object,
                                Name name,
                                Context context,
                                Hashtable environment)
                         throws NamingException
JNDI factory method for creating JCR-RMI clients. Looks up a remote repository using the reference parameter "url" as the RMI URL and returns a client wrapper for the remote repository.

Specified by:
getObjectInstance in interface ObjectFactory
Parameters:
object - reference parameters
name - unused
context - unused
environment - unused
Returns:
repository client
Throws:
NamingException - on all errors


Copyright © 2004-2006 . All Rights Reserved.