Package Framework

Examples of Framework.GenericException


     *    58, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 72, 73<br>
     * <p>
     * @return GenericException
     */
    public GenericException getException() {
        GenericException e = null;
        int severity = Constants.SP_ER_ERROR;
        int reasonCode = 0;
        String message = null;
        TextData key = null, status = null;
        DataValue p1 = null, p2 = null;

        if (this.getMsgSetID() == 0) {
            this.setMsgSetID(Error.SVC_MSGSET_ID);
        }

        if (this.getParam1() != null && this.getParam1() instanceof DataValue) {
            p1 = (DataValue)this.getParam1();
        }

        if (this.getParam2() != null && this.getParam2() instanceof DataValue) {
            p2 = (DataValue)this.getParam2();
        }

        if (this.getOriginator() != null && this.getOriginator() instanceof BusinessClass) {
            status = ((BusinessClass)this.getOriginator()).statusAsTextData();
            if (((BusinessClass)this.getOriginator()).getInstanceKey() != null) {
                key = ((BusinessClass)this.getOriginator()).getInstanceKey().asTextData();
            }
        }
        else if (this.getParam1() != null && this.getParam1() instanceof BusinessClass) {
            status = ((BusinessClass)this.getParam1()).statusAsTextData();
            if (((BusinessClass)this.getParam1()).getInstanceKey() != null) {
                key = ((BusinessClass)this.getParam1()).getInstanceKey().asTextData();
            }
        }

        reasonCode = Constants.SP_ER_INVALIDSTATE;
        if (this.getError() > 300) {
            reasonCode = 0;
        }
        else if ((this.getError()&1) > 0) {
            reasonCode = Constants.SP_ER_PARAMETERERROR;
        }

        message = this.getCatalogMessage(this.getError());

        if (message == null) {
            e = new UsageException();
            if (this.getParam2() != null) {
                message = this.getCatalog().getString(this.getMsgSetID(), 75, this.getMessage(75));
            }
            else if (this.getParam1() != null) {
                message = this.getCatalog().getString(this.getMsgSetID(), 76, this.getMessage(76));
            }
            else {
                message = this.getCatalog().getString(this.getMsgSetID(), 77, this.getMessage(77));
            }
        }

        if (this.getMsgSetID() == Error.SVC_MSGSET_ID) {
            switch (this.getError()) {

                case Error.GEN_UNIMPLEMENTED: {
                    e = new ImplementationException();
                    if (this.getParam1() != null) {
                        this.setParam2(this.getParam1());
                        message = this.getCatalog().getString(this.getMsgSetID(), 2, this.getMessage(2));
                    }
                    if (this.getMethodName() == null) {
                        p1 = new TextData(this.getCatalog().getString(this.getMsgSetID(), 3, this.getMessage(3)));
                    }
                    else {
                        p1 = new TextData(this.getMethodName());
                    }

                    break;
                }
                case Error.B_CANT_DELETE: {
                    p1 = key;
                    p2 = status;

                    break;
                }
                case Error.B_CANT_UPDATE: {
                    p1 = key;
                    p2 = status;

                    break;
                }
                case Error.B_ILLEGAL_ATTR: {
                    p1 = key;

                    break;
                }
                case Error.B_INCONSISTENT_STATE: {
                    e = new ImplementationException();
                    p1 = key;
                    p2 = status;
                    if (this.getOriginator() != null && this.getOriginator() instanceof BusinessClass) {
                        if (((BusinessClass)this.getOriginator()).getUpdateQuery() == null) {
                            message = this.getCatalog().getString(this.getMsgSetID(), 8, this.getMessage(8));
                        }
                        else {
                            message = this.getCatalog().getString(this.getMsgSetID(), 9, this.getMessage(9));
                        }
                    }

                    break;
                }
                case Error.BC_NOT_REVERTABLE: {
                    this.setParam1(this.getOriginator());

                    break;
                }
                case Error.BC_CANNOT_REVERT: {
                    this.setParam1(this.getOriginator());

                    break;
                }
                case Error.BC_CANNOT_SAVE: {
                    p1 = key;
                    p2 = status;

                    break;
                }
                case Error.BC_TOO_LATE_TO_SAVEFORREVERT: {
                    p1 = key;
                    p2 = status;

                    break;
                }
                case Error.BM_NO_UPDATE: {
                    if (this.getParam1() != null && this.getParam1() instanceof BusinessKey) {
                        p1 = ((BusinessKey)this.getParam1()).asTextData();
                    }
                    if (this.getParam2() == null) {
                        p2 = new TextData();
                    }

                    break;
                }
                case Error.BS_UNKNOWN_BM: {
                    p2 = new TextData(this.getOriginator().getClass().getSimpleName());

                    break;
                }
                case Error.CM_CLASS_CHANGED: {
                    e = new ExpressConcurrencyException(reasonCode);
                    if (this.getParam1() != null && this.getParam1() instanceof BusinessKey) {
                        p1 = ((BusinessKey)this.getParam1()).asTextData();
                    }
                    if (this.getParam2() == null) {
                        p2 = new TextData();
                    }

                    break;
                }
                case Error.CM_AGGREGATE_CHANGED: {
                    if (key != null) {
                        p1 = key;
                    }
                    else {
                        p1 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
                    }

                    break;
                }
                case Error.CM_NO_ORIGINAL: {
                    if (this.getParam1() != null && this.getParam1() instanceof BusinessQuery && ((BusinessQuery)this.getParam1()).getKey() != null) {
                        p1 = ((BusinessQuery)this.getParam1()).getKey().asTextData();
                    }
                    else {
                        p1 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
                    }

                    break;
                }
                case Error.CM_KEY_NOT_UNIQUE: {
                    if (this.getParam1() != null && this.getParam1() instanceof BusinessKey) {
                        p1 = ((BusinessKey)this.getParam1()).asTextData();
                    }
                    else {
                        p1 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
                    }

                    break;
                }
                case Error.CM_NEGATIVE_REF_COUNT: {
                    if (this.getParam2() != null && this.getParam2() instanceof BusinessKey) {
                        p2 = ((BusinessKey)this.getParam2()).asTextData();
                    }
                    else {
                        p2 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
                    }

                    break;
                }
                case Error.CM_DROPPING_LOCKED_KEY: {
                    if (this.getParam2() != null && this.getParam2() instanceof BusinessKey) {
                        p2 = ((BusinessKey)this.getParam2()).asTextData();
                    }
                    else {
                        p2 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
                    }

                    break;
                }
            }
        }

        if (e == null) {
            e = new UsageException(reasonCode, UsageException.qq_Resolver.cREASONCODE);
        }

        if (p1 == null && this.getParam1() != null) {
            if (this.getParam1() instanceof DataValue) {
                p1 = (DataValue)this.getParam1();
            }
            else {
                p1 = new TextData(this.getParam1().getClass().getSimpleName());
            }
        }

        if (p2 == null && this.getParam2() != null) {
            if (this.getParam2() instanceof DataValue) {
                p2 = (DataValue)this.getParam2();
            }
            else {
                p2 = new TextData(this.getParam2().getClass().getSimpleName());
            }
        }

        e.setWithParams(severity, new TextData(message), p1, p2);

        TextData detectingMethod = new TextData();
        if (this.getOriginator() != null) {
            detectingMethod.concat(this.getOriginator().getClass().getSimpleName());
            detectingMethod.concat(this.getCatalog().getString(this.getMsgSetID(), 78, this.getMessage(78)));
        }
        else {
            detectingMethod.concat(this.getCatalog().getString(this.getMsgSetID(), 79, this.getMessage(79)));
        }
        if (this.getMethodName() != null) {
            detectingMethod.concat(this.getMethodName());
        }
        else {
            detectingMethod.concat(this.getCatalog().getString(this.getMsgSetID(), 80, this.getMessage(80)));
        }
        e.setDetectingMethod(detectingMethod.toString());

        if (LogMgr.getInstance().test(Constants.SP_MT_CONFIGURATION, Constants.SP_ST_EX, Trace.CFG_ADDSTACKTRACE, 1) && !(LogMgr.getInstance().test(Constants.SP_MT_CONFIGURATION, 2, 1, 1))) {
            e.getMessageText().concat(FrameworkUtils.traceBack());
        }

        ErrorMgr.addError(e);

        return e;
View Full Code Here


        Exception exception = (Exception)error;
        ParameterHolder_NamedElement_Array parameterHolder = new ParameterHolder_NamedElement_Array();

        if (error instanceof GenericException) {

            GenericException ge = (GenericException)error;
            destination = this.getErrorTemplatege,
                                                    (HttpServletRequest)pageContext.getRequest(),
                                                    parameterHolder);
        }     
        parameters = (Array_Of_NamedElement<NamedElement>)parameterHolder.getObject();
