Package org.apache.tuscany.core.context

Examples of org.apache.tuscany.core.context.Lifecycle


            return;
        }
        // shutdown destroyable instances in reverse instantiation order
        ListIterator<Context> iter = destroyQueue.listIterator(destroyQueue.size());
        while(iter.hasPrevious()){
            Lifecycle context = iter.previous();
            if (context.getLifecycleState() == RUNNING) {
                try {
                    if (context instanceof AtomicContext){
                        ((AtomicContext)context).destroy();
                    }
                } catch (TargetException e) {
                    // TODO send a monitoring event
                }
            }
        }
        if (contexts == null){
            return;
        }
        for(Lifecycle context: contexts.values()) {
            try {
                if (context.getLifecycleState() == RUNNING) {
                    context.stop();
                }
            } catch (CoreRuntimeException e){
                // TODO send monitoring event
            }
        }
View Full Code Here


        }
        // shutdown destroyable instances in reverse instantiation order
        ListIterator<Context> iter = destroyQueue.listIterator(destroyQueue.size());
        synchronized (destroyQueue) {
            while (iter.hasPrevious()) {
                Lifecycle context = iter.previous();
                if (context.getLifecycleState() == RUNNING) {
                    try {
                        if (context instanceof AtomicContext) {
                            ((AtomicContext) context).destroy();
                        }
                    } catch (TargetException e) {
                        // TODO send a monitoring event
                    }
                }
            }
        }
        // shutdown contexts
        Map<String, Context> currentContexts = contexts.remove(Thread.currentThread());
        if (currentContexts == null) {
            return;
        }
        for (Lifecycle context : currentContexts.values()) {
            if (context.getLifecycleState() == RUNNING) {
                context.stop();
            }
        }
    }
View Full Code Here

          }
          synchronized(destroyQueue){
              // shutdown destroyable instances in reverse instantiation order
              ListIterator<Context> iter = destroyQueue.listIterator(destroyQueue.size());
              while(iter.hasPrevious()){
                  Lifecycle context = iter.previous();
                  if (context.getLifecycleState() == RUNNING) {
                      try {
                          if (context instanceof AtomicContext){
                              ((AtomicContext)context).destroy();
                          }
                      } catch (TargetException e) {
                          // TODO send a monitoring event
                      }
                  }
              }
          }
          // shutdown contexts
          Map<String,Context> currentContexts = contexts.remove(Thread.currentThread());
          if (currentContexts == null){
             return;
          }
          for (Lifecycle context: currentContexts.values()){
              if (context.getLifecycleState() == RUNNING) {
                  context.stop();
              }
          }

      }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.context.Lifecycle

Copyright © 2018 www.massapicom. 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.