Package org.apache.jackrabbit.core.jndi
Class BindableRepository
- java.lang.Object
- 
- org.apache.jackrabbit.commons.AbstractRepository
- 
- org.apache.jackrabbit.core.jndi.BindableRepository
 
 
- 
- All Implemented Interfaces:
- Serializable,- Repository,- Referenceable,- JackrabbitRepository
 
 public class BindableRepository extends AbstractRepository implements Repository, JackrabbitRepository, Referenceable, Serializable A referenceable and serializable content repository proxy. This class implements the Proxy design pattern (GoF) for the Jackrabbit Repository implementation. The proxy implementation delays the instantiation of the actual Repository instance and implements serialization and JNDI referenceability by keeping track of the repository configuration parameters.A BindableRepository instance contains the configuration file and home directory paths of a Jackrabbit repository. The separate init()method is used to create a transientRepositoryImplinstance to which all the JCR API calls are delegated.An instance of this class is normally always also initialized. The uninitialized state is only used briefly during the static construction, deserialization, and JNDI "referenciation". A JVM shutdown hook is used to make sure that the initialized repository is properly closed when the JVM shuts down. The RegistryHelper.unregisterRepository(javax.naming.Context, String)method should be used to explicitly close the repository if needed.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCONFIGFILEPATH_ADDRTYPEtype ofconfigFilePathreference addressstatic StringREPHOMEDIR_ADDRTYPEtype ofrepHomeDirreference address- 
Fields inherited from interface org.apache.jackrabbit.api.JackrabbitRepositoryOPTION_PRINCIPAL_MANAGEMENT_SUPPORTED, OPTION_PRIVILEGE_MANAGEMENT_SUPPORTED, OPTION_USER_MANAGEMENT_SUPPORTED
 - 
Fields inherited from interface javax.jcr.RepositoryIDENTIFIER_STABILITY, IDENTIFIER_STABILITY_INDEFINITE_DURATION, IDENTIFIER_STABILITY_METHOD_DURATION, IDENTIFIER_STABILITY_SAVE_DURATION, IDENTIFIER_STABILITY_SESSION_DURATION, LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, NODE_TYPE_MANAGEMENT_AUTOCREATED_DEFINITIONS_SUPPORTED, NODE_TYPE_MANAGEMENT_INHERITANCE, NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL, NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE, NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE, NODE_TYPE_MANAGEMENT_MULTIPLE_BINARY_PROPERTIES_SUPPORTED, NODE_TYPE_MANAGEMENT_MULTIVALUED_PROPERTIES_SUPPORTED, NODE_TYPE_MANAGEMENT_ORDERABLE_CHILD_NODES_SUPPORTED, NODE_TYPE_MANAGEMENT_OVERRIDES_SUPPORTED, NODE_TYPE_MANAGEMENT_PRIMARY_ITEM_NAME_SUPPORTED, NODE_TYPE_MANAGEMENT_PROPERTY_TYPES, NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED, NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED, NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPORTED, NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED, OPTION_ACCESS_CONTROL_SUPPORTED, OPTION_ACTIVITIES_SUPPORTED, OPTION_BASELINES_SUPPORTED, OPTION_JOURNALED_OBSERVATION_SUPPORTED, OPTION_LIFECYCLE_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED, OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_RETENTION_SUPPORTED, OPTION_SHAREABLE_NODES_SUPPORTED, OPTION_SIMPLE_VERSIONING_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_UNFILED_CONTENT_SUPPORTED, OPTION_UPDATE_MIXIN_NODE_TYPES_SUPPORTED, OPTION_UPDATE_PRIMARY_NODE_TYPE_SUPPORTED, OPTION_VERSIONING_SUPPORTED, OPTION_WORKSPACE_MANAGEMENT_SUPPORTED, OPTION_XML_EXPORT_SUPPORTED, OPTION_XML_IMPORT_SUPPORTED, QUERY_FULL_TEXT_SEARCH_SUPPORTED, QUERY_JOINS, QUERY_JOINS_INNER, QUERY_JOINS_INNER_OUTER, QUERY_JOINS_NONE, QUERY_LANGUAGES, QUERY_STORED_QUERIES_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, WRITE_SUPPORTED
 
- 
 - 
