com.caucho.ejb
Class EJBServer

java.lang.Object
  extended by com.caucho.ejb.EJBServer
All Implemented Interfaces:
EnvironmentBean

public class EJBServer
extends java.lang.Object
implements EnvironmentBean

Server containing all the EJBs for a given configuration.

Each protocol will extend the container to override Handle creation.


Field Summary
protected static EnvironmentLocal<java.lang.String> _localURL
           
protected static java.util.logging.Logger log
           
 
Constructor Summary
EJBServer()
          Create a server with the given prefix name.
 
Method Summary
 void addEJBJar(Path ejbJar)
          Adds an ejb jar.
 void addJarUrls(EnvironmentClassLoader loader, Path root)
           
 EnvironmentClassLoader getClassLoader()
          Gets the environment class loader.
 ConnectionFactory getConnectionFactory()
          Gets the jndi name of the jmsQueueConnectionFactory
 boolean getCreateDatabaseSchema()
          True if database schema should be generated automatically.
 java.lang.String getEntityManagerJndiName()
          Gets the EntityManager JNDI name.
 java.lang.String getJdbcIsolation()
          Gets the JDBC isolation.
static EJBServer getLocal()
           
 java.lang.String getResinIsolation()
          Gets the Resin isolation.
 long getTransactionTimeout()
          Gets transaction timeout.
 java.lang.String getURLPrefix()
          Gets the URL-prefix for all external beans.
 boolean getValidateDatabaseSchema()
          True if database schema should be validated automatically.
 void init()
          Initialize the container.
 void initEJBs()
          Initialize all EJBs for any *.ejb or ejb-jar.xml in the WEB-INF or in a META-INF in the classpath.
 boolean isAllowPOJO()
          If true, allow POJO beans
 boolean isAutoCompile()
          If true, automatically compile old EJBs.
 void manualInit()
          Initialize the container.
 void setAllowPOJO(boolean allowPOJO)
          Set true to allow POJO beans
 void setAutoCompile(boolean autoCompile)
          Set true to automatically compile old EJBs.
 void setConfigDirectory(Path path)
           
 void setCreateDatabaseSchema(boolean create)
          Sets true if database schema should be generated automatically.
 void setDataSource(javax.sql.DataSource dataSource)
          Sets the data-source
 void setEntityManagerJndiName(java.lang.String name)
          Sets the EntityManager JNDI name.
 void setEnvironmentClassLoader(EnvironmentClassLoader env)
          Sets the environment class loader.
 void setForbidJvmCall(boolean forbid)
          If true, JVM calls are forbidden.
 void setJdbcIsolation(java.lang.String jdbcIsolation)
          Sets the JDBC isolation.
 void setJMSConnectionFactory(JndiBuilder factory)
          Sets the jndi name of the jmsConnectionFactory
 void setJndiLocalPrefix(java.lang.String name)
          Gets the JNDI name.
 void setJndiName(java.lang.String name)
          Sets the JNDI name.
 void setJndiPrefix(java.lang.String name)
          Sets the JNDI name.
 void setJndiRemotePrefix(java.lang.String name)
          Gets the remote JNDI name.
 void setLoadLazyOnTransaction(boolean isLazy)
          Sets true if database schema should be validated automatically.
 void setMessageConsumerMax(int consumerMax)
          Sets consumer max
 void setName(java.lang.String name)
          Sets the JNDI name.
 void setReadDataSource(javax.sql.DataSource dataSource)
          Sets the data-source
 void setResinIsolation(java.lang.String resinIsolation)
          Sets the Resin isolation.
 void setStartupMode(java.lang.String startupMode)
          Sets the EJB server startup mode.
 void setTransactionTimeout(Period timeout)
          Sets the transaction timeout.
 void setURLPrefix(java.lang.String urlPrefix)
          Sets the URL-prefix for all external beans.
 void setValidateDatabaseSchema(boolean validate)
          Sets true if database schema should be validated automatically.
 void setXADataSource(javax.sql.DataSource dataSource)
          Sets the xa data-source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log

_localURL

protected static EnvironmentLocal<java.lang.String> _localURL
Constructor Detail

EJBServer

public EJBServer()
          throws ConfigException
Create a server with the given prefix name.

Throws:
ConfigException
Method Detail

addJarUrls

public void addJarUrls(EnvironmentClassLoader loader,
                       Path root)
                throws java.io.IOException
Throws:
java.io.IOException

getClassLoader

public EnvironmentClassLoader getClassLoader()
Gets the environment class loader.

Specified by:
getClassLoader in interface EnvironmentBean

setEnvironmentClassLoader

