org.openxava.ejbx
Class BeansContextProviderFactory

java.lang.Object
  extended by org.openxava.ejbx.BeansContextProviderFactory

public class BeansContextProviderFactory
extends java.lang.Object

Factory for IContextProvider in order to accede to EJBs. This class provide the implementation of BeansContext, thus it's possible to setup the its behaviour declaratorily. It's requiredt to have a properties file called BeansContext.properties within CLASSPATH. This file must to have the form name=class. Like this:

 _defecto=javacomp
 _subcontexto=
 javacomp=puntocom.negocio.context.JavaCompBeansContextProvider
 jndi=puntocom.negocio.context.JndiBeansContextProvider
 
Or in English:
 _default=javacomp
 _subcontext=
 javacomp=puntocom.negocio.context.JavaCompBeansContextProvider
 jndi=puntocom.negocio.context.JndiBeansContextProvider
 
The entry _default/_defecto indicates the object used by default. The default object is created calling to indica el objeto usado por defecto. El create() without arguments. The classes used have to implement IContextProvider.
The entry _subcontext/_subcontexto indicates the lookup subcontext used, It can be left in blank or omit the entry, then it lookup from root subcontext.

Author:
Javier Paniza

Constructor Summary
BeansContextProviderFactory()
           
 
Method Summary
static IContextProvider create()
          Create a context provider to lookup EJBs by default.
static IContextProvider create(java.lang.String name)
          Create a context provider to lookup EJBs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeansContextProviderFactory

public BeansContextProviderFactory()
Method Detail

create

public static IContextProvider create()
                               throws InitException
Create a context provider to lookup EJBs by default.

Postcondition:

It works as indicate in entry _default/_defecto of BeansContext.properties.

Throws:
InitException - Some problem on init.

create

public static IContextProvider create(java.lang.String name)
                               throws InitException
Create a context provider to lookup EJBs.

Postcondition:

The argument is a identifier name of context provider, whose it's registered in BeansContext.properties file.

Throws:
InitException - Some problem on init.