Package org.ggf.schemas.bes.x2006.x08.besFactory.ActivityStateEnumeration

Examples of org.ggf.schemas.bes.x2006.x08.besFactory.ActivityStateEnumeration.Enum


     
      stats.addNewGetActivityStatuses().setActivityIdentifierArray(new EndpointReferenceType[] {activityEpr});
     
    GetActivityStatusesResponseDocument resDoc = fc.getActivityStatuses(stats);
   
    ActivityStatusType activityStatus = resDoc
        .getGetActivityStatusesResponse()
        .getResponseArray()[0].getActivityStatus();
    return activityStatus;
  }
View Full Code Here


       
        //TODO publish the status messages to the message bus
        while ((factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FINISHED) &&
                (factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FAILED)){
         
            ActivityStatusType activityStatus = null;
        try {
          activityStatus = getStatus(factory, activityEpr);
          GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobId, getApplicationJobStatus(activityStatus));
          log.info (subStatusAsString(activityStatus));
        } catch (UnknownActivityIdentifierFault e) {
          throw new GFacProviderException(e.getMessage(), e.getCause());
        }
 
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
            }
            continue;
        }
       
        ActivityStatusType activityStatus = null;
    try {
      activityStatus = getStatus(factory, activityEpr);
    } catch (UnknownActivityIdentifierFault e) {
      throw new GFacProviderException(e.getMessage(), e.getCause());
    }
       
        log.info(formatStatusMessage(activityEpr.getAddress().getStringValue(), activityStatus.getState().toString()));
       
    if ((activityStatus.getState() == ActivityStateEnumeration.FAILED)) {
        log.info(activityStatus.getFault().getFaultcode().getLocalPart()
            + "\n" + activityStatus.getFault().getFaultstring());
        log.info("EXITCODE: "+activityStatus.getExitCode());
    }
  }
View Full Code Here

     
      stats.addNewGetActivityStatuses().setActivityIdentifierArray(new EndpointReferenceType[] {activityEpr});
     
    GetActivityStatusesResponseDocument resDoc = fc.getActivityStatuses(stats);
   
    ActivityStatusType activityStatus = resDoc
        .getGetActivityStatusesResponse()
        .getResponseArray()[0].getActivityStatus();
    return activityStatus;
  }
View Full Code Here

       
        //TODO publish the status messages to the message bus
        while ((factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FINISHED) &&
                (factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FAILED)){
         
            ActivityStatusType activityStatus = null;
        try {
          activityStatus = getStatus(factory, activityEpr);
          GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobId, getApplicationJobStatus(activityStatus));
          log.info (subStatusAsString(activityStatus));
        } catch (UnknownActivityIdentifierFault e) {
          throw new GFacProviderException(e.getMessage(), e.getCause());
        }
 
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
            }
            continue;
        }
       
        ActivityStatusType activityStatus = null;
    try {
      activityStatus = getStatus(factory, activityEpr);
    } catch (UnknownActivityIdentifierFault e) {
      throw new GFacProviderException(e.getMessage(), e.getCause());
    }
       
        log.info(formatStatusMessage(activityEpr.getAddress().getStringValue(), activityStatus.getState().toString()));
       
    if ((activityStatus.getState() == ActivityStateEnumeration.FAILED)) {
        log.info(activityStatus.getFault().getFaultcode().getLocalPart()
            + "\n" + activityStatus.getFault().getFaultstring());
        log.info("EXITCODE: "+activityStatus.getExitCode());
    }
  }
View Full Code Here

     
      stats.addNewGetActivityStatuses().setActivityIdentifierArray(new EndpointReferenceType[] {activityEpr});
     
    GetActivityStatusesResponseDocument resDoc = fc.getActivityStatuses(stats);
   
    ActivityStatusType activityStatus = resDoc
        .getGetActivityStatusesResponse()
        .getResponseArray()[0].getActivityStatus();
    return activityStatus;
  }
View Full Code Here

            // TODO publish the status messages to the message bus
            while ((factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FINISHED)
                    && (factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FAILED)
                    && (factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.CANCELLED)) {

                ActivityStatusType activityStatus = null;
                try {
                    activityStatus = getStatus(factory, activityEpr);
                    JobState jobStatus = getApplicationJobStatus(activityStatus);
                    String jobStatusMessage = "Status of job " + jobId + "is " + jobStatus;
                    jobExecutionContext.getNotifier().publish(new StatusChangeEvent(jobStatusMessage));
                    details.setJobID(jobId);
                    GFacUtils.updateJobStatus(jobExecutionContext, details, jobStatus);
                } catch (UnknownActivityIdentifierFault e) {
                    throw new GFacProviderException(e.getMessage(), e.getCause());
                }catch (GFacException e) {
                    throw new GFacProviderException(e.getMessage(), e.getCause());
                }

                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                }
                continue;
            }

            ActivityStatusType activityStatus = null;
            try {
                activityStatus = getStatus(factory, activityEpr);
            } catch (UnknownActivityIdentifierFault e) {
                throw new GFacProviderException(e.getMessage(), e.getCause());
            }

            log.info(formatStatusMessage(activityEpr.getAddress().getStringValue(), activityStatus.getState()
                    .toString()));

            if ((activityStatus.getState() == ActivityStateEnumeration.FAILED)) {
                String error = activityStatus.getFault().getFaultcode().getLocalPart() + "\n"
                        + activityStatus.getFault().getFaultstring() + "\n EXITCODE: " + activityStatus.getExitCode();
                log.info(error);
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                }
                dt.downloadStdOuts();
            } else if (activityStatus.getState() == ActivityStateEnumeration.CANCELLED) {
                String experimentID = (String) jobExecutionContext.getProperty(Constants.PROP_TOPIC);
                JobState jobStatus = JobState.CANCELED;
                String jobStatusMessage = "Status of job " + jobId + "is " + jobStatus;
                jobExecutionContext.getNotifier().publish(new StatusChangeEvent(jobStatusMessage));
                details.setJobID(jobId);
                try {
          GFacUtils.saveJobStatus(jobExecutionContext,details, jobStatus);
        } catch (GFacException e) {
           throw new GFacProviderException(e.getLocalizedMessage(),e);
        }
                throw new GFacProviderException(experimentID + "Job Canceled");
            }

            else if (activityStatus.getState() == ActivityStateEnumeration.FINISHED) {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                }
                if (activityStatus.getExitCode() == 0) {
                    dt.downloadRemoteFiles();
                } else {
                    dt.downloadStdOuts();
                }
            }
