invocationContext.getExecutionContext().setRegistryService(getRegistry(context));
invocationContext.getExecutionContext().setSecurityContextHeader(getHeader(messageContext));
invocationContext.getExecutionContext().addNotifiable(workflowNotification);
invocationContext.getExecutionContext().addNotifiable(loggingNotification);
GSISecurityContext gssContext = new GSISecurityContext();
SecurityContextDocument parse =
SecurityContextDocument.Factory.parse(getHeader(messageContext).getFirstChildWithName
(new QName("http://schemas.airavata.apache.org/workflow-execution-context", "security-context")).toStringWithConsume());
SecurityContextDocument.SecurityContext.GridMyproxyRepository gridMyproxyRepository = parse.getSecurityContext().getGridMyproxyRepository();
if (gridMyproxyRepository==null){
gssContext.setMyproxyPasswd((String)messageContext.getConfigurationContext().getProperty(MYPROXY_PASS));
gssContext.setMyproxyUserName((String)messageContext.getConfigurationContext().getProperty(MYPROXY_USER));
gssContext.setMyproxyLifetime(Integer.parseInt(messageContext.getConfigurationContext().getProperty(MYPROXY_LIFE).toString()));
gssContext.setMyproxyServer((String)messageContext.getConfigurationContext().getProperty(MYPROXY_SERVER));
}else{
gssContext.setMyproxyPasswd(gridMyproxyRepository.getPassword());
gssContext.setMyproxyUserName(gridMyproxyRepository.getUsername());
gssContext.setMyproxyLifetime(gridMyproxyRepository.getLifeTimeInhours());
gssContext.setMyproxyServer(gridMyproxyRepository.getMyproxyServer());
}
gssContext.setTrustedCertLoc((String)messageContext.getConfigurationContext().getProperty(TRUSTED_CERT_LOCATION));
invocationContext.addSecurityContext("myproxy",gssContext);
/*
* Add workflow context