code: protected ActivityContext createActivityContext(ContextRuleAssistant assistant)
              throws BeanReferenceException, IllegalRuleException {
          initContextEnvironment(assistant);
  
          AspectranActivityContext activityContext = new AspectranActivityContext(assistant.getContextEnvironment());
  
          AspectRuleRegistry aspectRuleRegistry = assistant.getAspectRuleRegistry();
  
          BeanRuleRegistry beanRuleRegistry = assistant.getBeanRuleRegistry();
          beanRuleRegistry.postProcess(assistant);
  
          BeanReferenceInspector beanReferenceInspector = assistant.getBeanReferenceInspector();
          beanReferenceInspector.inspect(beanRuleRegistry);
  
          initAspectRuleRegistry(assistant);
  
          BeanProxifierType beanProxifierType = BeanProxifierType.resolve((String)assistant.getSetting(DefaultSettingType.BEAN_PROXIFIER));
          ContextBeanRegistry contextBeanRegistry = new ContextBeanRegistry(activityContext, beanRuleRegistry, beanProxifierType);
  
          TemplateRuleRegistry templateRuleRegistry = assistant.getTemplateRuleRegistry();
          ContextTemplateRenderer contextTemplateRenderer = new ContextTemplateRenderer(activityContext, templateRuleRegistry);
  
          ScheduleRuleRegistry scheduleRuleRegistry = assistant.getScheduleRuleRegistry();
          TransletRuleRegistry transletRuleRegistry = assistant.getTransletRuleRegistry();
  
          activityContext.setAspectRuleRegistry(aspectRuleRegistry);
          activityContext.setContextBeanRegistry(contextBeanRegistry);
          activityContext.setScheduleRuleRegistry(scheduleRuleRegistry);
          activityContext.setContextTemplateRenderer(contextTemplateRenderer);
          activityContext.setTransletRuleRegistry(transletRuleRegistry);
          activityContext.setDescription(assistant.getAssistantLocal().getDescription());
  
          return activityContext;
      }
docs: Returns a new instance of ActivityContext.
  
  @param assistant the context rule assistant
  @return the activity context
  @throws BeanReferenceException will be thrown when cannot resolve reference to bean
  @throws IllegalRuleException if an illegal rule is found