All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mysema.rdfbean.object.SessionFactory Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2010 Mysema Ltd.
 * All rights reserved.
 * 
 */
package com.mysema.rdfbean.object;

import javax.annotation.Nullable;

/**
 * Creates Sessions and provides access to the thread bound session
 * 
 * @author sasa
 * 
 */
public interface SessionFactory {

    /**
     * Create a backend connection and open a Session for it
     * 
     * @return
     */
    Session openSession();

    /**
     * Get the current session
     * 
     * @return
     */
    @Nullable
    Session getCurrentSession();

    /**
     * Initialize the SessionFactory
     */
    void initialize();

    /**
     * Close the SessionFactory
     */
    void close();

    /**
     * Set the SessionContext
     * 
     * @param sessionContext
     */
    void setSessionContext(SessionContext sessionContext);

    /**
     * Execute the given SessionCallback in the scope of the current session or
     * a newly allocated, if no current is available
     * 
     * @param 
     * @param cb
     * @return
     */
     T execute(SessionCallback cb);

    /**
     * Returns configuration of SessionFactory 
     * @return
     */
    Configuration getConfiguration();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy