} else if (easyBeansFactory instanceof StatefulSessionFactory) {
context = new EasyBeansSessionContext<StatefulSessionFactory>((StatefulSessionFactory) easyBeansFactory);
} else if (easyBeansFactory instanceof SingletonSessionFactory) {
context = new EasyBeansSessionContext<SingletonSessionFactory>((SingletonSessionFactory) easyBeansFactory);
} else if (easyBeansFactory instanceof MDBFactory) {
context = new EasyBeansMessageDrivenContext((MDBFactory) easyBeansFactory);
} else {
throwException(cne, new IllegalStateException("Unable to detect factory type '" + easyBeansFactory + "'"));
}