Skip to content

Commit

Permalink
Revert "package refactoring"
Browse files Browse the repository at this point in the history
This reverts commit 3752cc3.
  • Loading branch information
yanavasileva committed Jun 9, 2023
1 parent 2a7c05e commit e9a5455
Show file tree
Hide file tree
Showing 30 changed files with 949 additions and 952 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import java.beans.FeatureDescriptor;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.impl.ProcessEngineImpl;
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.camunda.bpm.engine.spring.impl.SpringExpressionManager;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import org.camunda.bpm.engine.ArtifactFactory;
import org.camunda.bpm.engine.impl.DefaultArtifactFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import java.util.Arrays;
import java.util.HashSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import java.net.URL;
import java.util.Map;
Expand All @@ -31,20 +31,20 @@
* @author Tom Baeyens
*/
public class SpringConfigurationHelper {

private static Logger log = Logger.getLogger(SpringConfigurationHelper.class.getName());

public static ProcessEngine buildProcessEngine(URL resource) {
log.fine("==== BUILDING SPRING APPLICATION CONTEXT AND PROCESS ENGINE =========================================");

ApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource));
Map<String, ProcessEngine> beansOfType = applicationContext.getBeansOfType(ProcessEngine.class);
if ( (beansOfType==null)
|| (beansOfType.isEmpty())
) {
throw new ProcessEngineException("no "+ProcessEngine.class.getName()+" defined in the application context "+resource.toString());
}

ProcessEngine processEngine = beansOfType.values().iterator().next();

log.fine("==== SPRING PROCESS ENGINE CREATED ==================================================================");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import java.util.Map;
import org.camunda.bpm.engine.impl.el.ExpressionManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.camunda.bpm.engine.spring;

import org.camunda.bpm.engine.spring.impl.SpringArtifactFactory;
import org.camunda.bpm.engine.spring.impl.SpringBeansResolverFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;


import org.camunda.bpm.engine.impl.cfg.TransactionContext;
Expand All @@ -34,8 +34,8 @@ public class SpringTransactionContext implements TransactionContext {

protected PlatformTransactionManager transactionManager;
protected CommandContext commandContext;
protected TransactionState lastTransactionState = null;

protected TransactionState lastTransactionState = null;
public SpringTransactionContext(PlatformTransactionManager transactionManager, CommandContext commandContext) {
this.transactionManager = transactionManager;
this.commandContext = commandContext;
Expand All @@ -60,7 +60,7 @@ public void afterCompletion(int status) {
}
});
}

public void commit() {
// Do nothing, transaction is managed by spring
}
Expand All @@ -73,34 +73,34 @@ public void rollback() {

public void addTransactionListener(final TransactionState transactionState, final TransactionListener transactionListener) {
if (transactionState.equals(TransactionState.COMMITTING)) {

TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void beforeCommit(boolean readOnly) {
transactionListener.execute(commandContext);
}
});

} else if (transactionState.equals(TransactionState.COMMITTED)) {

TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
transactionListener.execute(commandContext);
}
});

} else if (transactionState.equals(TransactionState.ROLLINGBACK)) {

TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void beforeCompletion() {
transactionListener.execute(commandContext);
}
});

} else if (transactionState.equals(TransactionState.ROLLED_BACK)) {

TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCompletion(int status) {
Expand All @@ -109,17 +109,17 @@ public void afterCompletion(int status) {
}
}
});

}

}

public boolean isTransactionActive() {
return TransactionSynchronizationManager.isActualTransactionActive() &&
!TransactionState.ROLLED_BACK.equals(lastTransactionState) &&
!TransactionState.ROLLINGBACK.equals(lastTransactionState);
}

protected abstract class TransactionSynchronizationAdapter implements TransactionSynchronization {

public void suspend() {
Expand All @@ -142,7 +142,7 @@ public void afterCommit() {

public void afterCompletion(int status) {
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import org.camunda.bpm.engine.impl.cfg.TransactionContext;
import org.camunda.bpm.engine.impl.cfg.TransactionContextFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.spring.impl;
package org.camunda.bpm.engine.spring;

import java.sql.SQLException;
import java.util.logging.Logger;

import org.camunda.bpm.engine.impl.ProcessEngineLogger;
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.camunda.bpm.engine.impl.db.sql.DbSqlSession;
import org.camunda.bpm.engine.impl.interceptor.Command;
import org.camunda.bpm.engine.impl.interceptor.CommandInterceptor;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.TransactionSystemException;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import org.camunda.bpm.engine.impl.interceptor.LogInterceptor;
import org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor;
import org.camunda.bpm.engine.repository.DeploymentBuilder;
import org.camunda.bpm.engine.spring.impl.SpringTransactionContextFactory;
import org.camunda.bpm.engine.spring.impl.SpringTransactionInterceptor;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ContextResource;
import org.springframework.core.io.Resource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.camunda.bpm.application.ProcessApplicationElResolver;
import org.camunda.bpm.application.impl.EjbProcessApplication;
import org.camunda.bpm.application.impl.ServletProcessApplication;
import org.camunda.bpm.engine.spring.impl.ApplicationContextElResolver;
import org.camunda.bpm.engine.spring.ApplicationContextElResolver;
import org.camunda.bpm.impl.juel.jakarta.el.ELResolver;
import org.springframework.util.ClassUtils;
import org.springframework.web.context.WebApplicationContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
*/
public class ActivitiContextUtils {

public static final String ANNOTATION_STATE_HANDLER_BEAN_FACTORY_POST_PROCESSOR_BEAN_NAME= StateHandlerAnnotationBeanFactoryPostProcessor.class.getName().toLowerCase();
/**
* the name of the default registry used to store all state handling components
*/
public final static String ACTIVITI_REGISTRY_BEAN_NAME = "activitiComponentRegistry" ;
public static final String ANNOTATION_STATE_HANDLER_BEAN_FACTORY_POST_PROCESSOR_BEAN_NAME= StateHandlerAnnotationBeanFactoryPostProcessor.class.getName().toLowerCase();
/**
* the name of the default registry used to store all state handling components
*/
public final static String ACTIVITI_REGISTRY_BEAN_NAME = "activitiComponentRegistry" ;


}
Loading

0 comments on commit e9a5455

Please sign in to comment.