// Apply any custom security checks
if( securityProxy != null )
{
EnterpriseContext ectx = (EnterpriseContext)mi.getEnterpriseContext();
Object bean = ectx.getInstance();
EJBContext ctx = ectx.getEJBContext();
Object[] args = mi.getArguments();
securityProxy.setEJBContext(ctx);
try
{
securityProxy.invoke(mi.getMethod(), args, bean);