Examples of Scope


Examples of org.apache.tuscany.sca.core.scope.Scope

        if (from != null) {
            parameters = from.getReferenceParameters();
        }
        // check what sort of context is required
        if (scopeContainer != null) {
            Scope scope = scopeContainer.getScope();
            if (scope == Scope.REQUEST) {
                contextId = Thread.currentThread();
            } else if (scope == Scope.CONVERSATION && parameters != null) {
                contextId = parameters.getConversationID();
            }
View Full Code Here

Examples of org.apache.tuscany.sca.scope.Scope

            return component.getScopeContainer();
        }
        ImplementationProvider implementationProvider = component.getImplementationProvider();
        if (implementationProvider instanceof ScopedImplementationProvider) {
            ScopedImplementationProvider provider = (ScopedImplementationProvider)implementationProvider;
            Scope scope = provider.getScope();
            if (scope == null) {
                scope = Scope.STATELESS;
            }
            ScopeContainerFactory factory = scopeCache.get(scope);
            ScopeContainer container = factory.createScopeContainer(component);
View Full Code Here

Examples of org.apache.tuscany.spi.model.Scope

       
        RubyScript rubyScript = implementation.getRubyScript();

        // TODO: have ComponentBuilderExtension pass ScopeContainer in on build method?
        ScopeContainer scopeContainer;
        Scope scope = componentType.getLifecycleScope();
        if (Scope.MODULE == scope) {
            scopeContainer = deploymentContext.getModuleScope();
        } else {
            scopeContainer = scopeRegistry.getScopeContainer(scope);
        }
View Full Code Here

Examples of org.apache.velocity.runtime.directive.Scope

            try
            {
                if (provideEvaluateScope)
                {
                    Object previous = ica.get(evaluateScopeName);
                    context.put(evaluateScopeName, new Scope(this, previous));
                }
                nodeTree.render(ica, writer);
            }
            catch (StopCommand stop)
            {
                if (!stop.isFor(this))
                {
                    throw stop;
                }
                else if (getLog().isDebugEnabled())
                {
                    getLog().debug(stop.getMessage());
                }
            }
            catch (IOException e)
            {
                throw new VelocityException("IO Error in writer: " + e.getMessage(), e);
            }
        }
        finally
        {
            ica.popCurrentTemplateName();
            if (provideEvaluateScope)
            {
                Object obj = ica.get(evaluateScopeName);
                if (obj instanceof Scope)
                {
                    Scope scope = (Scope)obj;
                    if (scope.getParent() != null)
                    {
                        ica.put(evaluateScopeName, scope.getParent());
                    }
                    else if (scope.getReplaced() != null)
                    {
                        ica.put(evaluateScopeName, scope.getReplaced());
                    }
                    else
                    {
                        ica.remove(evaluateScopeName);
                    }
View Full Code Here

Examples of org.apache.wink.common.annotations.Scope

            return null;
        }

        @SuppressWarnings("unchecked")
        final Class<T> cls = (Class<T>)object.getClass();
        Scope scope = cls.getAnnotation(Scope.class);

        if (scope != null) {
            if (scope.value() == ScopeType.SINGLETON) {
                return LifecycleManagerUtils.createSingletonObjectFactory(object);
            } else if (scope.value() == ScopeType.PROTOTYPE) {
                // It's a prototype
                return LifecycleManagerUtils.createPrototypeObjectFactory(cls);
            }
        }
        // has no Scope annotation, do nothing
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope

    VariableBinding binding,
    Reference finalAssignment) {

    // do not consider variables which are defined inside this loop
    if (binding instanceof LocalVariableBinding) {
      Scope scope = ((LocalVariableBinding) binding).declaringScope;
      while ((scope = scope.parent) != null) {
        if (scope == associatedScope)
          return false;
      }
    }
View Full Code Here

Examples of org.cfeclipse.cfmledit.dictionary.Scope

 
  @Test
  public void testGetScope() throws IOException, JDOMException {
    Grammar g = new Grammar("railo3.xml");
    //type="String" value="Server.ColdFusion.ProductName">
    Scope scope= g.getScope("Server.ColdFusion.ProductName");
    assertEquals(scope.getValue(), "Server.ColdFusion.ProductName");
    assertEquals(scope.getType(), "String");
    assertTrue(scope.getHelp().length()>0);
  }
View Full Code Here

Examples of org.chromium.debug.ui.DialogUtils.Scope

    updater = new Updater();
  }

  WizardLogic create(final List<? extends ScriptTargetMapping> targetList,
      final ErrorPositionHighlighter positionHighlighter) {
    Scope scope = updater.rootScope();

    final boolean skipSingleTargetSelection = true;

    // Wizard logic is described from the first page toward the last pages.

    final PageImpl<PushChangesWizard.ChooseVmPageElements> chooseVmPage =
        pageSet.getChooseVmPage();

    // A value corresponding to selected VMs on 'choose vm' page.
    final ValueSource<List<ScriptTargetMapping>> selectedVmInput =
        new ValueSource<List<ScriptTargetMapping>>() {
      private final ChooseVmControl.Logic chooseVmControl =
          chooseVmPage.getPageElements().getChooseVm();
      {
        chooseVmControl.setData(targetList);
        chooseVmControl.selectAll();
        final ValueSource<?> thisSource = this;
        ChooseVmControl.Logic.Listener listener = new ChooseVmControl.Logic.Listener() {
          public void checkStateChanged() {
            updater.reportChanged(thisSource);
            updater.update();
          }
        };
        chooseVmControl.addListener(listener);
      }
      public List<ScriptTargetMapping> getValue() {
        return chooseVmControl.getSelected();
      }
    };
    updater.addSource(scope, selectedVmInput);


    final ValueProcessor<? extends List<Optional<PushChangesPlan>>> selectedChangePlansValue =
        createProcessor(new Gettable<List<Optional<PushChangesPlan>>>() {
      @Override
      public List<Optional<PushChangesPlan>> getValue() {
        List<ScriptTargetMapping> input = selectedVmInput.getValue();
        List<Optional<PushChangesPlan>> result =
            new ArrayList<DialogUtils.Optional<PushChangesPlan>>(input.size());
        for (ScriptTargetMapping mapping : input) {
          Optional<PushChangesPlan> optionalPlan;
          try {
            PushChangesPlan plan = PushChangesPlan.create(mapping);
            optionalPlan = createOptional(plan);
          } catch (RuntimeException e) {
            // TODO: have more specific exception types to catch.
            optionalPlan = createErrorOptional(new Message(
                Messages.WizardLogicBuilder_FAILED_TO_GET,
                MessagePriority.BLOCKING_PROBLEM));
          }
          result.add(optionalPlan);
        }
        return result;
      }
    });
    updater.addSource(scope, selectedChangePlansValue);
    updater.addConsumer(scope, selectedChangePlansValue);
    updater.addDependency(selectedChangePlansValue, selectedVmInput);


    // A derived value of selected VMs list; the list is non-empty or the value is error.
    final ValueProcessor<? extends Optional<List<PushChangesPlan>>> nonEmptySelectedPlansValue =
        createProcessor(new Gettable<Optional<List<PushChangesPlan>>>() {
      public Optional<List<PushChangesPlan>> getValue() {
        List<Optional<PushChangesPlan>> planList = selectedChangePlansValue.getValue();
        if (planList.isEmpty()) {
          return createErrorOptional(
              new Message(Messages.WizardLogicBuilder_CHOOSE_VM, MessagePriority.BLOCKING_INFO));
        }
        List<Message> errorMessages = new LinkedList<Message>();
        List<PushChangesPlan> result = new ArrayList<PushChangesPlan>(planList.size());
        for (Optional<PushChangesPlan> optionalPlan : planList) {
          if (optionalPlan.isNormal()) {
            result.add(optionalPlan.getNormal());
          } else {
            errorMessages.addAll(optionalPlan.errorMessages());
          }
        }
        if (errorMessages.isEmpty()) {
          return createOptional(result);
        } else {
          return createErrorOptional(new HashSet<Message>(errorMessages));
        }
      }
    });
    updater.addSource(scope, nonEmptySelectedPlansValue);
    updater.addConsumer(scope, nonEmptySelectedPlansValue);
    updater.addDependency(nonEmptySelectedPlansValue, selectedChangePlansValue);


    // A condition value for up-coming fork between 'single vm' and 'multiple vm' paths.
    Gettable<? extends Optional<? extends Boolean>> singleVmSelectedExpression = handleErrors(
        new NormalExpression<Boolean>() {
          @Calculate
          public Boolean calculate(List<PushChangesPlan> selectedVm) {
            return selectedVm.size() == 1;
          }
          @DependencyGetter
          public ValueSource<? extends Optional<List<PushChangesPlan>>> getSelectVmSource() {
            return nonEmptySelectedPlansValue;
          }
        });

    // A switch between 2 paths: 'single vm' and 'multiple vm'.
    OptionalSwitcher<Boolean> singleVmSelectedSwitch =
        scope.addOptionalSwitch(singleVmSelectedExpression);

    final PreviewAndOptionPath singleVmPath =
        createSingleVmPath(chooseVmPage, singleVmSelectedSwitch, nonEmptySelectedPlansValue);
    final PreviewAndOptionPath multipleVmPath =
        createMultipleVmPath(chooseVmPage, singleVmSelectedSwitch, nonEmptySelectedPlansValue);
View Full Code Here

Examples of org.cx4a.rsense.ruby.Scope

    public static Vertex localAssign(Graph graph, LocalAsgnNode node) {
        return localAssign(graph, node, null);
    }

    public static Vertex localAssign(Graph graph, LocalAsgnNode node, Vertex src) {
        Scope scope = graph.getRuntime().getContext().getCurrentScope();
        VertexHolder holder = (VertexHolder) scope.getValue(node.getName());
        if (src == null) {
            src = graph.createVertex(node.getValueNode());
        }
        if (holder == null) {
            holder = graph.createFreeVertexHolder();
            scope.setValue(node.getName(), holder);
        }
        graph.addEdgeAndPropagate(src, holder.getVertex());
        return src;
    }
View Full Code Here

Examples of org.eclipse.bpel.model.Scope

    }
    return activityElement;
  }

  protected Element scope2XML(Activity activity) {
    Scope scope = (Scope)activity;
    Element activityElement = createBPELElement("scope");
   
    if (scope.isSetIsolated())
      activityElement.setAttribute("isolated", BPELUtils.boolean2XML(scope.getIsolated()));
    if (scope.isSetExitOnStandardFault())
      activityElement.setAttribute("exitOnStandardFault", BPELUtils.boolean2XML(scope.getExitOnStandardFault()));
    if (scope.getVariables() != null && !scope.getVariables().getChildren().isEmpty())
      activityElement.appendChild(variables2XML(scope.getVariables()));
    if (scope.getCorrelationSets() != null && !scope.getCorrelationSets().getChildren().isEmpty())
      activityElement.appendChild(correlationSets2XML(scope.getCorrelationSets()));
    if (scope.getPartnerLinks() != null && !scope.getPartnerLinks().getChildren().isEmpty())
      activityElement.appendChild(partnerLinks2XML(scope.getPartnerLinks()));
    if (scope.getFaultHandlers() != null )
      activityElement.appendChild(faultHandlers2XML(scope.getFaultHandlers()));
    if (scope.getCompensationHandler() != null )
      activityElement.appendChild(compensationHandler2XML(scope.getCompensationHandler()));
    if (scope.getTerminationHandler() != null )
      activityElement.appendChild(terminationHandler2XML(scope.getTerminationHandler()));
    if (scope.getEventHandlers() != null)
      activityElement.appendChild(eventHandler2XML(scope.getEventHandlers()));
    if (scope.getMessageExchanges() != null)
      activityElement.appendChild(messageExchanges2XML(scope.getMessageExchanges()));
    if (scope.getActivity() != null )
      activityElement.appendChild(activity2XML(scope.getActivity()));
    return activityElement;
  }
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.