Search in sources :

Example 11 with SessionID

use of org.jboss.ejb.client.SessionID in project wildfly by wildfly.

the class LocalEjbReceiver method createSession.

@Override
protected <T> StatefulEJBLocator<T> createSession(StatelessEJBLocator<T> statelessLocator, NamingProvider namingProvider) throws Exception {
    final EjbDeploymentInformation ejbInfo = findBean(statelessLocator);
    final EJBComponent component = ejbInfo.getEjbComponent();
    if (!(component instanceof StatefulSessionComponent)) {
        throw EjbLogger.ROOT_LOGGER.notStatefulSessionBean(statelessLocator.getAppName(), statelessLocator.getModuleName(), statelessLocator.getDistinctName(), statelessLocator.getBeanName());
    }
    final StatefulSessionComponent statefulComponent = (StatefulSessionComponent) component;
    final SessionID sessionID = statefulComponent.createSession();
    return statelessLocator.withSession(sessionID);
}
Also used : EjbDeploymentInformation(org.jboss.as.ejb3.deployment.EjbDeploymentInformation) StatefulSessionComponent(org.jboss.as.ejb3.component.stateful.StatefulSessionComponent) EJBComponent(org.jboss.as.ejb3.component.EJBComponent) SessionID(org.jboss.ejb.client.SessionID)

Aggregations

SessionID (org.jboss.ejb.client.SessionID)11 Component (org.jboss.as.ee.component.Component)3 ComponentView (org.jboss.as.ee.component.ComponentView)3 StatefulSessionComponent (org.jboss.as.ejb3.component.stateful.StatefulSessionComponent)3 EJBComponent (org.jboss.as.ejb3.component.EJBComponent)2 EjbDeploymentInformation (org.jboss.as.ejb3.deployment.EjbDeploymentInformation)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 CancellationException (java.util.concurrent.CancellationException)1 Executor (java.util.concurrent.Executor)1