com.tibco.amf.sharedresource.runtime.core.hibernate.sharedresource
Interface ProxySessionFactory


public interface ProxySessionFactory

Proxy for the SessionFactory that handles dynamically creating new SessionFactories under the covers with added mappings.


Method Summary
 void addClass(java.lang.Class<?> ejbClass)
          Add a new mapping for the specified class to the SessionFactory.
 void addClasses(java.lang.Class<?>[] ejbClasses)
          Add new mappings for the specified classes to the SessionFactory.
 void addURL(java.net.URL url)
          Add a new mapping to the SessionFactory.
 void addURLs(java.net.URL[] urls)
          Add new mappings to the SessionFactory.
 boolean isClassRegistered(java.lang.Class<?> pojoClass)
          Determine if the specified class registered already with the ProxySessionFactory.
 void removeClass(java.lang.Class<?> ejbClass)
          Remove a mapping from the SessionFactory if the refcount is 0.
 void removeClasses(java.lang.Class<?>[] ejbClasses)
          Remove classes from the SessionFactory if the refcount reaches 0.
 void removeURL(java.net.URL url)
          Remove a mapping from the SessionFactory if the refcount is 0.
 void removeURLs(java.net.URL[] urls)
          Remove mappings from the SessionFactory if the refcount reaches 0.
 void setNamingStrategy(NamingStrategy namingStrategy)
          Set the naming strategy to use for the Hibernate SessionFactory.
 

Method Detail

addURL

void addURL(java.net.URL url)
            throws InvalidMappingException
Add a new mapping to the SessionFactory.

Parameters:
url - non-null URL to mapping.
Throws:
InvalidMappingException - If the mapping for the class has already been registered with this ProxySessionFactory.

addURLs

void addURLs(java.net.URL[] urls)
Add new mappings to the SessionFactory.

Parameters:
urls - non-null array of URLs to mappings.

addClass

void addClass(java.lang.Class<?> ejbClass)
              throws InvalidMappingException
Add a new mapping for the specified class to the SessionFactory. Note that the current thread's context ClassLoader must be able to resolve a .hbm.xml file in the same directory that the class file was found.

Parameters:
ejbClass - the class to add.
Throws:
InvalidMappingException - If the mapping for the class has already been registered with this ProxySessionFactory.

addClasses

void addClasses(java.lang.Class<?>[] ejbClasses)
                throws InvalidMappingException
Add new mappings for the specified classes to the SessionFactory. Note that the current thread's context ClassLoader must be able to resolve a .hbm.xml file in the same directory that the class file was found.

Parameters:
ejbClasses - array of classes to add.
Throws:
InvalidMappingException - If the mapping for any of the classes have already been registered with this ProxySessionFactory.

isClassRegistered

boolean isClassRegistered(java.lang.Class<?> pojoClass)
Determine if the specified class registered already with the ProxySessionFactory.

Parameters:
pojoClass - the non-null class to check
Returns:
true if registered; otherwise, false.

removeURL

void removeURL(java.net.URL url)
               throws InvalidMappingException
Remove a mapping from the SessionFactory if the refcount is 0.

Parameters:
url - non-null URL to mapping.
Throws:
InvalidMappingException - If the mapping for the class has already been registered with this ProxySessionFactory.

removeClass

void removeClass(java.lang.Class<?> ejbClass)
                 throws InvalidMappingException
Remove a mapping from the SessionFactory if the refcount is 0. Note that the current thread's context ClassLoader must be able to resolve a .hbm.xml file in the same directory that the class file was found.

Parameters:
ejbClass - the class to add.
Throws:
InvalidMappingException - If the mapping for the class has already been registered with this ProxySessionFactory.

removeURLs

void removeURLs(java.net.URL[] urls)
Remove mappings from the SessionFactory if the refcount reaches 0.

Parameters:
urls - non-null array of URLs to mappings.

removeClasses

void removeClasses(java.lang.Class<?>[] ejbClasses)
Remove classes from the SessionFactory if the refcount reaches 0.

Parameters:
urls - non-null array of URLs to mappings.

setNamingStrategy

void setNamingStrategy(NamingStrategy namingStrategy)
Set the naming strategy to use for the Hibernate SessionFactory.

Parameters:
namingStrategy - non-null naming strategy.


Copyright © 2011 TIBCO Software Inc. All Rights Reserved.