org.modeshape.jdbc.delegate
Class LocalRepositoryDelegate

java.lang.Object
  extended by org.modeshape.jdbc.delegate.AbstractRepositoryDelegate
      extended by org.modeshape.jdbc.delegate.LocalRepositoryDelegate
All Implemented Interfaces:
RepositoryDelegate

public class LocalRepositoryDelegate
extends AbstractRepositoryDelegate

The LocalRepositoryDelegate provides a local Repository implementation to access the Jcr layer via JNDI Lookup.


Field Summary
 
Fields inherited from class org.modeshape.jdbc.delegate.AbstractRepositoryDelegate
LOGGER
 
Constructor Summary
LocalRepositoryDelegate(String url, Properties info, JcrDriver.JcrContextFactory contextFactory)
           
 
Method Summary
 void close()
          Call to close the delegate connection.
 void commit()
          
protected  ConnectionInfo createConnectionInfo(String url, Properties info)
           
protected  void createRepository()
           
 QueryResult execute(String query, String language)
          This execute method is used for redirection so that the JNDI implementation can control calling execute.
 String getDescriptor(String descriptorKey)
          Returns the value for the requested descriptorKey
protected  JcrDriver.JcrContextFactory getJcrContext()
           
protected  boolean isSessionAvailable()
           
 boolean isValid(int timeout)
           
 NodeType nodeType(String name)
          Call to get NodeType based on specified name
 List<NodeType> nodeTypes()
          Call to get all the NodeTypes defined.
 void rollback()
          
protected  Session session()
           
<T> T
unwrap(Class<T> iface)
          
 
Methods inherited from class org.modeshape.jdbc.delegate.AbstractRepositoryDelegate
createConnection, createMetaData, getConnectionInfo, getRepository, getRepositoryName, getRepositoryNames, isWrapperFor, setRepository, setRepositoryName, setRepositoryNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalRepositoryDelegate

public LocalRepositoryDelegate(String url,
                               Properties info,
                               JcrDriver.JcrContextFactory contextFactory)
Method Detail

createConnectionInfo

protected ConnectionInfo createConnectionInfo(String url,
                                              Properties info)
Specified by:
createConnectionInfo in class AbstractRepositoryDelegate

session

protected Session session()
                   throws RepositoryException
Throws:
RepositoryException

isSessionAvailable

protected boolean isSessionAvailable()
Overrides:
isSessionAvailable in class AbstractRepositoryDelegate

getJcrContext

protected JcrDriver.JcrContextFactory getJcrContext()

getDescriptor

public String getDescriptor(String descriptorKey)
Returns the value for the requested descriptorKey

Returns:
String descriptor value
See Also:
RepositoryDelegate.getDescriptor(java.lang.String)

nodeType

public NodeType nodeType(String name)
                  throws RepositoryException
Description copied from interface: RepositoryDelegate
Call to get NodeType based on specified name

Returns:
NodeType
Throws:
RepositoryException

nodeTypes

public List<NodeType> nodeTypes()
                         throws RepositoryException
Description copied from interface: RepositoryDelegate
Call to get all the NodeTypes defined.

Returns:
List of all the node types.
Throws:
RepositoryException

execute

public QueryResult execute(String query,
                           String language)
                    throws RepositoryException
This execute method is used for redirection so that the JNDI implementation can control calling execute.

Parameters:
query - is the sql query to execute
language - is the JCR language the query should be executed based on.
Returns:
QueryResult is the JCR query result
Throws:
RepositoryException
See Also:
Statement.execute(java.lang.String)

createRepository

protected void createRepository()
                         throws SQLException
Specified by:
createRepository in class AbstractRepositoryDelegate
Throws:
SQLException

isValid

public boolean isValid(int timeout)
                throws RepositoryException
Returns:
boolean indicating if timeout is valid
Throws:
RepositoryException
See Also:
Connection.isValid(int)

commit

public void commit()
            throws RepositoryException

Throws:
RepositoryException
See Also:
Connection.commit()

rollback

public void rollback()
              throws RepositoryException

Throws:
RepositoryException
See Also:
Connection.rollback()

close

public void close()
Call to close the delegate connection.

See Also:
Connection.close()

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Description copied from class: AbstractRepositoryDelegate

Specified by:
unwrap in interface RepositoryDelegate
Overrides:
unwrap in class AbstractRepositoryDelegate
Type Parameters:
T -
Parameters:
iface -
Returns:
T
Throws:
SQLException
See Also:
Wrapper.unwrap(java.lang.Class)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.