rsanchez
2015-01-28 bab5b4b076841b05aec3e1bdd69f8a216c14aa4b
securis/src/main/java/net/curisit/securis/ioc/RequestsInterceptor.java
....@@ -55,6 +55,7 @@
5555 @Inject
5656 private EntityManagerProvider emProvider;
5757
58
+ @Override
5859 public void filter(ContainerRequestContext containerRequestContext) throws IOException {
5960 EntityManager em = emProvider.getEntityManager();
6061 ResteasyProviderFactory.pushContext(EntityManager.class, em);
....@@ -63,7 +64,7 @@
6364 .getProperty("org.jboss.resteasy.core.ResourceMethodInvoker");
6465 Method method = methodInvoker.getMethod();
6566
66
- LOG.info("Stored in context, em: {}, {}?", em, method.toGenericString());
67
+ LOG.debug("Stored in context, em: {}, {}", em, method.toGenericString());
6768
6869 boolean next = checkSecurableMethods(containerRequestContext, method);
6970 if (next) {
....@@ -75,7 +76,7 @@
7576 EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class);
7677
7778 if (method.isAnnotationPresent(EnsureTransaction.class)) {
78
- LOG.info("WE need transaction!!!");
79
+ LOG.debug("Beginning a new transaction");
7980 em.getTransaction().begin();
8081 }
8182 }
....@@ -158,17 +159,14 @@
158159 EntityManager em = ResteasyProviderFactory.getContextData(EntityManager.class);
159160
160161 if (em != null && em.getTransaction().isActive()) {
161
- LOG.info("There is transaction go ahead...");
162
+ LOG.debug("Transaction is active, ready to finish it");
162163 if (responseContext.getStatus() == Status.OK.getStatusCode()) {
163164 em.getTransaction().commit();
164
- LOG.info("COMMIT");
165
+ LOG.debug("COMMIT");
165166 } else {
166167 em.getTransaction().rollback();
167
- LOG.info("ROLLBACK");
168
+ LOG.debug("ROLLBACK");
168169 }
169
- } else {
170
- LOG.info("There is NO transaction");
171
-
172170 }
173171 }
174172