Examples of Stack


Examples of java.util.Stack

        handlerPipeline.addHandler(handler1);
        handlerPipeline.addHandler(handler2);
        context.setInPipeline(handlerPipeline);
       
        handlerPipeline.invoke(context);
        Stack invoked = (Stack) context.getProperty(handlerPipeline.toString());
       
        assertTrue(handler1.isInvoked());
        assertTrue(invoked.contains(handler1));
        assertFalse(handler2.isInvoked());
        assertFalse(invoked.contains(handler2));
       
        context.getCurrentPipeline().resume(context);
       
        assertTrue(handler1.isInvoked());
        assertTrue(invoked.contains(handler1));
        assertTrue(handler2.isInvoked());
        assertTrue(invoked.contains(handler2));
    }
View Full Code Here

Examples of java.util.Stack

  public HTMLSheetInformationViewer(Frame parent, HTMLSheetInformation sid) {
    super(parent, sid.getTitle(), false);
   
    this.sid = sid;
   
    backward = new Stack();
    forward = new Stack();


    // Create html viewer
    viewer = new AntiAliasedTextPane();
    JScrollPane scrollPane = new JScrollPane(viewer);
View Full Code Here

Examples of java.util.Stack


    public HelpViewer(Frame parent, String title) {
        super(parent, title, false);

        backward = new Stack();
        forward = new Stack();


        // Create help page viewer
        viewer = new AntiAliasedTextPane();
        JScrollPane scrollPane = new JScrollPane(viewer);
View Full Code Here

Examples of java.util.Stack

   */
  protected Object wizardObject;
 
  public WizardManager(){
    currentPage=null;
    pageHistory = new Stack();
    settings = new HashMap();
    wizardObject = null;
  }
View Full Code Here

Examples of java.util.Stack

     *            true if inner frames created will be closable
     */
    public DesktopCardPanel(boolean scrollable, boolean closable) {
        super(new BorderLayout());

        backwardStack = new Stack();
        forwardStack = new Stack();
       
        _scrollable = scrollable;
        _closable = closable;

        createCardPopupMenu();
View Full Code Here

Examples of java.util.Stack

    void initializeStreams ()
    {
        mStdIn = new BufferedReader(new InputStreamReader(System.in));
        mIn = mStdIn;
        mInStack = new Stack();
    }
View Full Code Here

Examples of java.util.Stack

    }

    try { oBugs.store(oConn, oBug.getClass(), true); }
    catch (java.lang.InstantiationException ignore) { /* never thrown*/ }

    Stack oPending = new Stack();

    int iChilds = oChilds.load(oConn, aChild);

    if (DebugFile.trace) DebugFile.writeln(String.valueOf(iChilds) + " childs loaded for " + getString(DB.gu_project));

    for (int c=0; c<iChilds;c++) oPending.push(oChilds.get(0,c));

    while (!oPending.empty()) {
      aChild[0] = oPending.pop();

      iChilds = oChilds.load(oConn, aChild);

      if (DebugFile.trace) DebugFile.writeln(String.valueOf(iChilds) + " childs loaded for " + aChild[0]);

      oProj = new Project(oConn, (String) aChild[0]);
      oProj.replace(DB.gu_project, Gadgets.generateUUID());
      if (oSubProjMap.containsKey(oProj.get(DB.id_parent)))
        oProj.replace(DB.id_parent, oSubProjMap.get(oProj.get(DB.id_parent)));
      oProj.store(oConn);

      iDuties = oDuties.load (oConn, new Object[]{oProj.get(DB.gu_project)});

      if (DebugFile.trace) DebugFile.writeln(String.valueOf(iDuties) + " duties loaded for " + oProj.getString(DB.gu_project));

      for (int d=0; d<iDuties; d++) {
        oDuties.setElementAt(Gadgets.generateUUID(), 0, d);
        oDuties.setElementAt(oProj.get(DB.gu_project), 2, d);
      }

      try {
        oDuties.store(oConn, oDuty.getClass(), true);
      }
      catch (java.lang.InstantiationException ignore) { /* never thrown*/ }

      iBugs = oBugs.load (oConn, new Object[]{oProj.get(DB.gu_project)});

      if (DebugFile.trace) DebugFile.writeln(String.valueOf(iBugs) + " bugs loaded for " + oProj.getString(DB.gu_project));

      for (int b=0; b<iBugs; b++) {
        oBugs.setElementAt(Gadgets.generateUUID(), 0, b);
        oBugs.setElementAt(oProj.get(DB.gu_project), 3, b);
      }

      try {
        oBugs.store(oConn, oBug.getClass(), true);
      }
      catch (java.lang.InstantiationException ignore) { /* never thrown*/ }

      oSubProjMap.put (aChild[0], oProj.getString(DB.gu_project));

      for (int c=0; c<iChilds;c++)
        oPending.push(oChilds.get(0,c));
    } // wend

    // Re-expandir todos los hijos del padre absoluto del clon
    oProj = new Project((String) oSubProjMap.get(get(DB.gu_project)));
    String sTopParent = oProj.topParent(oConn);
View Full Code Here

Examples of java.util.Stack

     */
    public WinstoneRequest() throws IOException {
        this.attributes = new Hashtable();
        this.parameters = new Hashtable();
        this.locales = new ArrayList();
        this.attributesStack = new Stack();
        this.parametersStack = new Stack();
//        this.forwardedParameters = new Hashtable();
        this.requestedSessionIds = new Hashtable();
        this.currentSessionIds = new Hashtable();
        this.usedSessions = new HashSet();
        this.contentLength = -1;
View Full Code Here

Examples of java.util.Stack

    }
   
    public void startIncludeBuffer() {
        synchronized (this.buffer) {
            if (this.includeByteStreams == null) {
                this.includeByteStreams = new Stack();
            }
        }
        this.includeByteStreams.push(new ByteArrayOutputStream());
    }
View Full Code Here

Examples of java.util.Stack

            requests.put(_prefAssocSessEnc, null);

        // build a stack of Association Request objects
        // and keep only the allowed by the configured preferences
        // the most-desirable entry is always at the top of the stack
        Stack reqStack = new Stack();
        Iterator iter = requests.keySet().iterator();
        while(iter.hasNext())
        {
            AssociationSessionType type = (AssociationSessionType) iter.next();

            // create the appropriate Association Request
            AssociationRequest newReq = createAssociationRequest(type, opUrl);
            if (newReq != null) reqStack.push(newReq);
        }

        // perform the association attempts
        int attemptsLeft = maxAttempts;
        LinkedHashMap alreadyTried = new LinkedHashMap();
        while (attemptsLeft > 0 && ! reqStack.empty())
        {
            try
            {
                attemptsLeft--;
                AssociationRequest assocReq =
                        (AssociationRequest) reqStack.pop();

                if (DEBUG)
                    _log.debug("Trying association type: " + assocReq.getType());

                // was this association / session type attempted already?
                if (alreadyTried.keySet().contains(assocReq.getType()))
                {
                    if (DEBUG) _log.debug("Already tried.");
                    continue;
                }

                // mark the current request type as already tried
                alreadyTried.put(assocReq.getType(), null);

                ParameterList respParams = new ParameterList();
                int status = call(opEndpoint, assocReq, respParams);

                // process the response
                if (status == HttpStatus.SC_OK) // success response
                {
                    AssociationResponse assocResp;

                    assocResp = AssociationResponse
                            .createAssociationResponse(respParams);

                    // valid association response
                    Association assoc =
                            assocResp.getAssociation(assocReq.getDHSess());
                    handle = assoc.getHandle();

                    AssociationSessionType respType = assocResp.getType();
                    if ( respType.equals(assocReq.getType()) ||
                            // v1 OPs may return a success no-encryption resp
                            ( ! discovered.isVersion2() &&
                              respType.getHAlgorithm() == null &&
                              createAssociationRequest(respType,opUrl) != null))
                    {
                        // store the association and do no try alternatives
                        _associations.save(opEndpoint, assoc);
                        _log.info("Associated with " + discovered.getOPEndpoint()
                                + " handle: " + assoc.getHandle());
                        break;
                    }
                    else
                        _log.info("Discarding association response, " +
                                  "not matching consumer criteria");
                }
                else if (status == HttpStatus.SC_BAD_REQUEST) // error response
                {
                    _log.info("Association attempt failed.");

                    // retrieve fallback sess/assoc/encryption params set by OP
                    // and queue a new attempt
                    AssociationError assocErr =
                            AssociationError.createAssociationError(respParams);

                    AssociationSessionType opType =
                            AssociationSessionType.create(
                                    assocErr.getSessionType(),
                                    assocErr.getAssocType());

                    if (alreadyTried.keySet().contains(opType))
                        continue;

                    // create the appropriate Association Request
                    AssociationRequest newReq =
                            createAssociationRequest(opType, opUrl);

                    if (newReq != null)
                    {
                        if (DEBUG) _log.debug("Retrieved association type " +
                                              "from the association error: " +
                                              newReq.getType());

                        reqStack.push(newReq);
                    }
                }
            }
            catch (OpenIDException e)
            {
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.