Examples of MethodContext


Examples of org.apache.openejb.MethodContext

            }
        }

        for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {
            final MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
            final MethodContext methodContext = beanContext.getMethodContext(entry.getKey());
            final String s = value.concurrencyAttribute.toUpperCase();
            methodContext.setLockType(LockType.valueOf(s));
        }

        // handle @AccessTimeout
        attributes = MethodInfoUtil.resolveAttributes(accessTimeoutInfos, beanContext);

        if (log.isDebugEnabled()) {
            for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {
                final Method method = entry.getKey();
                final MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
                log.debug("AccessTimeout: " + method + " -- " + MethodInfoUtil.toString(value.methods.get(0)) + " " +
                    " " + value.accessTimeout.time + " " + value.accessTimeout.unit);
            }
        }

        for (final Map.Entry<Method, MethodAttributeInfo> entry : attributes.entrySet()) {
            final MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
            final MethodContext methodContext = beanContext.getMethodContext(entry.getKey());
            final Duration accessTimeout = new Duration(value.accessTimeout.time, TimeUnit.valueOf(value.accessTimeout.unit));
            methodContext.setAccessTimeout(accessTimeout);
        }
    }
View Full Code Here

Examples of org.eclipse.php.internal.core.typeinference.context.MethodContext

      cache = ((IModelCacheContext) context).getCache();
    }
    // Handle $this variable reference
    if (variableReference.getName().equals("$this")) { //$NON-NLS-1$
      if (context instanceof MethodContext) {
        MethodContext methodContext = (MethodContext) context;
        final LambdaFunctionDeclaration[] lambdas = new LambdaFunctionDeclaration[1];
        ContextFinder contextFinder = new ContextFinder(
            methodContext.getSourceModule()) {
          @Override
          public boolean visit(Expression s) throws Exception {
            if (s instanceof LambdaFunctionDeclaration) {
              LambdaFunctionDeclaration lambda = (LambdaFunctionDeclaration) s;
              if (variableReference.sourceStart() > lambda
                  .sourceStart()
                  && variableReference.sourceEnd() < lambda
                      .sourceEnd()) {
                lambdas[0] = lambda;
              }
            }
            return super.visit(s);
          }
        };
        try {
          methodContext.getRootNode().traverse(contextFinder);
        } catch (Exception e) {
        }
        PHPVersion phpVersion = ProjectOptions
            .getPhpVersion(methodContext.getSourceModule()
                .getScriptProject().getProject());
        if (lambdas[0] != null
            && (lambdas[0].isStatic() || phpVersion
                .isLessThan(PHPVersion.PHP5_4))) {
          this.results.add(new SimpleType(SimpleType.TYPE_NULL));
        } else {
          IEvaluatedType instanceType = methodContext
              .getInstanceType();
          if (instanceType != null) {
            this.results.add(instanceType);
          } else {
            this.results.add(new SimpleType(SimpleType.TYPE_NULL));
View Full Code Here

Examples of org.jboss.arquillian.drone.impl.MethodContext

      Assert.assertTrue("Configurator is of mock type", registry.getConfiguratorFor(MockDroneInstance.class) instanceof MockDroneFactory);

      manager.fire(new BeforeClass(MethodEnrichedClass.class));

      MethodContext mc = manager.getContext(ClassContext.class).getObjectStore().get(MethodContext.class);
      Assert.assertNotNull("Method context object holder was created in the context", mc);

      Object instance = new MethodEnrichedClass();
      Method testMethod = MethodEnrichedClass.class.getMethod("testMethodEnrichment", MockDroneInstance.class);
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

                }
            } else if (location.endsWith(".xml")) {
                Map<String, Object> localContext = FastMap.newInstance();
                localContext.putAll(context);
                DispatchContext ctx = this.modelScreen.getDispatcher(context).getDispatchContext();
                MethodContext methodContext = new MethodContext(ctx, localContext, null);
                try {
                    SimpleMethod.runSimpleMethod(location, method, methodContext);
                    context.putAll(methodContext.getResults());
                } catch (MiniLangException e) {
                    throw new GeneralException("Error running simple method at location [" + location + "]", e);
                }
            } else {
                throw new GeneralException("For screen script actions the script type is not yet supported for location: [" + location + "]");
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

            // run simple method script to get a list of entities
            Document simpleDoc = UtilXml.readXmlDocument(xmlScript);
            Element simpleElem = simpleDoc.getDocumentElement();
            SimpleMethod meth = new SimpleMethod(simpleElem, null, null);
            MethodContext methodContext = new MethodContext(request, response, null);
            meth.exec(methodContext); //Need to check return string
            List<GenericValue> entityList = UtilGenerics.cast(request.getAttribute("entityList"));
            request.setAttribute("entityList", entityList);

        } catch (TemplateException ioe) {
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

                }
            } else if (location.endsWith(".xml")) {
                Map<String, Object> localContext = FastMap.newInstance();
                localContext.putAll(context);
                DispatchContext ctx = WidgetWorker.getDispatcher(context).getDispatchContext();
                MethodContext methodContext = new MethodContext(ctx, localContext, null);
                try {
                    SimpleMethod.runSimpleMethod(location, method, methodContext);
                    context.putAll(methodContext.getResults());
                } catch (MiniLangException e) {
                    throw new GeneralException("Error running simple method at location [" + location + "]", e);
                }
            } else {
                throw new GeneralException("For widget script actions the script type is not yet supported for location: [" + location + "]");
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

        @Override
        public void run() {
            int tryCount = 0;
            while (!stopNow) {
                MethodContext methodContext = new MethodContext(dispatcher.getDispatchContext(), UtilMisc.toMap("locale", Locale.getDefault()), null);
                try {
                    tryCount++;
                    String responseCode = SimpleMethod.runSimpleMethod("component://minilang/script/org/ofbiz/minilang/method/ifops/IfRegexpTests.xml", "testIfRegexp", methodContext);
                    if (!"success".equals(methodContext.getEnv("responseMessage"))) {
                        success = false;
                        Debug.logError("ResponseCode not success: [" + responseCode + "], tryCount: [" + tryCount + "], envMap: [" + methodContext.getEnvMap() + "]", module);
                        if (friend != null) friend.stopNow = true;
                        break;
                    }
                } catch (MiniLangException e) {
                    throw new RuntimeException(e);
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

                }
            } else if (location.endsWith(".xml")) {
                Map<String, Object> localContext = FastMap.newInstance();
                localContext.putAll(context);
                DispatchContext ctx = this.modelForm.dispatchContext;
                MethodContext methodContext = new MethodContext(ctx, localContext, null);
                try {
                    SimpleMethod.runSimpleMethod(location, method, methodContext);
                    context.putAll(methodContext.getResults());
                } catch (MiniLangException e) {
                    throw new IllegalArgumentException("Error running simple method at location [" + location + "]", e);
                }
            } else {
                throw new IllegalArgumentException("For screen script actions the script type is not yet support for location:" + location);
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

            // run simple method script to get a list of entities
            Document simpleDoc = UtilXml.readXmlDocument(xmlScript);
            Element simpleElem = simpleDoc.getDocumentElement();
            SimpleMethod meth = new SimpleMethod(simpleElem, null, null);
            MethodContext methodContext = new MethodContext(request, response, null);
            String retStr = meth.exec(methodContext); //Need to check return string
            List entityList = (List) request.getAttribute("entityList");
            request.setAttribute("entityList", entityList);

        } catch (TemplateException ioe) {
View Full Code Here

Examples of org.ofbiz.minilang.method.MethodContext

                String xmlResource = ScreenFactory.getResourceNameFromCombined(location);
                String methodName = ScreenFactory.getScreenNameFromCombined(location);
                Map<String, Object> localContext = FastMap.newInstance();
                localContext.putAll(context);
                DispatchContext ctx = this.modelScreen.getDispatcher(context).getDispatchContext();
                MethodContext methodContext = new MethodContext(ctx, localContext, null);
                try {
                    SimpleMethod.runSimpleMethod(xmlResource, methodName, methodContext);
                    context.putAll(methodContext.getResults());
                } catch (MiniLangException e) {
                    throw new GeneralException("Error running simple method at location [" + location + "]", e);
                }
            } else {
                throw new GeneralException("For screen script actions the script type is not yet supported for location: [" + location + "]");
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.