code formatting

This commit is contained in:
Peter Hormanns 2016-11-16 13:25:26 +01:00
parent f934cd3984
commit 77fc48aaa7
3 changed files with 9 additions and 17 deletions

View File

@ -4,19 +4,15 @@ import javax.persistence.EntityManager;
import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractEntity;
/** public interface EntityProcessorFactory
* Most processor factories need only these methods. {
* public <T extends AbstractEntity> Processor
* @author peter createCreateProcessor(EntityManager em, T entity) throws ProcessorException;
*/
public interface EntityProcessorFactory {
public <T extends AbstractEntity> Processor createCreateProcessor(EntityManager em,
T entity) throws ProcessorException;
public <T extends AbstractEntity> Processor createUpdateProcessor(EntityManager em, public <T extends AbstractEntity> Processor
T newEntity) throws ProcessorException; createUpdateProcessor(EntityManager em, T newEntity) throws ProcessorException;
public <T extends AbstractEntity> Processor createDeleteProcessor(EntityManager em, public <T extends AbstractEntity> Processor
T entity) throws ProcessorException; createDeleteProcessor(EntityManager em, T entity) throws ProcessorException;
} }

View File

@ -117,7 +117,6 @@ public class QueueStatusReceiverServlet extends HttpServlet
transaction = new Transaction("statusreceiver"); transaction = new Transaction("statusreceiver");
transaction.beginTransaction(); transaction.beginTransaction();
EntityManager em = transaction.getEntityManager(); EntityManager em = transaction.getEntityManager();
// merging detachedQT directly makes Hibernate run into an endless recursion (stack overflow)
em.clear(); em.clear();
QueueTask persistentQT = em.find(QueueTask.class, detachedQT.getId()); QueueTask persistentQT = em.find(QueueTask.class, detachedQT.getId());
persistentQT.assign(detachedQT); persistentQT.assign(detachedQT);

View File

@ -115,10 +115,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
} }
private Processor createNetworkInterfacesProc(final Hive hive) throws ProcessorException { private Processor createNetworkInterfacesProc(final Hive hive) throws ProcessorException {
// VelocityProcessor interfacesProc = new VelocityProcessor("/de/hsadmin/mods/pac/interfaces.vm", hive, "/etc/network/interfaces", true); return new VelocityProcessor("/de/hsadmin/mods/pac/pac-addr-ipv4.vm", hive, "/etc/network/pac-addr-ipv4", true);
final VelocityProcessor pacIPv4Proc = new VelocityProcessor("/de/hsadmin/mods/pac/pac-addr-ipv4.vm", hive, "/etc/network/pac-addr-ipv4", true);
return pacIPv4Proc;
// return new CompoundProcessor(interfacesProc, pacIPv4Proc);
} }
private Processor createIPTablesProc() { private Processor createIPTablesProc() {