// now get hold of the StatefulSessionFactory from the context
Object target = this.endpointContext.getTarget();
assert target instanceof Endpoint : "Unexpected object type found " + target + " - expected a " + Endpoint.class;
Endpoint endpoint = (Endpoint) target;
if (!endpoint.isSessionAware())
{
throw new IllegalStateException("Endpoint " + endpoint
+ " is not session aware. Cannot be used for Stateful no-interface view(s)");
}
// create the session
Serializable session = endpoint.getSessionFactory().createSession(null, null);
logger.debug("Created session " + session + " for " + this.beanClass);
// create an invocation handler
InvocationHandler invocationHandler = new NoInterfaceViewInvocationHandler(this.endpointContext, session);