Commit 07af24ef396a991b214f56345f2f11c2121af0e4

Authored by Dancovich
1 parent a84535ab
Exists in master

Resolvido problema com levantamento e derrubada de escopos durante

chamada a método anotado com @ManagedOperation
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/Management.java
@@ -57,8 +57,6 @@ import br.gov.frameworkdemoiselle.annotation.ManagedProperty; @@ -57,8 +57,6 @@ import br.gov.frameworkdemoiselle.annotation.ManagedProperty;
57 import br.gov.frameworkdemoiselle.annotation.Name; 57 import br.gov.frameworkdemoiselle.annotation.Name;
58 import br.gov.frameworkdemoiselle.context.ConversationContext; 58 import br.gov.frameworkdemoiselle.context.ConversationContext;
59 import br.gov.frameworkdemoiselle.context.RequestContext; 59 import br.gov.frameworkdemoiselle.context.RequestContext;
60 -import br.gov.frameworkdemoiselle.context.SessionContext;  
61 -import br.gov.frameworkdemoiselle.context.ViewContext;  
62 import br.gov.frameworkdemoiselle.internal.implementation.ManagedType.MethodDetail; 60 import br.gov.frameworkdemoiselle.internal.implementation.ManagedType.MethodDetail;
63 import br.gov.frameworkdemoiselle.management.AttributeChangeMessage; 61 import br.gov.frameworkdemoiselle.management.AttributeChangeMessage;
64 import br.gov.frameworkdemoiselle.management.DefaultNotification; 62 import br.gov.frameworkdemoiselle.management.DefaultNotification;
@@ -307,10 +305,7 @@ public class Management implements Serializable { @@ -307,10 +305,7 @@ public class Management implements Serializable {
307 } 305 }
308 306
309 private void activateContexts(Class<?> managedType) { 307 private void activateContexts(Class<?> managedType) {
310 -  
311 RequestContext requestContext = Beans.getReference(RequestContext.class); 308 RequestContext requestContext = Beans.getReference(RequestContext.class);
312 - ViewContext viewContext = Beans.getReference(ViewContext.class);  
313 - SessionContext sessionContext = Beans.getReference(SessionContext.class);  
314 ConversationContext conversationContext = Beans.getReference(ConversationContext.class); 309 ConversationContext conversationContext = Beans.getReference(ConversationContext.class);
315 310
316 if (!requestContext.isActive()){ 311 if (!requestContext.isActive()){
@@ -320,20 +315,6 @@ public class Management implements Serializable { @@ -320,20 +315,6 @@ public class Management implements Serializable {
320 requestContext.activate(); 315 requestContext.activate();
321 } 316 }
322 317
323 - if (!viewContext.isActive()){  
324 - logger.debug(bundle.getString("management-debug-starting-custom-context",  
325 - viewContext.getClass().getCanonicalName(), managedType.getCanonicalName()));  
326 -  
327 - viewContext.activate();  
328 - }  
329 -  
330 - if (!sessionContext.isActive()){  
331 - logger.debug(bundle.getString("management-debug-starting-custom-context",  
332 - sessionContext.getClass().getCanonicalName(), managedType.getCanonicalName()));  
333 -  
334 - sessionContext.activate();  
335 - }  
336 -  
337 if (!conversationContext.isActive()){ 318 if (!conversationContext.isActive()){
338 logger.debug(bundle.getString("management-debug-starting-custom-context", 319 logger.debug(bundle.getString("management-debug-starting-custom-context",
339 conversationContext.getClass().getCanonicalName(), managedType.getCanonicalName())); 320 conversationContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
@@ -344,8 +325,6 @@ public class Management implements Serializable { @@ -344,8 +325,6 @@ public class Management implements Serializable {
344 325
345 private void deactivateContexts(Class<?> managedType) { 326 private void deactivateContexts(Class<?> managedType) {
346 RequestContext requestContext = Beans.getReference(RequestContext.class); 327 RequestContext requestContext = Beans.getReference(RequestContext.class);
347 - ViewContext viewContext = Beans.getReference(ViewContext.class);  
348 - SessionContext sessionContext = Beans.getReference(SessionContext.class);  
349 ConversationContext conversationContext = Beans.getReference(ConversationContext.class); 328 ConversationContext conversationContext = Beans.getReference(ConversationContext.class);
350 329
351 if (requestContext.isActive()){ 330 if (requestContext.isActive()){
@@ -355,25 +334,11 @@ public class Management implements Serializable { @@ -355,25 +334,11 @@ public class Management implements Serializable {
355 requestContext.deactivate(); 334 requestContext.deactivate();
356 } 335 }
357 336
358 - if (!viewContext.isActive()){ 337 + if (conversationContext.isActive()){
359 logger.debug(bundle.getString("management-debug-stoping-custom-context", 338 logger.debug(bundle.getString("management-debug-stoping-custom-context",
360 - viewContext.getClass().getCanonicalName(), managedType.getCanonicalName()));  
361 -  
362 - viewContext.deactivate();  
363 - }  
364 -  
365 - if (!sessionContext.isActive()){  
366 - logger.debug(bundle.getString("management-debug-stoping-custom-context",  
367 - sessionContext.getClass().getCanonicalName(), managedType.getCanonicalName()));  
368 -  
369 - sessionContext.deactivate();  
370 - }  
371 -  
372 - if (!conversationContext.isActive()){  
373 - logger.debug(bundle.getString("management-debug-starting-custom-context",  
374 conversationContext.getClass().getCanonicalName(), managedType.getCanonicalName())); 339 conversationContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
375 340
376 - conversationContext.activate(); 341 + conversationContext.deactivate();
377 } 342 }
378 } 343 }
379 344