use of com.twinsoft.convertigo.engine.requesters.InternalHttpServletRequest in project convertigo by convertigo.
the class Project method executeAutoStartSequences.
public static void executeAutoStartSequences(final String projectName) {
try {
final Project p = Engine.theApp.databaseObjectsManager.getOriginalProjectByName(projectName);
if (p != null) {
for (final Sequence sequence : p.getSequencesList()) {
if (sequence.isAutoStart()) {
Engine.execute(() -> {
try {
Map<String, String[]> parameters = new HashMap<String, String[]>();
parameters.put(Parameter.Project.getName(), new String[] { projectName });
parameters.put(Parameter.Sequence.getName(), new String[] { sequence.getName() });
InternalHttpServletRequest request = new InternalHttpServletRequest();
InternalRequester requester = new InternalRequester(GenericUtils.<Map<String, Object>>cast(parameters), request);
requester.processRequest();
} catch (Exception e) {
Engine.logEngine.error("Failed to execute the auto start sequence \"" + sequence.getQName() + "\"", e);
}
});
}
}
}
} catch (Exception e) {
Engine.logEngine.error("Failed to execute auto start sequences for project \"" + projectName + "\"", e);
}
}
use of com.twinsoft.convertigo.engine.requesters.InternalHttpServletRequest in project convertigo by convertigo.
the class SequenceEditorPartWrap method runRequestable.
private void runRequestable(final String projectName, final Map<String, String[]> parameters) {
if (!Engine.isStartFailed && Engine.isStarted) {
parameters.put(Parameter.Project.getName(), new String[] { projectName });
new Thread(new Runnable() {
@Override
public void run() {
try {
InternalHttpServletRequest request;
if (session == null) {
request = new InternalHttpServletRequest();
session = request.getSession();
} else {
request = new InternalHttpServletRequest(session);
}
new InternalRequester(GenericUtils.<Map<String, Object>>cast(parameters), request).processRequest();
} catch (Exception e) {
// logException(e, "Failed to run the requestable of project " + projectName);
}
}
}).start();
} else {
// logInfo("Cannot run the requestable of project " + projectName + ", the embedded tomcat is not correctly started.");
}
}
use of com.twinsoft.convertigo.engine.requesters.InternalHttpServletRequest in project convertigo by convertigo.
the class ConnectorEditorPartWrap method runRequestable.
private void runRequestable(final String projectName, final Map<String, String[]> parameters) {
if (!Engine.isStartFailed && Engine.isStarted) {
parameters.put(Parameter.Project.getName(), new String[] { projectName });
new Thread(new Runnable() {
@Override
public void run() {
try {
InternalHttpServletRequest request;
if (session == null) {
request = new InternalHttpServletRequest();
session = request.getSession();
} else {
request = new InternalHttpServletRequest(session);
}
new InternalRequester(GenericUtils.<Map<String, Object>>cast(parameters), request).processRequest();
} catch (Exception e) {
// logException(e, "Failed to run the requestable of project " + projectName);
}
}
}).start();
} else {
// logInfo("Cannot run the requestable of project " + projectName + ", the embedded tomcat is not correctly started.");
}
}
use of com.twinsoft.convertigo.engine.requesters.InternalHttpServletRequest in project convertigo by convertigo.
the class AbstractFullSyncListener method onBulkDocs.
public void onBulkDocs(HttpServletRequest request, final JSONArray array) {
if (isEnabled()) {
final InternalHttpServletRequest internalRequest = new InternalHttpServletRequest(request);
Engine.execute(new Runnable() {
@Override
public void run() {
try {
triggerSequence(internalRequest, array);
} catch (Exception e) {
Engine.logBeans.error("Unable to handle 'bulkDocs' event for \"" + getName() + "\" listener", e);
}
}
});
}
}
use of com.twinsoft.convertigo.engine.requesters.InternalHttpServletRequest in project convertigo by convertigo.
the class ConvertigoPlugin method runRequestable.
public void runRequestable(final String projectName, final Map<String, String[]> parameters) {
if (!Engine.isStartFailed && Engine.isStarted) {
parameters.put(Parameter.Project.getName(), new String[] { projectName });
new Thread(new Runnable() {
@Override
public void run() {
try {
InternalHttpServletRequest request;
if (session == null || session.getMaxInactiveInterval() <= 1) {
request = new InternalHttpServletRequest();
session = request.getSession("studio");
} else {
request = new InternalHttpServletRequest(session);
}
InternalRequester requester = new InternalRequester(GenericUtils.<Map<String, Object>>cast(parameters), request);
HttpSessionListener.checkSession(requester.getHttpServletRequest());
requester.processRequest();
} catch (Exception e) {
logException(e, "Failed to run the requestable of project " + projectName);
}
}
}).start();
} else {
logInfo("Cannot run the requestable of project " + projectName + ", the embedded tomcat is not correctly started.");
}
}
Aggregations