// Cast
assert factory instanceof SessionProxyFactory : "Specified factory " + factory.getClass().getName()
+ " is not of type " + SessionProxyFactory.class.getName() + " as required by "
+ StatefulContainer.class.getName() + ", but was instead " + factory;
SessionSpecProxyFactory sessionFactory = null;
sessionFactory = SessionSpecProxyFactory.class.cast(factory);
// Create Proxy
Object proxy = sessionFactory.createProxyEjb2x();
// Return
return proxy;
}