public void setEnvironmentClassLoader(EnvironmentClassLoader env)
Sets the environment class loader.


setName

public void setName(java.lang.String name)
Sets the JNDI name.


setJndiName

public void setJndiName(java.lang.String name)
Sets the JNDI name.


setJndiPrefix

public void setJndiPrefix(java.lang.String name)
Sets the JNDI name.


setJndiLocalPrefix

public void setJndiLocalPrefix(java.lang.String name)
Gets the JNDI name.


setJndiRemotePrefix

public void setJndiRemotePrefix(java.lang.String name)
Gets the remote JNDI name.


setEntityManagerJndiName

public void setEntityManagerJndiName(java.lang.String name)
Sets the EntityManager JNDI name.


getEntityManagerJndiName

public java.lang.String getEntityManagerJndiName()
Gets the EntityManager JNDI name.


setURLPrefix

public void setURLPrefix(java.lang.String urlPrefix)
Sets the URL-prefix for all external beans.


getURLPrefix

public java.lang.String getURLPrefix()
Gets the URL-prefix for all external beans.


setConfigDirectory

public void setConfigDirectory(Path path)

addEJBJar

public void addEJBJar(Path ejbJar)
               throws ConfigException
Adds an ejb jar.

Throws:
ConfigException

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)
                   throws ConfigException
Sets the data-source

Throws:
ConfigException

setReadDataSource

public void setReadDataSource(javax.sql.DataSource dataSource)
                       throws ConfigException
Sets the data-source

Throws:
ConfigException

setXADataSource

public void setXADataSource(javax.sql.DataSource dataSource)
                     throws ConfigException
Sets the xa data-source

Throws:
ConfigException

setCreateDatabaseSchema

public void setCreateDatabaseSchema(boolean create)
Sets true if database schema should be generated automatically.


getCreateDatabaseSchema

public boolean getCreateDatabaseSchema()
True if database schema should be generated automatically.


setValidateDatabaseSchema

public void setValidateDatabaseSchema(boolean validate)
Sets true if database schema should be validated automatically.


getValidateDatabaseSchema

public boolean getValidateDatabaseSchema()
True if database schema should be validated automatically.


setLoadLazyOnTransaction

public void setLoadLazyOnTransaction(boolean isLazy)
Sets true if database schema should be validated automatically.


setJMSConnectionFactory

public void setJMSConnectionFactory(JndiBuilder factory)
                             throws ConfigException,
                                    javax.naming.NamingException
Sets the jndi name of the jmsConnectionFactory

Throws:
ConfigException
javax.naming.NamingException

getConnectionFactory

public ConnectionFactory getConnectionFactory()
Gets the jndi name of the jmsQueueConnectionFactory


setMessageConsumerMax

public void setMessageConsumerMax(int consumerMax)
                           throws ConfigException,
                                  javax.naming.NamingException
Sets consumer max

Throws:
ConfigException
javax.naming.NamingException

getTransactionTimeout

public long getTransactionTimeout()
Gets transaction timeout.


setTransactionTimeout

public void setTransactionTimeout(Period timeout)
Sets the transaction timeout.


getResinIsolation

public java.lang.String getResinIsolation()
Gets the Resin isolation.


setResinIsolation

public void setResinIsolation(java.lang.String resinIsolation)
Sets the Resin isolation.


getJdbcIsolation

public java.lang.String getJdbcIsolation()
Gets the JDBC isolation.


setJdbcIsolation

public void setJdbcIsolation(java.lang.String jdbcIsolation)
Sets the JDBC isolation.


setForbidJvmCall

public void setForbidJvmCall(boolean forbid)
If true, JVM calls are forbidden.


isAutoCompile

public boolean isAutoCompile()
If true, automatically compile old EJBs.


setAutoCompile

public void setAutoCompile(boolean autoCompile)
Set true to automatically compile old EJBs.


isAllowPOJO

public boolean isAllowPOJO()
If true, allow POJO beans


setAllowPOJO

public void setAllowPOJO(boolean allowPOJO)
Set true to allow POJO beans


setStartupMode

public void setStartupMode(java.lang.String startupMode)
Sets the EJB server startup mode.


getLocal

public static EJBServer getLocal()

init

@PostConstruct
public void init()
Initialize the container.


manualInit

public void manualInit()
                throws java.lang.Exception
Initialize the container.

Throws:
java.lang.Exception

initEJBs

public void initEJBs()
              throws java.lang.Exception
Initialize all EJBs for any *.ejb or ejb-jar.xml in the WEB-INF or in a META-INF in the classpath.

Throws:
java.lang.Exception