Ejemplo n.º 1
0
extern "C" AOS_DADADATA_API int aos_register(
  AOSInputExecutor& inputExecutor, 
  AOSModuleExecutor& moduleExecutor, 
  AOSOutputExecutor& outputExecutor, 
  AOSServices& services
)
{
  services.useLog().add(ASWNL("AOS_DadaData: aos_register"), ALog::EVENT_INFO);

  //a_Register template properties module
  moduleExecutor.registerModule(new AOSModule_DadaTemplateProperties(services));

  //Register the DADA template handler
  services.addTemplateHandler(new ATemplateNodeHandler_DADA(services));

  return 0;
}
Ejemplo n.º 2
0
extern "C" AOS_BLOG_API int aos_register(
  AOSInputExecutor& inputExecutor, 
  AOSModuleExecutor& moduleExecutor, 
  AOSOutputExecutor& outputExecutor, 
  AOSServices& services
)
{
  services.useLog().add(ASWNL("AOS_Blog: aos_register"), ALog::EVENT_INFO);

  //Register modules
  moduleExecutor.registerModule(new AOSModule_BlogView(services));
  
  return 0;
}
Ejemplo n.º 3
0
AOSContextManager::AOSContextManager(AOSServices& services) :
  m_Services(services),
  m_History(new ASync_CriticalSection()),
  m_ErrorHistory(new ASync_CriticalSection()),
  m_FreeStore(new ASync_CriticalSectionSpinLock())
{
  m_HistoryMaxSize = services.useConfiguration().useConfigRoot().getInt("/config/server/context-manager/history-maxsize", 100);
  m_ErrorHistoryMaxSize = services.useConfiguration().useConfigRoot().getInt("/config/server/context-manager/error-history-maxsize", 100);
  m_DefaultEventLogLevel = services.useConfiguration().useConfigRoot().getInt("/config/server/context-manager/log-level", 2);
  AASSERT(this, m_DefaultEventLogLevel >= AEventVisitor::EL_NONE && m_DefaultEventLogLevel <= AEventVisitor::EL_DEBUG);
  m_FreeStoreMaxSize = services.useConfiguration().useConfigRoot().getInt("/config/server/context-manager/freestore/max-size", 500);
  size_t freeStoreInitialSize = services.useConfiguration().useConfigRoot().getInt("/config/server/context-manager/freestore/initial-size", 100);
  AASSERT(this, freeStoreInitialSize <= m_FreeStoreMaxSize && freeStoreInitialSize >= 0);

  m_Queues.resize(AOSContextManager::STATE_LAST, NULL);

  for (int i=0; i<freeStoreInitialSize; ++i)
  {
    m_FreeStore.pushBack(new AOSContext(NULL, m_Services));
  }

  adminRegisterObject(m_Services.useAdminRegistry());
}
Ejemplo n.º 4
0
extern "C" AOS_EXAMPLE_API int aos_register(
    AOSInputExecutor& inputExecutor,
    AOSModuleExecutor& moduleExecutor,
    AOSOutputExecutor& outputExecutor,
    AOSServices& services
)
{
    services.useLog().add(ASWNL("AOS_Example: aos_register"), ALog::EVENT_INFO);

    //Register modules
    moduleExecutor.registerModule(new AOSModule_rss20(services));

    //Register output generators
    outputExecutor.registerOutputGenerator(new AOSOutput_generate_image(services));

    return 0;
}
Ejemplo n.º 5
0
AOSContextQueue_IsAvailable::AOSContextQueue_IsAvailable(
  AOSServices& services,
  size_t queueCount  // = 1
) :
  AOSContextQueueInterface(services),
  m_queueCount(queueCount),
  m_currentQueue(0)
{
  m_Queues.resize(m_queueCount);
  for (size_t i=0; i<m_queueCount; ++i)
    m_Queues.at(i) = new AOSContextQueue_IsAvailable::QueueWithThread();

  m_NoDataTimeout = m_Services.useConfiguration().getConfigRoot().getInt(ASW("/config/server/context-queue/is-available/no-data-timeout",57), 60000);
  m_EmptyQueueDelay = m_Services.useConfiguration().getConfigRoot().getInt(ASW("/config/server/context-queue/is-available/empty-queue-sleep-delay",65), 20);
  m_LoopDelay = m_Services.useConfiguration().getConfigRoot().getInt(ASW("/config/server/context-queue/is-available/loop-delay",52), 5);

  adminRegisterObject(services.useAdminRegistry());
}
Ejemplo n.º 6
0
extern "C" AOS_BASEMODULES_API int aos_register(
  AOSInputExecutor& inputExecutor, 
  AOSModuleExecutor& moduleExecutor, 
  AOSOutputExecutor& outputExecutor, 
  AOSServices& services
)
{
  services.useLog().add(ASWNL("AOS_BaseModules: aos_register"), ALog::EVENT_INFO);

  //Register input processors
  inputExecutor.registerInputProcessor(new AOSInput_HtmlForm(services));
  inputExecutor.registerInputProcessor(new AOSInput_NOP(services));
  inputExecutor.registerInputProcessor(new AOSInput_HtmlFormMultiPart(services));

  //Register modules
  moduleExecutor.registerModule(new AOSModule_NOP(services));
  moduleExecutor.registerModule(new AOSModule_ExecuteQuery(services));
  moduleExecutor.registerModule(new AOSModule_AlterContext(services));
  moduleExecutor.registerModule(new AOSModule_SetSessionLocale(services));
  moduleExecutor.registerModule(new AOSModule_InsertIntoModel(services));
  moduleExecutor.registerModule(new AOSModule_Template(services));
  moduleExecutor.registerModule(new AOSModule_LuaScript(services));
  moduleExecutor.registerModule(new AOSModule_FileList(services));
  moduleExecutor.registerModule(new AOSModule_SaveToFile(services));
  moduleExecutor.registerModule(new AOSModule_AddStatistics(services));
  
  //Register output generators
  outputExecutor.registerOutputGenerator(new AOSOutput_NOP(services));
  outputExecutor.registerOutputGenerator(new AOSOutput_XML(services));
  outputExecutor.registerOutputGenerator(new AOSOutput_JSON(services));
  outputExecutor.registerOutputGenerator(new AOSOutput_Template(services));
  outputExecutor.registerOutputGenerator(new AOSOutput_File(services));
  outputExecutor.registerOutputGenerator(new AOSOutput_Redirect(services));

  //a_XSLT is OS specific, on Windows we use MSXML6 which so far is the fastest one around
#ifdef __WINDOWS__
  outputExecutor.registerOutputGenerator(new AOSOutput_MsXslt(services));
#endif

  return 0;
}