Example usage for org.springframework.transaction.support AbstractPlatformTransactionManager toString

List of usage examples for org.springframework.transaction.support AbstractPlatformTransactionManager toString

Introduction

In this page you can find the example usage for org.springframework.transaction.support AbstractPlatformTransactionManager toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.openeos.jbpm.integration.internal.KnowledgeManager.java

public StatefulKnowledgeSession createSession() {
    System.setProperty("jbpm.enable.multi.con", Boolean.toString(true));
    Properties props = new Properties();
    props.put("drools.processInstanceManagerFactory", JPAProcessInstanceManagerFactory.class.getName());
    props.put("drools.workItemManagerFactory", JPAWorkItemManagerFactory.class.getName());
    props.put("drools.processSignalManagerFactory", JPASignalManagerFactory.class.getName());

    KnowledgeSessionConfiguration ksconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(props);

    Environment env = KnowledgeBaseFactory.newEnvironment();
    env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, processPersistenceContextManager);

    AnnotationTransactionAspect txAspect = AnnotationTransactionAspect.aspectOf();
    AbstractPlatformTransactionManager txManager = (AbstractPlatformTransactionManager) txAspect
            .getTransactionManager();//from   w ww .  j  a  v a  2s .c  om
    LOG.debug("Transaction manager: " + txManager.toString());
    TransactionManager tm = new UnoTransactionManager(txManager,
            (UnoProcessPersistenceContext) processPersistenceContextManager.getProcessPersistenceContext());
    env.set(EnvironmentName.TRANSACTION_MANAGER, tm);

    Integer sessionId = knowledgeIdResolver.getKnowledgeSessionId();
    SingleSessionCommandService sscs;
    KnowledgeBase kBase = knowledgeBaseProvider.getKnowledgeBase();
    if (sessionId == null) {
        sscs = new SingleSessionCommandService(kBase, ksconf, env);
        knowledgeIdResolver.saveKnowledgeSessionId(sscs.getSessionId());
    } else {
        sscs = new SingleSessionCommandService(sessionId, kBase, ksconf, env);
    }
    return new CommandBasedStatefulKnowledgeSession(sscs);

}