View Full Code Here

            result = this.mgr.selectQueries(this.concurrency.getClientID(), queries, transactionMode);

        }
        catch (java.lang.RuntimeException qq_e) {
            if (!(qq_e instanceof GenericException)) Logger.getLogger("task.part.logmgr").debug("Translating exception into GenericException", qq_e);
            GenericException e = (qq_e instanceof GenericException) ? ((GenericException)qq_e) : new GenericException(qq_e);


            this.concurrency.abortOperation(transactionMode, e);
            throw e;
View Full Code Here

    {
        //  first see if one exists with the name

        if (this.WebEntFindResultSet(rset.getName()) != null) {
            Object[] qq_Args = { rset.getName() };
            GenericException e = new GenericException(MessageFormat.format( "A result set named {0} already exists.", qq_Args ) );
            e.setDetectingMethod("ExecContext::AddResultSet");
            throw e;
        }
        this.WebEntResultSets.add(rset);
    }
View Full Code Here

    public void add(TextData rsMember, DataValue value)
    {

        if (rsMember == null) {

            GenericException e = new GenericException("Member Name is NIL" );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }

        if (value == null) {
            Object[] qq_Args = { rsMember, this.name };
            GenericException e = new GenericException(MessageFormat.format( "Cannot add member name {0} to result set {1} - value specified is NIL.", qq_Args ) );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }

        if (this._findMember(rsMember) != null) {
            Object[] qq_Args = { rsMember, this.name };
            GenericException e = new GenericException(MessageFormat.format( "Cannot add member name {0} to result set {1} - a member already exists with that name.", qq_Args ) );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }

        if (HTTPAccess.getWebEntLogger().isDebugEnabled()) {
          HTTPAccess.getWebEntLogger().debug(new TextData().replaceParameters(" +%2.%1 [%3]", rsMember, this.name, value) );
View Full Code Here

     */
    public void add(TextData listName, int row, TextData attributeName, DataValue value)
    {

        if (listName == null) {
            GenericException e = new GenericException("List Name is NIL" );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }

        if (attributeName == null) {
            Object[] qq_Args = { listName };
            GenericException e = new GenericException(MessageFormat.format( "Cannot add to list {0} - attributeName specified is NIL.", qq_Args ) );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }

        if (value == null) {
            Object[] qq_Args = { listName };
            GenericException e = new GenericException(MessageFormat.format( "Cannot add to list {0} - value specified is NIL.", qq_Args ) );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }
        ResultSetMember listmem = this._findMember(listName);

        if (listmem == null) {
            listmem = new ResultSetMember(null, ResultSetMember.HS_LIST_MEMBER, listName.toString(), null);
            listmem.setListValue(new DynamicArray<ResultSet>(ResultSet.class ));

            this.WebEntMembers.add(listmem);

          if (HTTPAccess.getWebEntLogger().isDebugEnabled()) {
            HTTPAccess.getWebEntLogger().debug(new TextData().replaceParameters("resultset %2 +[%1]", this.name, listName) );
          }
        }

        if ((((boolean)(row < 1)) || ((boolean)(row > (listmem.getListValue().size()+1))))) {
            Object[] qq_Args = { listName, new IntegerData(row) };
            GenericException e = new GenericException(MessageFormat.format( "Cannot add to list {0} - row ({1}) is less than one or skips rows.", qq_Args ) );
            e.setDetectingMethod("ResultSet::Add");
            throw e;
        }

        if ((listmem.getListValue().size() < row) || (listmem.getListValue().get(row-1) == null)) {

View Full Code Here

        ResultSetMember foundRSMem = this._findMember(rsMember);


        if (foundRSMem == null) {
            Object[] qq_Args = { rsMember };
            GenericException e = new GenericException(MessageFormat.format( "Cannot find member name {0}.", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;

        }

        if ((boolean)(foundRSMem.getMemberType() != ResultSetMember.HS_SINGLETON_MEMBER)) {
            Object[] qq_Args = { rsMember };
            GenericException e = new GenericException(MessageFormat.format( "The rsMember={0} attribute represents a list member\n\\n    Use the appropriate overloaded FindMember method to retrieve it.", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;

        }
        return foundRSMem.getScalarValue();
    }
View Full Code Here


        if (foundListMem == null) {

            Object[] qq_Args = { listName };
            GenericException e = new GenericException(MessageFormat.format( "Cannot find list name {0}.", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;

        }

        if ((boolean)(foundListMem.getMemberType() != ResultSetMember.HS_LIST_MEMBER)) {
            Object[] qq_Args = { listName };
            GenericException e = new GenericException(MessageFormat.format( "The listName={0} attribute does not represent a list member\n\\n    Use the appropriate overloaded FindMember method to retrieve it.", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;

        }

        if ((foundListMem.getListValue().get(row-1)) == null) {
            Object[] qq_Args = { listName, new IntegerData(row) };
            GenericException e = new GenericException(MessageFormat.format( "The list {0} does not contain the requested row={1}\n\\n    Use the ListItems method to determine correct number of rows for this list.", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;


        }
        ResultSetMember rowRSMember = ((ResultSet)foundListMem.getListValue().get(row-1))._findMember(attributeName);


        if (rowRSMember == null) {
            Object[] qq_Args = { attributeName };
            GenericException e = new GenericException(MessageFormat.format( "Cannot find member name {0}.", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;

        }
        return rowRSMember.getScalarValue();
    }
View Full Code Here

//            throw e;
        }

        if ((boolean)(foundListMem.getMemberType() != ResultSetMember.HS_LIST_MEMBER)) {
            Object[] qq_Args = { listName };
            GenericException e = new GenericException(MessageFormat.format( "The listName={0} attribute does not represent a list member", qq_Args ) );
            e.setDetectingMethod("ResultSet::FindMember");
            throw e;

        }
        return foundListMem.getListValue().size();
    }
View Full Code Here

        try {
            aFile.getUsageTime(this.getAccessDate(), this.getModDate());
            this.setSize(new IntegerData(aFile.size()));
        }
        catch (RuntimeException qq_e) {
            GenericException e = GenericException.transformToGenericException(qq_e);

        }
        return this;
    }
View Full Code Here

TOP

Related Classes of Framework.GenericException

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.