Package eu.admire.gateway.common.errors

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


                ErrorHelper.getCompiletimeInstance(mErrors).getError().addAll(
                        errors.getCompiletime().getError());
            }
            if (errors.getRuntime() != null)
            {
                RuntimeErrorType runtime = ErrorHelper.getRuntimeInstance(mErrors);
                runtime.getError().addAll(errors.getRuntime().getError());
                runtime.getProcessingElement().addAll(
                        errors.getRuntime().getProcessingElement());
            }
            if (errors.getSystem() != null)
            {
                mErrors.setSystem(errors.getSystem());
View Full Code Here


  
    public static synchronized RuntimeErrorType getRuntimeInstance(Errors errors)
    {
        if (errors.getRuntime() == null)
        {
            RuntimeErrorType runtimeErrors = OBJECT_FACTORY.createRuntimeErrorType();
            errors.setRuntime(runtimeErrors);
        }
        return errors.getRuntime();
    }
View Full Code Here

    @Override
    public void executionError(Location location, Throwable error)
    {
        if (error instanceof RequestExecutionException)
        {
            RuntimeErrorType runtime = ErrorHelper.getRuntimeInstance(mErrors);
            RequestExecutionException exc = (RequestExecutionException)error;
            RequestStatus status = null;
            try
            {
                status = exc.getRequestResource().getRequestStatus();
            }
            catch (Exception e)
            {
                // an error occurred whilst getting the request status
                LOG.error("Error retrieving the request status", e);
                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);
                }
            }
        }
        else
        {
View Full Code Here

 
  @Test
  public void runtime(){

    Errors mErrors = new ObjectFactory().createErrors();
    RuntimeErrorType mRuntimeErrorType = new ObjectFactory().createRuntimeErrorType();
    ProcessingElementErrorType mProcessingElementErrorType = new ProcessingElementErrorType();

    String expectedType = "run-type";
    String expectedInstance = "run-instance";
   
    mProcessingElementErrorType.setType(expectedType);
    mProcessingElementErrorType.setInstance(expectedInstance);
   
    mRuntimeErrorType.getProcessingElement().add(mProcessingElementErrorType);   
    mErrors.setRuntime(mRuntimeErrorType);

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

TOP

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

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.