org.modeshape.jdbc.delegate
Class FileRepositoryDelegate

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

public class FileRepositoryDelegate
extends Object
implements RepositoryDelegate

The FileRepositoryDelegate provides a local Repository implementation so that ModeShape JcrEngine will be run local to the JcrDriver. This is also referred to as an embedded mode.


Nested Class Summary
protected  class FileRepositoryDelegate.FileConnectionInfo
           
 
Field Summary
static TextDecoder URL_DECODER
           
 
Constructor Summary
FileRepositoryDelegate(String url, Properties info)
           
 
Method Summary
 void close()
          Call to close the delegate connection.
 void commit()
          
 Connection createConnection()
          Call to create the connection based on the implementation of this interface.
 DatabaseMetaData createMetaData(JcrConnection connection)
          Call to create the DatabaseMetaData
 QueryResult execute(String query, String language)
          This execute method is used for redirection so that the JNDI implementation can control calling execute.
 ConnectionInfo getConnectionInfo()
          Call to get the connection information.
 Set<String> getRepositoryNames()
          Called to get all the repository names currently available in the JcrEngine.
 boolean isValid(int timeout)
           
 boolean isWrapperFor(Class<?> iface)
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_DECODER

public static final TextDecoder URL_DECODER
Constructor Detail

FileRepositoryDelegate

public FileRepositoryDelegate(String url,
                              Properties info)
Method Detail

session

protected Session session()
                   throws RepositoryException
Throws:
RepositoryException

nodeType

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

Specified by:
nodeType in interface RepositoryDelegate
Returns:
NodeType
Throws:
RepositoryException

nodeTypes

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

Specified by:
nodeTypes in interface RepositoryDelegate
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.

Specified by:
execute in interface RepositoryDelegate
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)

createConnection

public Connection createConnection()
                            throws SQLException
Description copied from interface: RepositoryDelegate
Call to create the connection based on the implementation of this interface.

Specified by:
createConnection in interface RepositoryDelegate
Returns:
Connection
Throws:
SQLException

getConnectionInfo

public ConnectionInfo getConnectionInfo()
Description copied from interface: RepositoryDelegate
Call to get the connection information.

Specified by:
getConnectionInfo in interface RepositoryDelegate
Returns:
ConnectionInfo

commit

public void commit()
            throws RepositoryException

Specified by:
commit in interface RepositoryDelegate
Throws:
RepositoryException
See Also:
Connection.commit()

rollback

public void rollback()
              throws RepositoryException

Specified by:
rollback in interface RepositoryDelegate
Throws:
RepositoryException
See Also:
Connection.rollback()

close

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

Specified by:
close in interface RepositoryDelegate
See Also:
Connection.close()

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
Specified by:
isWrapperFor in interface RepositoryDelegate
Parameters:
iface -
Returns:
boolean
See Also:
Wrapper.isWrapperFor(java.lang.Class)

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface RepositoryDelegate
Type Parameters:
T -
Parameters:
iface -
Returns:
T
Throws:
SQLException
See Also:
Wrapper.unwrap(java.lang.Class)

isValid

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

getRepositoryNames

public Set<String> getRepositoryNames()
Description copied from interface: RepositoryDelegate
Called to get all the repository names currently available in the JcrEngine.

Specified by:
getRepositoryNames in interface RepositoryDelegate
Returns:
Set of repository names

createMetaData

public DatabaseMetaData createMetaData(JcrConnection connection)
                                throws RepositoryException
Description copied from interface: RepositoryDelegate
Call to create the DatabaseMetaData

Specified by:
createMetaData in interface RepositoryDelegate
Returns:
JcrMetaData
Throws:
RepositoryException


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