Package org.auraframework.instance

Examples of org.auraframework.instance.InstanceStack$Entry


  }

  @Override
  protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    Entry e = entry(req);
    S3Object remove = map.remove(e);
    if (remove == null) {
      resp.sendError(404, "Not found " + e);
    } else {
      resp.sendError(HttpURLConnection.HTTP_NO_CONTENT, "Deleted");
View Full Code Here


    }

  }

  private Entry entry(HttpServletRequest req) {
    return new Entry(key(uri(req)));
  }
View Full Code Here

        log("doGet " + uri);
    if ("/".equals(uri.getPath())) {
      list(req, resp);
    } else {
      String key = uri.getPath().substring(1);
      Entry e = new Entry(key);
      S3Object obj = map.get(e);
        if (debug)
          log("map.get(" + key + ") = " + obj);
      if (obj == null) {
        resp.sendError(404, "Not here: " + e);
View Full Code Here

    if (maxKeysStr != null)
      maxKeys = Integer.parseInt(maxKeysStr);
    Writer w = new Writer();
    SortedMap<Entry, S3Object> submap = new TreeMap<Entry, S3Object>(map);
    if (prefix != null)
      submap = submap.tailMap(new Entry(prefix));
    int keyCount = 0;
    boolean truncated = false;
    String nextMarker = null;
    for (Entry e : submap.keySet()) {
      if (++keyCount > maxKeys) {
View Full Code Here

    log("doPut " + uri);
    if ("/".equals(uri.getPath())) {
      log("create bucket");
      bucket = true;
    } else {
      Entry e = new Entry(key(uri));
      e.setLastModified(new Date());
      e.setSize(req.getContentLength());
      e.setOwner(new Owner("id", "name"));
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      ServletInputStream is = req.getInputStream();
      byte b[] = new byte[128];
      while (true) {
        int len = is.read(b);
View Full Code Here

    private BaseComponentImpl(DefDescriptor<D> descriptor, BaseComponent<?, ?> attributeValueProvider,
            Map<String, Object> valueProviders, I extender, D def) throws QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        DefDescriptor<? extends RootDefinition> desc = null;

        InstanceStack instanceStack = context.getInstanceStack();
        Instance<?> parent = instanceStack.peek();

        this.descriptor = descriptor;
        this.originalDescriptor = descriptor;
        this.path = instanceStack.getPath();
        instanceStack.pushInstance(this, descriptor);

        if (def == null) {
            try {
                def = descriptor.getDef();
                if (extender == null && (def.isAbstract() || def.getLocalProviderDef() != null)) {
View Full Code Here

     *
     * @param modelDef the definition for the model.
     */
    public JavaModel(JavaModelDefImpl modelDef) {
        this.modelDef = modelDef;
        InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();
        iStack.pushInstance(this, modelDef.getDescriptor());
        iStack.setAttributeName("m");
        this.path = iStack.getPath();
        try {
            if (modelDef.isBean()) {
                this.bean = Aura.getBeanAdapter().getModelBean(modelDef);
            } else {
                this.bean = BeanAdapterImpl.buildValidatedClass(modelDef.getJavaType());
            }
        } catch (AuraRuntimeException are) {
            throw are;
        } catch(Exception e){
            throw makeException(e.getMessage(),e,this.modelDef);
        }
        iStack.clearAttributeName("m");
        iStack.popInstance(this);
    }
View Full Code Here

        } else {
            attribute = new AttributeImpl(attributeDef.getDescriptor());
        }

        Object value = attributeDefRef.getValue();
        InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();
        iStack.markParent(parent);
        iStack.setAttributeName(attributeDef.getDescriptor().toString());
        value = attributeDef.getTypeDef().initialize(value, valueProvider);
        iStack.clearAttributeName(attributeDef.getDescriptor().toString());
        iStack.clearParent(parent);
        attribute.setValue(value);

        set(attribute);
    }
View Full Code Here

        AttributeImpl att = new AttributeImpl(desc);
        if (value instanceof Expression) {
            att.setValue(value);
        } else {
            InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();

            iStack.markParent(parent);
            iStack.setAttributeName(desc.toString());
            att.setValue(rootDefDescriptor.getDef().getAttributeDef(att.getName()).getTypeDef().initialize(value, null));
            iStack.clearAttributeName(desc.toString());
            iStack.clearParent(parent);
        }
        set(att);
    }
View Full Code Here

    public ComponentConfig provide() throws QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        BaseComponent<?, ?> component = context.getCurrentComponent();
        ComponentConfig cc = new ComponentConfig();
        List<Component> components = Lists.newArrayList();
        InstanceStack iStack = context.getInstanceStack();
        Map<String, Object> m = Maps.newHashMapWithExpectedSize(1);
        m.put("body", components);
        cc.setAttributes(m);

        AttributeSet atts = component.getAttributes();
        Iterable<?> value = atts.getValue("items", Iterable.class);
        if (value != null) {
            List<?> items = Lists.newArrayList(value);
            if (!items.isEmpty()) {
                String var = atts.getValue("var", String.class);
                String indexVar = atts.getValue("indexVar", String.class);

                int realstart = 0;
                int realend = items.size();

                ComponentDefRefArrayImpl template = atts.getValue("body", ComponentDefRefArrayImpl.class);
                m.put("template",template);
                Integer start = getIntValue(atts.getValue("start"));
                Integer end = getIntValue(atts.getValue("end"));
                if (start == null && end == null) {
                    // int page = (Integer)atts.getValue("page");
                    // int pageSize = (Integer)atts.getValue("pageSize");
                } else {
                    if (start != null && start > realstart) {
                        realstart = start;
                    }

                    if (end != null && end < realend) {
                        realend = end;
                    }
                }

                // boolean reverse = (Boolean)atts.getValue("reverse");
                iStack.setAttributeName("body");
                for (int i = realstart; i < realend; i++) {
                    iStack.setAttributeIndex(i);
                    iStack.pushInstance(component, component.getDescriptor());
                    iStack.setAttributeName("body");
                    Map<String, Object> providers = Maps.newHashMap();
                    providers.put(var, items.get(i));
                    if (indexVar != null) {
                        providers.put(indexVar, i);
                    }
                    components.addAll(template.newInstance(atts.getValueProvider(), providers));
                    iStack.clearAttributeName("body");
                    iStack.popInstance(component);
                    iStack.clearAttributeIndex(i);
                }
                iStack.clearAttributeName("body");
            }
        }

        return cc;
    }
View Full Code Here

TOP

Related Classes of org.auraframework.instance.InstanceStack$Entry

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.