Constructor SummaryConstructors Constructor Description BindableRepository(Reference reference)Creates a BindableRepository instance with the configuration information in the given JNDI reference.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JackrabbitRepositorycreateRepository()Creates a repository instance based on the contained JNDI reference.StringgetDescriptor(String key)Delegated to the underlying repository instance.String[]getDescriptorKeys()Delegated to the underlying repository instance.ValuegetDescriptorValue(String key)Delegated to the underlying repository instance.Value[]getDescriptorValues(String key)Delegated to the underlying repository instance.ReferencegetReference()Returns the JNDI reference for this content repository.protected JackrabbitRepositorygetRepository()Returns the underlying repository instance.booleanisSingleValueDescriptor(String key)Delegated to the underlying repository instance.booleanisStandardDescriptor(String key)Delegated to the underlying repository instance.Sessionlogin(Credentials credentials, String workspaceName)Delegated to the underlying repository instance.voidshutdown()Delegated to the underlying repository instance.- 
Methods inherited from class org.apache.jackrabbit.commons.AbstractRepositorylogin, login, login, login
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.jackrabbit.api.JackrabbitRepositorylogin
 - 
Methods inherited from interface javax.jcr.Repositorylogin, login, login
 
- 
 
- 
- 
- 
Field Detail- 
CONFIGFILEPATH_ADDRTYPEpublic static final String CONFIGFILEPATH_ADDRTYPE type ofconfigFilePathreference address- See Also:
- Reference.get(String), Constant Field Values
 
 - 
REPHOMEDIR_ADDRTYPEpublic static final String REPHOMEDIR_ADDRTYPE type ofrepHomeDirreference address- See Also:
- Reference.get(String), Constant Field Values
 
 
- 
 - 
Constructor Detail- 
BindableRepositorypublic BindableRepository(Reference reference) throws RepositoryException Creates a BindableRepository instance with the configuration information in the given JNDI reference.- Parameters:
- reference- JNDI reference
- Throws:
- RepositoryException- if the repository can not be started
 
 
- 
 - 
Method Detail- 
createRepositoryprotected JackrabbitRepository createRepository() throws RepositoryException Creates a repository instance based on the contained JNDI reference. Can be overridden by subclasses to return different repositories. A subclass can access the JNDI reference through thegetReference()method. The default implementation returns aRepositoryImplinstance.- Returns:
- repository instance
- Throws:
- RepositoryException- if the repository could not be created
 
 - 
getRepositoryprotected JackrabbitRepository getRepository() Returns the underlying repository instance. Can be used by subclasses to access the repository instance.- Returns:
- repository instance
 
 - 
loginpublic Session login(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException Delegated to the underlying repository instance.- Specified by:
- loginin interface- Repository
- Throws:
- LoginException
- NoSuchWorkspaceException
- RepositoryException
 
 - 
getDescriptorpublic String getDescriptor(String key) Delegated to the underlying repository instance.- Specified by:
- getDescriptorin interface- Repository
 
 - 
getDescriptorKeyspublic String[] getDescriptorKeys() Delegated to the underlying repository instance.- Specified by:
- getDescriptorKeysin interface- Repository
 
 - 
getDescriptorValuepublic Value getDescriptorValue(String key) Delegated to the underlying repository instance.- Specified by:
- getDescriptorValuein interface- Repository
 
 - 
getDescriptorValuespublic Value[] getDescriptorValues(String key) Delegated to the underlying repository instance.- Specified by:
- getDescriptorValuesin interface- Repository
 
 - 
isSingleValueDescriptorpublic boolean isSingleValueDescriptor(String key) Delegated to the underlying repository instance.- Specified by:
- isSingleValueDescriptorin interface- Repository
 
 - 
isStandardDescriptorpublic boolean isStandardDescriptor(String key) Delegated to the underlying repository instance. Returns true if the given key identifies a standard descriptor.- Specified by:
- isStandardDescriptorin interface- Repository
- Overrides:
- isStandardDescriptorin class- AbstractRepository
- Parameters:
- key- descriptor key
- Returns:
- trueif the key identifies a standard descriptor,- falseotherwise
 
 - 
getReferencepublic Reference getReference() Returns the JNDI reference for this content repository. The returned reference holds the configuration information required to create a copy of this instance.- Specified by:
- getReferencein interface- Referenceable
- Returns:
- the JNDI reference
 
 - 
shutdownpublic void shutdown() Delegated to the underlying repository instance.- Specified by:
- shutdownin interface- JackrabbitRepository
 
 
- 
 
-