String factoryName = "&managed:"+factoryClass.getName();
    protected Object wrap( InvocationContext context, String factoryName ) throws Exception    {        try {            login();            AOPAdapter adapter =             AOPAdapter.create(                     (ProxyFactoryBean) applicationContext.getBean(factoryName),                    context );            return adapter.proceed( );           } catch (Throwable t) {            throw translateException( t );        } finally {            logout();        }    }