View Full Code Here

        stats.addNewGetActivityStatuses().setActivityIdentifierArray(new EndpointReferenceType[] { activityEpr });

        GetActivityStatusesResponseDocument resDoc = fc.getActivityStatuses(stats);

        ActivityStatusType activityStatus = resDoc.getGetActivityStatusesResponse().getResponseArray()[0]
                .getActivityStatus();
        return activityStatus;
    }
View Full Code Here

            // TODO publish the status messages to the message bus
            while ((factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FINISHED)
                    && (factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FAILED)
                    && (factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.CANCELLED)) {

                ActivityStatusType activityStatus = null;
                try {
                    activityStatus = getStatus(factory, activityEpr);
                    ApplicationJobStatus applicationJobStatus = getApplicationJobStatus(activityStatus);
                    String jobStatusMessage = "Status of job " + jobId + "is " + applicationJobStatus;
                    jobExecutionContext.getNotifier().publish(new StatusChangeEvent(jobStatusMessage));
                    GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobId, applicationJobStatus);
                } catch (UnknownActivityIdentifierFault e) {
                    throw new GFacProviderException(e.getMessage(), e.getCause());
                }

                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                }
                continue;
            }

            ActivityStatusType activityStatus = null;
            try {
                activityStatus = getStatus(factory, activityEpr);
            } catch (UnknownActivityIdentifierFault e) {
                throw new GFacProviderException(e.getMessage(), e.getCause());
            }

            log.info(formatStatusMessage(activityEpr.getAddress().getStringValue(), activityStatus.getState()
                    .toString()));

            if ((activityStatus.getState() == ActivityStateEnumeration.FAILED)) {
                String error = activityStatus.getFault().getFaultcode().getLocalPart() + "\n"
                        + activityStatus.getFault().getFaultstring() + "\n EXITCODE: " + activityStatus.getExitCode();
                log.info(error);
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                }
                dt.downloadStdOuts();
            } else if (activityStatus.getState() == ActivityStateEnumeration.CANCELLED) {
                String experimentID = (String) jobExecutionContext.getProperty(Constants.PROP_TOPIC);
                ApplicationJobStatus applicationJobStatus = ApplicationJobStatus.CANCELED;
                String jobStatusMessage = "Status of job " + jobId + "is " + applicationJobStatus;
                jobExecutionContext.getNotifier().publish(new StatusChangeEvent(jobStatusMessage));
                GFacUtils.updateApplicationJobStatus(jobExecutionContext, jobId, applicationJobStatus);
                throw new GFacProviderException(experimentID + "Job Canceled");
            }

            else if (activityStatus.getState() == ActivityStateEnumeration.FINISHED) {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                }
                if (activityStatus.getExitCode() == 0) {
                    dt.downloadRemoteFiles();
                } else {
                    dt.downloadStdOuts();
                }
            }
View Full Code Here

        stats.addNewGetActivityStatuses().setActivityIdentifierArray(new EndpointReferenceType[] { activityEpr });

        GetActivityStatusesResponseDocument resDoc = fc.getActivityStatuses(stats);

        ActivityStatusType activityStatus = resDoc.getGetActivityStatusesResponse().getResponseArray()[0]
                .getActivityStatus();
        return activityStatus;
    }
View Full Code Here

        String factoryUrl = host.getUnicoreHostAddressArray()[0];

        EndpointReferenceType eprt = EndpointReferenceType.Factory.newInstance();
        eprt.addNewAddress().setStringValue(factoryUrl);

        CreateActivityDocument cad = CreateActivityDocument.Factory
                .newInstance();
       
        try {
      cad.addNewCreateActivity().addNewActivityDocument()
              .setJobDefinition(JSDLGenerator.buildJSDLInstance(jobExecutionContext).getJobDefinition());
    } catch (Exception e1) {
      throw new GFacProviderException("Cannot generate JSDL instance from the JobExecutionContext.",e1);
    }
       
View Full Code Here

TOP

Related Classes of org.ggf.schemas.bes.x2006.x08.besFactory.ActivityStateEnumeration.Enum

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.