Package br.gov.frameworkdemoiselle.context

Examples of br.gov.frameworkdemoiselle.context.ViewContext.deactivate()


      if (sessionActivatedHere){
        tempSessionContext.deactivate();
      }
     
      if (viewActivatedHere){
        tempViewContext.deactivate();
      }
     
      if (conversationActivatedHere){
        tempConversationContext.deactivate();
      }
View Full Code Here


   
    if (!viewContext.isActive()){
      logger.debug(bundle.getString("management-debug-stoping-custom-context",
          viewContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
     
      viewContext.deactivate();
    }

    if (!sessionContext.isActive()){
      logger.debug(bundle.getString("management-debug-stoping-custom-context",
          sessionContext.getClass().getCanonicalName(), managedType.getCanonicalName()));
View Full Code Here

        }
        else{
          //Precisamos desativar temporariamente o contexto
          if (viewContext.isActive()){
            backupContext = viewContext;
            viewContext.deactivate();
           
            CustomContextBootstrap customContextBootstrap = Beans.getReference(CustomContextBootstrap.class);
            for (CustomContext customContext : customContextBootstrap.getCustomContexts()){
              if ( TemporaryViewContextImpl.class.isInstance(customContext) ){
                startedContextHere.put("view", customContext.activate());
View Full Code Here

     
      //Contexto temporário de visão precisa de tratamento especial
      //para evitar conflito com o contexto presente na extensão demoiselle-jsf
      if (viewContext!=null){
        if (TemporaryViewContextImpl.class.isInstance(viewContext) && startedContextHere.get("view")){
          viewContext.deactivate();
         
          if (backupContext!=null){
            backupContext.activate();
            backupContext = null;
          }
View Full Code Here

    ViewContext viewContext = Beans.getReference(ViewContext.class);
    ConversationContext conversationContext = Beans.getReference(ConversationContext.class);
   
    requestContext.deactivate();
    sessionContext.deactivate();
    viewContext.deactivate();
    conversationContext.activate();
  }
}
View Full Code Here

    m1.persist(entity);

    assertTrue(m2.contains(entity));
   
    ctx.deactivate();
  }
 
  @Test(expected=ContextNotActiveException.class)
  public void errorWhenContextNotActive() {
    ViewContext ctx = Beans.getReference(ViewContext.class);
View Full Code Here

 
  @Test(expected=ContextNotActiveException.class)
  public void errorWhenContextNotActive() {
    ViewContext ctx = Beans.getReference(ViewContext.class);
    if (ctx.isActive()){
      ctx.deactivate();
    }
   
    EntityManager m1 = Beans.getReference(EntityManager.class, new NameQualifier("pu"));

    assertNotNull(m1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.