Brought spring-webflow-sandbox code to formatting conventions

This commit is contained in:
Ben Hale
2007-08-15 12:50:45 +00:00
parent 5f6da23f47
commit c8a2791e60
4 changed files with 5 additions and 22 deletions

View File

@@ -10,7 +10,7 @@ import java.lang.reflect.Method;
* @author Maxim Petrashev
*/
public abstract class AbstractResourceHolder<E> implements ResourceHolder<E>, MethodReplacer {// todo replace on
// injector in config
// injector in config
@SuppressWarnings("unchecked")
public Object reimplement(Object aObj, Method aMethod, Object[] aArgs) throws Throwable {
Object retVal = null;

View File

@@ -60,9 +60,7 @@ public abstract class DefaultEntityManagerLifecycleController implements EntityM
protected void unbind(EntityManager aEntityManager) {
synchronized (_entityManagerFactory) {// todo is this need?
Assert.isTrue(TransactionSynchronizationManager.hasResource(_entityManagerFactory)); // todo remove this
// code. Resource
// must be already
// present.
// code. Resource must be already present.
TransactionSynchronizationManager.unbindResource(_entityManagerFactory);
}
}

View File

@@ -1,14 +1,6 @@
package org.springframework.webflow.jpa.hibernate;
import org.springframework.webflow.jpa.DefaultEntityManagerLifecycleController;
import org.hibernate.FlushMode;
import org.hibernate.SessionFactory;
import org.hibernate.classic.Session;
import org.hibernate.context.ManagedSessionContext;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
/**
* Hibernate specific implementation of EntityManagerLifecycleController interface. Set for each new entity manager
@@ -58,13 +50,13 @@ public class EntityManagerLifecycleController extends DefaultEntityManagerLifecy
}
protected void beginTransaction(EntityManager aEntityManager) {// todo is it method need? May be transaction aspect
// has to cover it?
// has to cover it?
// begin database transaction for taking available connection
aEntityManager.getTransaction().begin();
}
protected void disconnectSession(EntityManager aEntityManager) {// todo is it method need? May be transaction aspect
// has to cover it?
// has to cover it?
EntityTransaction transaction = aEntityManager.getTransaction();
transaction.commit();
// todo is it need ? aSession.disconnect();

View File

@@ -15,9 +15,6 @@
*/
package org.springframework.webflow.samples.sellitem;
import javax.servlet.http.HttpServletRequest;
import org.springframework.util.StringUtils;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.definition.StateDefinition;
import org.springframework.webflow.execution.EnterStateVetoException;
@@ -30,11 +27,7 @@ public class SellItemFlowExecutionListener extends FlowExecutionListenerAdapter
String role = nextState.getAttributes().getString("role");
if (StringUtils.hasText(role)) {
HttpServletRequest request = ((ServletExternalContext) context.getExternalContext()).getRequest();// todo
// remove
// dependency
// on
// servlet
// api
// remove dependency on servlet api
if (!request.isUserInRole(role)) {
throw new EnterStateVetoException(context.getActiveFlow().getId(), context.getCurrentState().getId(),
nextState.getId(), "State requires role '" + role