Package com.atolsystems.atolutilities

Examples of com.atolsystems.atolutilities.ExternalRuntimeException


            System.out.println("Enter in \"limited\" mode: register only PcScTerminalManager with hard coded options\n");
            terminalManagers.add(new PcScTerminalManager());
            availableTerminals = terminalManagers.get(0).list();
            if (0 == availableTerminals.size()){
                String msg = "Could not find any terminal.";
                throw new ExternalRuntimeException(msg);
            }
        }

        if (parallelMode) {
            StringBuilder cardsDetected = new StringBuilder("Cards detected in following readers:\n");
            StringBuilder terminalsWithCard = new StringBuilder();
            do{
                StringBuilder allTerminals = new StringBuilder();
                for (GenericTerminal terminal : availableTerminals) {
                    allTerminals.append("\t- ");
                    allTerminals.append(terminal.getName());
                    allTerminals.append("\n");
                    if (terminal.isCardPresent()) {
                        selectedTerminals.add(terminal);
                        terminalsWithCard.append("\t- ");
                        terminalsWithCard.append(terminal.getName());
                        terminalsWithCard.append("\n");
                    }
                }
                if (0 == selectedTerminals.size()) {
                    String msg = "No card has been detected, please insert card(s) in following terminals:\n";
                    msg+=allTerminals.toString();
                    int choice = JOptionPane.showConfirmDialog(null, msg, "Waiting for card", JOptionPane.OK_CANCEL_OPTION);
                    if (JOptionPane.OK_OPTION == choice) {
                        //nothing to do
                    }
                    if (JOptionPane.CANCEL_OPTION == choice) {
                        throw new StopRequestFromUserException("Operation cancelled by user.");
                    }
                }
            }while(0 == selectedTerminals.size());
               
            if (PARALLEL_MODE_N_TERMINAL_NOT_FIXED > fixedParallelModeNTerminals) {
                if (selectedTerminals.size() != fixedParallelModeNTerminals) {
                    String msg = "Command line request " + fixedParallelModeNTerminals + " terminals with card but " + selectedTerminals.size() + " have been detected:";
                    msg += "\n" + terminalsWithCard;
                    throw new ExternalRuntimeException(msg);
                }
            } else if ((PARALLEL_MODE_SKIP_CONFIRMATION != fixedParallelModeNTerminals) &&
                    selectedTerminals.size()!=fixedParallelModeNTerminals) {//if number match, don't ask anything
                cardsDetected.append(terminalsWithCard);
                cardsDetected.append("\nContinue ?\n");
View Full Code Here


        File f = arg.getFile(path);
        if (false == f.exists()) {
            try {
                path = f.getCanonicalPath();
            } finally {
                throw new ExternalRuntimeException("Folder specified by \"" + ARG_SET_CONF_FOLDER + "\" argument does not exist:\n" + path);
            }
        }
        try {
            confFolderName = f.getCanonicalPath() + System.getProperty("file.separator");
        } catch (IOException ex) {
View Full Code Here

        }
    }

    private void checkSetConfFolder() {
        if (this.nimpHomeNotDefined && (null == this.confFolderName)) {
            throw new ExternalRuntimeException("Environment variable \"" + NIMP_SMART_CARD_HOME + "\" is not defined. This can be solved by using the \"" + ARG_SET_CONF_FOLDER + "\" command line argument or reinstallation");
        }
        System.out.println("confFolderName=" + confFolderName);
    }
View Full Code Here

            scriptPlayer.setnRun(nRun);
            scriptPlayer.play(terminal, cmds);
            if(null==error){
                if (scriptPlayer.isErrorOccured())
                    throw new ExternalRuntimeException("An error occured during execution of script:\n"+in.getCanonicalPath());
                else if (false==scriptPlayer.isCheckOperation())
                    throw new ExternalRuntimeException("Response checking has been disabled during execution of script:\n"+in.getCanonicalPath());
            }
        } catch (StopRequestFromUserException e) {
            throw e;
        } catch (Throwable e) {
            error=e;
View Full Code Here

   
    public Throwable getError() {
        if(null!=error) return error;
        if(null==error){
            if (terminal.isErrorOccured())
                error= new ExternalRuntimeException("An error occured during execution of an event script");
        }
        if(null==error)
            error=starScriptArgHandler.getError();
        if(null==error)
            error=taskArgHandler.getError();
View Full Code Here

TOP

Related Classes of com.atolsystems.atolutilities.ExternalRuntimeException

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.