com.caucho.amber
Class EnvAmberManager

java.lang.Object
  extended by com.caucho.amber.EnvAmberManager

public class EnvAmberManager
extends java.lang.Object

Main interface between Resin and the connector. It's the top-level SPI class for creating the SPI ManagedConnections. The resource configuration in Resin's web.xml will use bean-style configuration to configure the ManagecConnectionFactory.


Method Summary
 void addAmberManager(AmberPersistenceUnit manager)
          Adds an amber manager.
 void addEntityHome(java.lang.String name, AmberEntityHome home)
          Adds the entity home.
 void complete(java.util.ArrayList<AmberCompletion> completions)
          Completions affecting the cache.
 AmberConnection createAmberConnection(boolean isExtended)
          Returns the cache connection.
static EnvAmberManager createLocal()
           
 void destroy()
          destroys the manager.
 java.lang.ClassLoader getEnhancedLoader()
          Returns the enhanced loader.
 EntityItem getEntity(EntityType rootType, java.lang.Object key)
          Returns the query result.
 EntityType getEntity(java.lang.String className)
          Returns a matching entity.
 EntityType getEntityByInstanceClass(java.lang.String className)
          Returns a matching entity.
 AmberEntityHome getEntityHome(java.lang.String name)
          Returns the entity home.
 EntityItem getEntityItem(java.lang.String homeName, java.lang.Object key)
          Returns the entity item.
 AmberGenerator getGenerator()
          Sets the generator.
 AmberEntityHome getHome(java.lang.Class cl)
          Returns an EntityHome.
 JClassLoader getJClassLoader()
          Returns the enhanced loader.
 ResultSetCacheChunk getQueryChunk(QueryCacheKey key)
          Returns the query result.
 long getTableCacheTimeout()
          Get the default table cache time.
 long getXid()
          Returns a new xid.
 void init()
          Initialize the resource.
 void initEntityHomes()
          Initialize the home interfaces.
 void initLoaders()
          Initialize the resource.
 EntityItem putEntity(EntityType rootType, java.lang.Object key, EntityItem entity)
          Sets the entity result.
 void putQueryChunk(QueryCacheKey key, ResultSetCacheChunk chunk)
          Sets the query result.
 EntityItem removeEntity(EntityType rootType, java.lang.Object key)
          Remove the entity result.
 void setGenerator(AmberGenerator generator)
          Sets the generator.
 void setTableCacheTimeout(long timeout)
          Set the default table cache time.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createLocal

public static EnvAmberManager createLocal()

addAmberManager

public void addAmberManager(AmberPersistenceUnit manager)
Adds an amber manager.


setTableCacheTimeout

public void setTableCacheTimeout(long timeout)
Set the default table cache time.


getTableCacheTimeout

public long getTableCacheTimeout()
Get the default table cache time.


getXid

public long getXid()
Returns a new xid.


getEnhancedLoader

public java.lang.ClassLoader getEnhancedLoader()
Returns the enhanced loader.


getJClassLoader

public JClassLoader getJClassLoader()
Returns the enhanced loader.


addEntityHome

public void addEntityHome(java.lang.String name,
                          AmberEntityHome home)
Adds the entity home.


getEntityHome

public AmberEntityHome getEntityHome(java.lang.String name)
Returns the entity home.


getEntity

public EntityType getEntity(java.lang.String className)
Returns a matching entity.


getEntityByInstanceClass

public EntityType getEntityByInstanceClass(java.lang.String className)
Returns a matching entity.


setGenerator

public void setGenerator(AmberGenerator generator)
Sets the generator.


getGenerator

public AmberGenerator getGenerator()
Sets the generator.


initLoaders

public void initLoaders()
                 throws ConfigException,
                        java.io.IOException
Initialize the resource.

Throws:
ConfigException
java.io.IOException

createAmberConnection

public AmberConnection createAmberConnection(boolean isExtended)
Returns the cache connection.


initEntityHomes

public void initEntityHomes()
                     throws java.lang.Exception
Initialize the home interfaces.

Throws:
java.lang.Exception

init

public void init()
          throws ConfigException,
                 java.io.IOException
Initialize the resource.

Throws:
ConfigException
java.io.IOException

getHome

public AmberEntityHome getHome(java.lang.Class cl)
Returns an EntityHome.


getQueryChunk

public ResultSetCacheChunk getQueryChunk(QueryCacheKey key)
Returns the query result.


putQueryChunk

public void putQueryChunk(QueryCacheKey key,
                          ResultSetCacheChunk chunk)
Sets the query result.


getEntityItem

public EntityItem getEntityItem(java.lang.String homeName,
                                java.lang.Object key)
                         throws AmberException
Returns the entity item.

Throws:
AmberException

getEntity

public EntityItem getEntity(EntityType rootType,
                            java.lang.Object key)
Returns the query result.


putEntity

public EntityItem putEntity(EntityType rootType,
                            java.lang.Object key,
                            EntityItem entity)
Sets the entity result.


removeEntity

public EntityItem removeEntity(EntityType rootType,
                               java.lang.Object key)
Remove the entity result.


complete

public void complete(java.util.ArrayList<AmberCompletion> completions)
Completions affecting the cache.


destroy

public void destroy()
destroys the manager.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object