Package eu.admire.gateway.common.errors

Examples of eu.admire.gateway.common.errors.ErrorType


    }

    @Override
    public void error(int line, int charPositionInLine, String message)
    {
        ErrorType errorType = mObjectFactory.createErrorType();
        String errorMsg = getErrorMessage(line, charPositionInLine, message);
        errorType.setMessage(errorMsg);
        ErrorHelper.getCompiletimeInstance(mErrors).getError().add(errorType);
        LOG.debug(errorMsg);
    }
View Full Code Here


            final int line,
            final int charPositionInLine,
            final Throwable cause)
    {
        cause.printStackTrace();
        ErrorType errorType = mObjectFactory.createErrorType();
        String errorMsg = getErrorMessage(line, charPositionInLine, cause);
        errorType.setMessage(errorMsg);
        LOG.debug(errorMsg);
        Throwable error = cause.getCause();
        while (error != null)
        {
            ErrorType causeType = mObjectFactory.createErrorType();
            causeType.setMessage(getErrorMessage(line, charPositionInLine, error));
            errorType.setCause(causeType);
            errorType = causeType;
            error = error.getCause();
        }
        ErrorHelper.getCompiletimeInstance(mErrors).getError().add(errorType);
View Full Code Here

    }
   
   
    public static ErrorType createError(Throwable error)
    {
        ErrorType root = OBJECT_FACTORY.createErrorType();
        ErrorType errorType = root;
        errorType.setMessage(error.toString());
        Throwable cause = error.getCause();
        while (cause != null)
        {
            ErrorType causeType = OBJECT_FACTORY.createErrorType();
            causeType.setMessage(cause.toString());
            errorType.setCause(causeType);
            errorType = causeType;
            cause = cause.getCause();
        }
        return root;
View Full Code Here

                return;
            }
            // add general errors
            if (status.getError() != null)
            {
                ErrorType errorType = ErrorHelper.createError(status.getError());
                runtime.getError().add(errorType);
            }
            Iterator<?> iterator = status.getActivities();
            while (iterator.hasNext())
            {
                Entry<ActivityInstanceName, ActivityProcessingStatus> entry =
                    (Entry<ActivityInstanceName, ActivityProcessingStatus>) iterator.next();
                if (entry.getValue().getStatus() == ActivityStatus.ERROR)
                {
                    ProcessingElementErrorType pe =
                        mObjectFactory.createProcessingElementErrorType();
                    // TODO activity name needs to be mapped to processing element
                    Activity activity = mActivities.get(entry.getKey());
                    if (activity != null)
                    {
                        pe.setType(activity.getActivityName().toString());
                    }
                    else
                    {
                        // if the activity instance can't be mapped then it was
                        // inserted automatically by OGSA-DAI
                        // only Tee is inserted automatically at the moment
                        pe.setType(UNKNOWN);
                    }
                    Throwable exception = entry.getValue().getError();
                    ErrorType errorType = ErrorHelper.createError(exception);
                    pe.getError().add(errorType);
                    runtime.getProcessingElement().add(pe);
                }
            }
        }
View Full Code Here

  @Test
  public void compile(){

    Errors mErrors = new ObjectFactory().createErrors();
    CompiletimeErrorType mCompiletimeErrorType = new ObjectFactory().createCompiletimeErrorType();
    ErrorType mErrorType = new ErrorType();

    String expected = "compile";
   
    mErrorType.setMessage(expected);
    mCompiletimeErrorType.getError().add(mErrorType);   
    mErrors.setCompiletime(mCompiletimeErrorType);

    String errorString = marshallErrors(mErrors);
    System.out.println(errorString);   
View Full Code Here

TOP

Related Classes of eu.admire.gateway.common.errors.ErrorType

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.