Search in sources :

Example 1 with MAlertProcessor

use of org.compiere.model.MAlertProcessor in project adempiere by adempiere.

the class AdempiereServerMgr method startServers.

//	startEnvironment
/**
	 * 	Start Environment
	 *	@return true if started
	 */
private boolean startServers() {
    log.info("");
    int noServers = 0;
    //	Accounting
    MAcctProcessor[] acctModels = MAcctProcessor.getActive(m_ctx);
    for (int i = 0; i < acctModels.length; i++) {
        MAcctProcessor pModel = acctModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Request
    MRequestProcessor[] requestModels = MRequestProcessor.getActive(m_ctx);
    for (int i = 0; i < requestModels.length; i++) {
        MRequestProcessor pModel = requestModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Workflow
    MWorkflowProcessor[] workflowModels = MWorkflowProcessor.getActive(m_ctx);
    for (int i = 0; i < workflowModels.length; i++) {
        MWorkflowProcessor pModel = workflowModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Alert
    MAlertProcessor[] alertModels = MAlertProcessor.getActive(m_ctx);
    for (int i = 0; i < alertModels.length; i++) {
        MAlertProcessor pModel = alertModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Scheduler
    MScheduler[] schedulerModels = MScheduler.getActive(m_ctx);
    for (int i = 0; i < schedulerModels.length; i++) {
        MScheduler pModel = schedulerModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	LDAP
    MLdapProcessor[] ldapModels = MLdapProcessor.getActive(m_ctx);
    for (int i = 0; i < ldapModels.length; i++) {
        MLdapProcessor lp = ldapModels[i];
        AdempiereServer server = AdempiereServer.create(lp);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 1);
        m_servers.add(server);
    }
    //	ImportProcessor - @Trifon
    MIMPProcessor[] importModels = MIMPProcessor.getActive(m_ctx);
    for (int i = 0; i < importModels.length; i++) {
        MIMPProcessor lp = importModels[i];
        AdempiereServer server = AdempiereServer.create(lp);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 1);
        m_servers.add(server);
    }
    log.fine("#" + noServers);
    return startAll();
}
Also used : MRequestProcessor(org.compiere.model.MRequestProcessor) MLdapProcessor(org.compiere.model.MLdapProcessor) MAcctProcessor(org.compiere.model.MAcctProcessor) MIMPProcessor(org.compiere.model.MIMPProcessor) MWorkflowProcessor(org.compiere.wf.MWorkflowProcessor) MScheduler(org.compiere.model.MScheduler) MAlertProcessor(org.compiere.model.MAlertProcessor)

Example 2 with MAlertProcessor

use of org.compiere.model.MAlertProcessor in project adempiere by adempiere.

the class AlertProcessor method main.

//	getServerInfo
/***************************************************************************
	 * 	Test
	 *	@param args ignored
	 */
public static void main(String[] args) {
    Adempiere.startup(true);
    MAlertProcessor model = new MAlertProcessor(Env.getCtx(), 100, null);
    AlertProcessor ap = new AlertProcessor(model);
    ap.start();
}
Also used : MAlertProcessor(org.compiere.model.MAlertProcessor) MAlertProcessor(org.compiere.model.MAlertProcessor)

Example 3 with MAlertProcessor

use of org.compiere.model.MAlertProcessor in project adempiere by adempiere.

the class AlertTest method testAlertProcessor.

public void testAlertProcessor() {
    MAlertProcessor alertpro = new MAlertProcessor(getCtx(), 100, null);
    alertpro.setAD_AlertProcessor_ID(100);
    MAlertProcessorLog[] test = (MAlertProcessorLog[]) alertpro.getLogs();
    assertTrue("Alert Processor has logs", test.length > 0);
    MAlert[] alerts = (MAlert[]) alertpro.getAlerts(true);
    assertTrue("There are alerts", alerts.length > 0);
    assertTrue("There are active recs", MAlertProcessor.getActive(getCtx()).length > 0);
}
Also used : MAlert(org.compiere.model.MAlert) MAlertProcessorLog(org.compiere.model.MAlertProcessorLog) MAlertProcessor(org.compiere.model.MAlertProcessor)

Aggregations

MAlertProcessor (org.compiere.model.MAlertProcessor)3 MAcctProcessor (org.compiere.model.MAcctProcessor)1 MAlert (org.compiere.model.MAlert)1 MAlertProcessorLog (org.compiere.model.MAlertProcessorLog)1 MIMPProcessor (org.compiere.model.MIMPProcessor)1 MLdapProcessor (org.compiere.model.MLdapProcessor)1 MRequestProcessor (org.compiere.model.MRequestProcessor)1 MScheduler (org.compiere.model.MScheduler)1 MWorkflowProcessor (org.compiere.wf.MWorkflowProcessor)1