Package org.springmodules.prevayler

Source Code of org.springmodules.prevayler.PrevaylerAccessor

package org.springmodules.prevayler;

import org.springframework.beans.BeanInstantiationException;
import org.springframework.beans.factory.InitializingBean;

/**
* Base class for prevayler templates.
*
* @author Sergio Bossa
*/
public class PrevaylerAccessor implements InitializingBean {
   
    private PersistenceManager persistenceManager;

    /**
     * Give access to the {@link PersistenceManager}.
     */
    public PersistenceManager getPersistenceManager() {
        return this.persistenceManager;
    }

    /**
     * Set the {@link PersistenceManager} to use.
     */
    public void setPersistenceManager(PersistenceManager persistenceManager) {
        this.persistenceManager = persistenceManager;
    }
   
    public void afterPropertiesSet() throws Exception {
        if (this.persistenceManager == null) {
            throw new BeanInstantiationException(this.getClass(), "No persistence manager found!");
        }
    }
}
TOP

Related Classes of org.springmodules.prevayler.PrevaylerAccessor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.