Search in sources :

Example 1 with PoolRequester

use of com.twinsoft.convertigo.engine.requesters.PoolRequester in project convertigo by convertigo.

the class ContextLauncher method run.

public void run() {
    try {
        Engine.logEngine.debug("Launching the auto-start transaction \"" + context.transactionName + "\" for the context " + context.contextID);
        context.remoteAddr = "127.0.0.1";
        context.remoteHost = "localhost";
        context.userAgent = "Convertigo ContextManager pools launcher";
        PoolRequester poolRequester = new PoolRequester();
        poolRequester.processRequest(context);
    } catch (Exception e) {
        Engine.logEngine.error("Unable to launch the context " + context.contextID, e);
    }
}
Also used : PoolRequester(com.twinsoft.convertigo.engine.requesters.PoolRequester)

Example 2 with PoolRequester

use of com.twinsoft.convertigo.engine.requesters.PoolRequester in project convertigo by convertigo.

the class ContextManager method createPoolContext.

private void createPoolContext(Pool pool, int contextNumber) {
    try {
        if (!isRunning)
            return;
        Connector connector = pool.getConnector();
        Project project = connector.getProject();
        String poolContextID = getPoolContextID(project.getName(), connector.getName(), pool.getName(), "" + contextNumber);
        Engine.logContextManager.info("Creating context");
        Context context = get(poolContextID, contextNumber + "", project.getName());
        context.project = project;
        context.projectName = project.getName();
        // context.sequence = null;
        // context.sequenceName = null;
        context.setConnector(connector);
        context.pool = pool;
        context.poolContextNumber = contextNumber;
        context.transactionName = pool.getStartTransaction();
        if ((context.transactionName != null) && !context.transactionName.equals("")) {
            context.requestedObject = connector.getTransactionByName(context.transactionName);
            // For compatibility with older javelin projects, set the transaction context property
            context.transaction = (Transaction) context.requestedObject;
            Engine.logContextManager.debug("Launching the auto-start transaction \"" + context.transactionName + "\" for the context " + context.contextID);
            context.remoteAddr = "127.0.0.1";
            context.remoteHost = "localhost";
            context.userAgent = "Convertigo ContextManager pools launcher";
            try {
                if (!isRunning)
                    return;
                PoolRequester poolRequester = new PoolRequester();
                poolRequester.processRequest(context);
            } catch (Exception e) {
                Engine.logContextManager.error("Unable to launch the context " + context.contextID, e);
            }
        }
    } catch (EngineException e) {
        Engine.logContextManager.error("An unexpected error has occured in the ContextManager vulture while creating the pool context.", e);
    }
}
Also used : Connector(com.twinsoft.convertigo.beans.core.Connector) JavelinConnector(com.twinsoft.convertigo.beans.connectors.JavelinConnector) Project(com.twinsoft.convertigo.beans.core.Project) PoolRequester(com.twinsoft.convertigo.engine.requesters.PoolRequester)

Aggregations

PoolRequester (com.twinsoft.convertigo.engine.requesters.PoolRequester)2 JavelinConnector (com.twinsoft.convertigo.beans.connectors.JavelinConnector)1 Connector (com.twinsoft.convertigo.beans.core.Connector)1 Project (com.twinsoft.convertigo.beans.core.Project)1