return create(null, null);
}
protected BeanContext<?> create(Class[] initTypes, Object[] initValues)
{
BeanContext ctx;
ctx = createBeanContext();
if (ctx instanceof StatefulBeanContext)
{
StatefulBeanContext sfctx = (StatefulBeanContext) ctx;
// FIXME: remove this class cast
EJBContainer c = (EJBContainer) container;
// Tell context how to handle replication
CacheConfig config = c.getAnnotation(CacheConfig.class);
if (config != null)
{
sfctx.setReplicationIsPassivation(config.replicationIsPassivation());
}
// this is for propagated extended PC's
ctx = sfctx = sfctx.pushContainedIn();
}
container.pushContext(ctx);
try
{
if (injectors != null)
{
for (int i = 0; i < injectors.length; i++)
{
injectors[i].inject(ctx);
}
}
ctx.initialiseInterceptorInstances();
}
finally
{
container.popContext();
if (ctx instanceof StatefulBeanContext)
{
// this is for propagated extended PC's
StatefulBeanContext sfctx = (StatefulBeanContext) ctx;
sfctx.popContainedIn();
}
}
container.invokePostConstruct(ctx, initValues);
//TODO This needs to be reimplemented as replacement for create() on home interface
container.invokeInit(ctx.getInstance(), initTypes, initValues);
++createCount;
return ctx;
}