Example usage for javax.ejb EJBMetaData isSession

List of usage examples for javax.ejb EJBMetaData isSession

Introduction

In this page you can find the example usage for javax.ejb EJBMetaData isSession.

Prototype

boolean isSession();

Source Link

Document

Test if the enterprise bean's type is "session".

Usage

From source file:org.openamf.invoker.EJBServiceInvoker.java

private boolean checkPersistService(Object home) throws Exception {
    boolean persistService = false;
    if (home instanceof EJBHome) {
        EJBMetaData metaData = ((EJBHome) home).getEJBMetaData();
        if (metaData.isSession()) {
            if (metaData.isStatelessSession()) {
                log.debug("Stateless Session Bean");
                persistService = false;//  w  ww .  j  a  v a 2s  . c o  m
            } else {
                log.debug("Stateful Session Bean");
                persistService = true;
            }
        } else {
            log.debug("Not Session Bean, assume Entity EJB");
            persistService = true;
        }
    }

    return persistService;
}