org.springframework.extensions.jcr
Class JcrAccessor

java.lang.Object
  extended by org.springframework.extensions.jcr.JcrAccessor
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
JcrInterceptor, JcrTemplate

public abstract class JcrAccessor
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean

Base class for JcrTemplate and JcrInterceptor, defining common properties like JcrSessionFactory. The required property is sessionFactory.

Not intended to be used directly. See JcrTemplate and JcrInterceptor.

Author:
Costin Leau, Sergio Bossa, Salvatore Incandela
See Also:
JcrTemplate, JcrInterceptor

Constructor Summary
JcrAccessor()
           
 
Method Summary
 void afterPropertiesSet()
          Eagerly initialize the session holder provider, creating a default one if one is not set.
 org.springframework.dao.DataAccessException convertJcrAccessException(java.io.IOException ex)
          Convert the given IOException to an appropriate exception from the org.springframework.dao hierarchy.
 org.springframework.dao.DataAccessException convertJcrAccessException(javax.jcr.RepositoryException ex)
          Convert the given RepositoryException to an appropriate exception from the org.springframework.dao hierarchy.
 java.lang.RuntimeException convertJcrAccessException(java.lang.RuntimeException ex)
          Convert the given RuntimeException to an appropriate exception from the org.springframework.dao hierarchy.
 SessionFactory getSessionFactory()
           
 void setSessionFactory(SessionFactory sessionFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcrAccessor

public JcrAccessor()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Eagerly initialize the session holder provider, creating a default one if one is not set.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

convertJcrAccessException

public org.springframework.dao.DataAccessException convertJcrAccessException(javax.jcr.RepositoryException ex)
Convert the given RepositoryException to an appropriate exception from the org.springframework.dao hierarchy.

May be overridden in subclasses.

Parameters:
ex - RepositoryException that occured
Returns:
the corresponding DataAccessException instance

convertJcrAccessException

public org.springframework.dao.DataAccessException convertJcrAccessException(java.io.IOException ex)
Convert the given IOException to an appropriate exception from the org.springframework.dao hierarchy.

May be overridden in subclasses.

Parameters:
ex - IOException that occured
Returns:
the corresponding DataAccessException instance

convertJcrAccessException

public java.lang.RuntimeException convertJcrAccessException(java.lang.RuntimeException ex)
Convert the given RuntimeException to an appropriate exception from the org.springframework.dao hierarchy.

May be overridden in subclasses.

Parameters:
ex -
Returns:

getSessionFactory

public SessionFactory getSessionFactory()
Returns:
Returns the sessionFactory.

setSessionFactory

public void setSessionFactory(SessionFactory sessionFactory)
Parameters:
sessionFactory - The sessionFactory to set.


Copyright © 2009. All Rights Reserved.