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();
}
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();
}
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);
}
Aggregations