|
From: <ha...@us...> - 2007-05-17 09:41:36
|
Revision: 1636
http://svn.sourceforge.net/cogkit/?rev=1636&view=rev
Author: hategan
Date: 2007-05-17 02:41:32 -0700 (Thu, 17 May 2007)
Log Message:
-----------
fixed NPE and canceling issues
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-gt4_0_0/CHANGES.txt
trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt4_0_0/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-gt4_0_0/CHANGES.txt 2007-05-02 21:19:49 UTC (rev 1635)
+++ trunk/current/src/cog/modules/provider-gt4_0_0/CHANGES.txt 2007-05-17 09:41:32 UTC (rev 1636)
@@ -1,3 +1,11 @@
+(05/17/2007)
+
+*** Fixed flow issues when canceling a job
+
+*** Fixed a bug that could cause a NPE if WS-GRAM would report a
+ failed job without an attached fault.
+
+
-------------------------------2.4---------------------------------
(11/24/2006)
Modified: trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java 2007-05-02 21:19:49 UTC (rev 1635)
+++ trunk/current/src/cog/modules/provider-gt4_0_0/src/org/globus/cog/abstraction/impl/execution/gt4_0_0/JobSubmissionTaskHandler.java 2007-05-17 09:41:32 UTC (rev 1636)
@@ -23,6 +23,7 @@
import org.globus.cog.abstraction.impl.common.task.InvalidServiceContactException;
import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException;
import org.globus.cog.abstraction.interfaces.DelegatedTaskHandler;
+import org.globus.cog.abstraction.interfaces.Delegation;
import org.globus.cog.abstraction.interfaces.ExecutionService;
import org.globus.cog.abstraction.interfaces.JobSpecification;
import org.globus.cog.abstraction.interfaces.Service;
@@ -48,323 +49,367 @@
* @author CoG Team
* @author David Del Vecchio
*/
-public class JobSubmissionTaskHandler implements DelegatedTaskHandler, GramJobListener {
- static Logger logger = Logger.getLogger(JobSubmissionTaskHandler.class.getName());
- private Task task = null;
- private GramJob gramJob;
+public class JobSubmissionTaskHandler implements DelegatedTaskHandler,
+ GramJobListener {
+ static Logger logger = Logger.getLogger(JobSubmissionTaskHandler.class);
+
+ private Task task = null;
+ private GramJob gramJob;
+ private boolean canceling;
- private static Map jmMappings;
+ private static Map jmMappings;
- static {
- jmMappings = new HashMap();
- jmMappings.put("fork", "Fork");
- jmMappings.put("pbs", "PBS");
- jmMappings.put("lsf", "LSF");
- jmMappings.put("condor", "Condor");
- }
+ static {
+ jmMappings = new HashMap();
+ jmMappings.put("fork", "Fork");
+ jmMappings.put("pbs", "PBS");
+ jmMappings.put("lsf", "LSF");
+ jmMappings.put("condor", "Condor");
+ jmMappings.put("sge", "SGE");
+ }
- public void submit(Task task) throws IllegalSpecException, InvalidSecurityContextException,
- InvalidServiceContactException, TaskSubmissionException {
- if (this.task != null) {
- throw new TaskSubmissionException(
- "JobSubmissionTaskHandler cannot handle two active jobs simultaneously");
- }
- else {
- this.task = task;
+ public void submit(Task task) throws IllegalSpecException,
+ InvalidSecurityContextException, InvalidServiceContactException,
+ TaskSubmissionException {
+ if (this.task != null) {
+ throw new TaskSubmissionException(
+ "JobSubmissionTaskHandler cannot handle two active jobs simultaneously");
+ }
+ else {
+ this.task = task;
- JobDescriptionType rsl;
- JobSpecification spec;
- try {
- spec = (JobSpecification) this.task.getSpecification();
- }
- catch (Exception e) {
- throw new IllegalSpecException("Exception while retreiving Job Specification", e);
- }
+ JobDescriptionType rsl;
+ JobSpecification spec;
+ try {
+ spec = (JobSpecification) this.task.getSpecification();
+ }
+ catch (Exception e) {
+ throw new IllegalSpecException(
+ "Exception while retreiving Job Specification", e);
+ }
- Service service = this.task.getService(0);
- ServiceContact serviceContact = service.getServiceContact();
- String server = serviceContact.getContact();
+ Service service = this.task.getService(0);
+ ServiceContact serviceContact = service.getServiceContact();
+ String server = serviceContact.getContact();
- String factoryType = ManagedJobFactoryConstants.DEFAULT_FACTORY_TYPE;
- if (service instanceof ExecutionService) {
- String jobManager = ((ExecutionService) service).getJobManager();
- if (logger.isDebugEnabled()) {
- logger.debug("Requested job manager: " + jobManager);
- }
- if (jobManager != null) {
- String lc = jobManager.toLowerCase();
- if (lc.startsWith("jobmanager-")) {
- lc = lc.substring(11);
- }
- if (jmMappings.containsKey(lc)) {
- jobManager = (String) jmMappings.get(lc);
- }
- factoryType = jobManager;
- }
- if (logger.isDebugEnabled()) {
- logger.debug("Actual job manager: " + factoryType);
- }
- }
+ String factoryType = ManagedJobFactoryConstants.DEFAULT_FACTORY_TYPE;
+ if (service instanceof ExecutionService) {
+ String jobManager = ((ExecutionService) service)
+ .getJobManager();
+ if (logger.isDebugEnabled()) {
+ logger.debug("Requested job manager: " + jobManager);
+ }
+ if (jobManager != null) {
+ String lc = jobManager.toLowerCase();
+ if (lc.startsWith("jobmanager-")) {
+ lc = lc.substring(11);
+ }
+ if (jmMappings.containsKey(lc)) {
+ jobManager = (String) jmMappings.get(lc);
+ }
+ factoryType = jobManager;
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("Actual job manager: " + factoryType);
+ }
+ }
- EndpointReferenceType factoryEndpoint;
- URL factoryURL;
+ EndpointReferenceType factoryEndpoint;
+ URL factoryURL;
- try {
- factoryURL = ManagedJobFactoryClientHelper.getServiceURL(server).getURL();
-
+ try {
+ factoryURL = ManagedJobFactoryClientHelper
+ .getServiceURL(server).getURL();
+
// Fix (hack) for the above returning the wrong default port
if (server.indexOf(':') == -1) {
factoryURL = new URL(factoryURL.getProtocol(), factoryURL
.getHost(), 8443, factoryURL.getFile());
}
- factoryEndpoint = ManagedJobFactoryClientHelper.getFactoryEndpoint(factoryURL,
- factoryType);
- }
- catch (Exception e) {
- throw new IllegalSpecException("Invalid service factory", e);
- }
+ factoryEndpoint = ManagedJobFactoryClientHelper
+ .getFactoryEndpoint(factoryURL, factoryType);
+ }
+ catch (Exception e) {
+ throw new IllegalSpecException("Invalid service factory", e);
+ }
- if (spec.getSpecification() != null) {
- try {
- this.gramJob = new GramJob(spec.getSpecification());
- }
- catch (RSLParseException e) {
- throw new IllegalSpecException(e.getMessage(), e);
- }
- }
- else {
- rsl = prepareSpecification(spec, server);
- this.gramJob = new GramJob(rsl);
- }
+ if (spec.getSpecification() != null) {
+ try {
+ this.gramJob = new GramJob(spec.getSpecification());
+ }
+ catch (RSLParseException e) {
+ throw new IllegalSpecException(e.getMessage(), e);
+ }
+ }
+ else {
+ rsl = prepareSpecification(spec, server);
+ this.gramJob = new GramJob(rsl);
+ }
- GlobusSecurityContextImpl securityContext = (GlobusSecurityContextImpl) this.task.getService(
- 0).getSecurityContext();
+ GlobusSecurityContextImpl securityContext = (GlobusSecurityContextImpl) this.task
+ .getService(0).getSecurityContext();
- try {
- this.gramJob.setCredentials((GSSCredential) securityContext.getCredentials());
- }
- catch (IllegalArgumentException iae) {
- throw new InvalidSecurityContextException("Cannot set the SecurityContext twice",
- iae);
- }
+ try {
+ this.gramJob.setCredentials((GSSCredential) securityContext
+ .getCredentials());
+ }
+ catch (IllegalArgumentException iae) {
+ throw new InvalidSecurityContextException(
+ "Cannot set the SecurityContext twice", iae);
+ }
- Authorization authorization = getAuthorization(securityContext);
- this.gramJob.setAuthorization(authorization);
+ Authorization authorization = getAuthorization(securityContext);
+ this.gramJob.setAuthorization(authorization);
- switch (securityContext.getXMLSec()) {
- case GlobusSecurityContextImpl.XML_ENCRYPTION:
- this.gramJob.setMessageProtectionType(Constants.ENCRYPTION);
- break;
- default:
- this.gramJob.setMessageProtectionType(Constants.SIGNATURE);
- break;
- }
+ switch (securityContext.getXMLSec()) {
+ case GlobusSecurityContextImpl.XML_ENCRYPTION:
+ this.gramJob.setMessageProtectionType(Constants.ENCRYPTION);
+ break;
+ default:
+ this.gramJob.setMessageProtectionType(Constants.SIGNATURE);
+ break;
+ }
- if (!spec.isBatchJob()) {
- this.gramJob.addListener(this);
- }
+ if (!spec.isBatchJob()) {
+ this.gramJob.addListener(this);
+ }
- this.gramJob.setDelegationEnabled(spec.isDelegationEnabled());
+ this.gramJob
+ .setDelegationEnabled(spec.getDelegation() != Delegation.NO_DELEGATION);
- try {
- this.gramJob.submit(factoryEndpoint, spec.isBatchJob(), true, "uuid:"
- + UUIDGenFactory.getUUIDGen().nextUUID());
- logger.info("Job submitted");
- if (spec.isBatchJob()) {
- this.task.setStatus(Status.COMPLETED);
- }
- }
- catch (Exception e) {
- Status newStatus = new StatusImpl();
- Status oldStatus = this.task.getStatus();
- newStatus.setPrevStatusCode(oldStatus.getStatusCode());
- newStatus.setStatusCode(Status.FAILED);
- newStatus.setException(e);
- this.task.setStatus(newStatus);
- cleanup();
- throw new TaskSubmissionException("Cannot submit job: " + e.getMessage(), e);
- }
- }
- }
+ try {
+ this.gramJob.submit(factoryEndpoint, spec.isBatchJob(), spec
+ .getDelegation() == Delegation.LIMITED_DELEGATION,
+ "uuid:" + UUIDGenFactory.getUUIDGen().nextUUID());
+ logger.info("Job submitted");
+ if (spec.isBatchJob()) {
+ this.task.setStatus(Status.COMPLETED);
+ }
+ }
+ catch (Exception e) {
+ Status newStatus = new StatusImpl();
+ Status oldStatus = this.task.getStatus();
+ newStatus.setPrevStatusCode(oldStatus.getStatusCode());
+ newStatus.setStatusCode(Status.FAILED);
+ newStatus.setException(e);
+ this.task.setStatus(newStatus);
+ cleanup();
+ throw new TaskSubmissionException("Cannot submit job: "
+ + e.getMessage(), e);
+ }
+ }
+ }
- public void suspend() throws InvalidSecurityContextException, TaskSubmissionException {
- throw new UnsupportedOperationException("suspend");
- }
+ public void suspend() throws InvalidSecurityContextException,
+ TaskSubmissionException {
+ throw new UnsupportedOperationException("suspend");
+ }
- public void resume() throws InvalidSecurityContextException, TaskSubmissionException {
- throw new UnsupportedOperationException("resume");
- }
+ public void resume() throws InvalidSecurityContextException,
+ TaskSubmissionException {
+ throw new UnsupportedOperationException("resume");
+ }
- public void cancel() throws InvalidSecurityContextException, TaskSubmissionException {
- try {
- this.gramJob.cancel();
- this.task.setStatus(Status.CANCELED);
- }
- catch (Exception e) {
- throw new TaskSubmissionException("Cannot cancel job", e);
- }
- finally {
- cleanup();
- }
- }
+ public void cancel() throws InvalidSecurityContextException,
+ TaskSubmissionException {
+ try {
+ synchronized (task) {
+ canceling = true;
+ }
+ this.gramJob.cancel();
+ //no cleanup since cancel() calls destroy()
+ }
+ catch (Exception e) {
+ throw new TaskSubmissionException("Cannot cancel job", e);
+ }
+ }
- private JobDescriptionType prepareSpecification(JobSpecification spec, String server)
- throws IllegalSpecException, TaskSubmissionException {
- // if the job specification is explicitly specified
- JobDescriptionType desc = new JobDescriptionType();
+ private JobDescriptionType prepareSpecification(JobSpecification spec,
+ String server) throws IllegalSpecException, TaskSubmissionException {
+ // if the job specification is explicitly specified
+ JobDescriptionType desc = new JobDescriptionType();
- if (spec.getDirectory() != null) {
- desc.setDirectory(spec.getDirectory());
- }
- if (spec.getAttribute("count") != null) {
- desc.setCount(new PositiveInteger(spec.getAttribute("count").toString()));
- }
- if (spec.getStdInput() != null) {
- desc.setStdin(spec.getStdInput());
- }
- if (spec.getAttribute("maxCpuTime") != null) {
- desc.setMaxCpuTime(new Long(spec.getAttribute("maxCpuTime").toString()));
- }
- if (spec.getAttribute("hostCount") != null) {
- desc.setHostCount(new PositiveInteger(spec.getAttribute("hostCount").toString()));
- }
- if (spec.getAttribute("jobType") != null) {
- desc.setJobType(JobTypeEnumeration.fromString(spec.getAttribute("jobType").toString()));
- }
- if (spec.getAttribute("maxMemory") != null) {
- desc.setMaxMemory(new NonNegativeInteger(spec.getAttribute("maxMemory").toString()));
- }
- if (spec.getAttribute("maxTime") != null) {
- desc.setMaxTime(new Long(spec.getAttribute("maxTime").toString()));
- }
- if (spec.getAttribute("maxWallTime") != null) {
- desc.setMaxWallTime(new Long(spec.getAttribute("maxWallTime").toString()));
- }
- if (spec.getAttribute("minMemory") != null) {
- desc.setMinMemory(new NonNegativeInteger(spec.getAttribute("minMemory").toString()));
- }
- if (spec.getAttribute("project") != null) {
- desc.setProject((String) spec.getAttribute("project"));
- }
- if (spec.getAttribute("queue") != null) {
- desc.setQueue((String) spec.getAttribute("queue"));
- }
+ if (spec.getDirectory() != null) {
+ desc.setDirectory(spec.getDirectory());
+ }
+ if (spec.getAttribute("count") != null) {
+ desc.setCount(new PositiveInteger(spec.getAttribute("count")
+ .toString()));
+ }
+ if (spec.getStdInput() != null) {
+ desc.setStdin(spec.getStdInput());
+ }
+ if (spec.getAttribute("maxCpuTime") != null) {
+ desc.setMaxCpuTime(new Long(spec.getAttribute("maxCpuTime")
+ .toString()));
+ }
+ if (spec.getAttribute("hostCount") != null) {
+ desc.setHostCount(new PositiveInteger(spec
+ .getAttribute("hostCount").toString()));
+ }
+ if (spec.getAttribute("jobType") != null) {
+ desc.setJobType(JobTypeEnumeration.fromString(spec.getAttribute(
+ "jobType").toString()));
+ }
+ if (spec.getAttribute("maxMemory") != null) {
+ desc.setMaxMemory(new NonNegativeInteger(spec.getAttribute(
+ "maxMemory").toString()));
+ }
+ if (spec.getAttribute("maxTime") != null) {
+ desc.setMaxTime(new Long(spec.getAttribute("maxTime").toString()));
+ }
+ if (spec.getAttribute("maxWallTime") != null) {
+ desc.setMaxWallTime(new Long(spec.getAttribute("maxWallTime")
+ .toString()));
+ }
+ if (spec.getAttribute("minMemory") != null) {
+ desc.setMinMemory(new NonNegativeInteger(spec.getAttribute(
+ "minMemory").toString()));
+ }
+ if (spec.getAttribute("project") != null) {
+ desc.setProject((String) spec.getAttribute("project"));
+ }
+ if (spec.getAttribute("queue") != null) {
+ desc.setQueue((String) spec.getAttribute("queue"));
+ }
- desc.setArgument((String[]) spec.getArgumentsAsList().toArray(new String[0]));
+ desc.setArgument((String[]) spec.getArgumentsAsList().toArray(
+ new String[0]));
- boolean batchJob = spec.isBatchJob();
- if (spec.isRedirected()) {
- throw new IllegalSpecException("The gt4.0.0 provider does not support redirection");
- }
- else {
- if (spec.getStdInput() != null) {
- desc.setStdin(spec.getStdInput());
- }
- if (spec.getStdOutput() != null) {
- desc.setStdout(spec.getStdOutput());
- }
- if (spec.getStdError() != null) {
- desc.setStderr(spec.getStdError());
- }
- }
+ boolean batchJob = spec.isBatchJob();
+ if (spec.isRedirected()) {
+ throw new IllegalSpecException(
+ "The gt4.0.0 provider does not support redirection");
+ }
+ else {
+ if (spec.getStdInput() != null) {
+ desc.setStdin(spec.getStdInput());
+ }
+ if (spec.getStdOutput() != null) {
+ desc.setStdout(spec.getStdOutput());
+ }
+ if (spec.getStdError() != null) {
+ desc.setStderr(spec.getStdError());
+ }
+ }
- if (spec.isLocalExecutable()) {
- throw new IllegalSpecException(
- "The gt4.0.0 provider does not support local executables");
- }
- desc.setExecutable(spec.getExecutable());
+ if (spec.isLocalExecutable()) {
+ throw new IllegalSpecException(
+ "The gt4.0.0 provider does not support local executables");
+ }
+ desc.setExecutable(spec.getExecutable());
- Collection environment = spec.getEnvironmentVariableNames();
- if (environment != null && environment.size() > 0) {
- NameValuePairType[] envVars = new NameValuePairType[environment.size()];
- Iterator iterator = environment.iterator();
- int i = 0;
- while (iterator.hasNext()) {
- String name = (String) iterator.next();
- String value = spec.getEnvironmentVariable(name);
- envVars[i++] = new NameValuePairType(name, value);
- }
- desc.setEnvironment(envVars);
- }
+ Collection environment = spec.getEnvironmentVariableNames();
+ if (environment != null && environment.size() > 0) {
+ NameValuePairType[] envVars = new NameValuePairType[environment
+ .size()];
+ Iterator iterator = environment.iterator();
+ int i = 0;
+ while (iterator.hasNext()) {
+ String name = (String) iterator.next();
+ String value = spec.getEnvironmentVariable(name);
+ envVars[i++] = new NameValuePairType(name, value);
+ }
+ desc.setEnvironment(envVars);
+ }
- return desc;
- }
+ return desc;
+ }
- public void stateChanged(GramJob job) {
- StateEnumeration state = job.getState();
- if (state.equals(StateEnumeration.Active)) {
- this.task.setStatus(Status.ACTIVE);
- }
- else if (state.equals(StateEnumeration.Failed)) {
- Status newStatus = new StatusImpl();
- Status oldStatus = this.task.getStatus();
- newStatus.setPrevStatusCode(oldStatus.getStatusCode());
- newStatus.setStatusCode(Status.FAILED);
- int errorCode = job.getError();
- if (job.getFault() != null) {
- failTask("#" + errorCode + " " + job.getFault().getDescription()[0], (Exception) job.getFault().getCause());
- }
- else {
- failTask("#" + errorCode + " " + job.getFault().getDescription()[0], null);
- }
- this.task.setStatus(newStatus);
- cleanup();
- }
- else if (state.equals(StateEnumeration.Done)) {
- if (job.getExitCode() != 0) {
- failTask("Job failed with an exit code of " + job.getExitCode(), null);
- }
- else {
- this.task.setStatus(Status.COMPLETED);
- }
- cleanup();
- }
- else if (state.equals(StateEnumeration.Suspended)) {
- this.task.setStatus(Status.SUSPENDED);
- }
- else if (state.equals(StateEnumeration.Pending)) {
- this.task.setStatus(Status.SUBMITTED);
- }
- else {
- logger.debug("Unknown status: " + state.getValue());
- }
- }
-
- private void failTask(String message, Exception exception) {
- Status newStatus = new StatusImpl();
- Status oldStatus = this.task.getStatus();
- newStatus.setPrevStatusCode(oldStatus.getStatusCode());
- newStatus.setStatusCode(Status.FAILED);
- newStatus.setMessage(message);
- newStatus.setException(exception);
- this.task.setStatus(newStatus);
- }
+ public void stateChanged(GramJob job) {
+ StateEnumeration state = job.getState();
+ if (state.equals(StateEnumeration.Active)) {
+ this.task.setStatus(Status.ACTIVE);
+ }
+ else if (state.equals(StateEnumeration.Failed)) {
+ boolean canceled = false;
+ synchronized (task) {
+ if (canceling) {
+ canceled = true;
+ }
+ }
+ if (canceled) {
+ this.task.setStatus(Status.CANCELED);
+ gramJob.removeListener(this);
+ }
+ else {
+ Status newStatus = new StatusImpl();
+ Status oldStatus = this.task.getStatus();
+ newStatus.setPrevStatusCode(oldStatus.getStatusCode());
+ newStatus.setStatusCode(Status.FAILED);
+ int errorCode = job.getError();
+ if (job.getFault() != null) {
+ failTask("#" + errorCode + " "
+ + job.getFault().getDescription()[0],
+ (Exception) job.getFault().getCause());
+ }
+ else {
+ failTask("#" + errorCode, null);
+ }
+ this.task.setStatus(newStatus);
+ cleanup();
+ }
+ }
+ else if (state.equals(StateEnumeration.Done)) {
+ if (job.getExitCode() != 0) {
+ failTask(
+ "Job failed with an exit code of " + job.getExitCode(),
+ null);
+ }
+ else {
+ this.task.setStatus(Status.COMPLETED);
+ }
+ cleanup();
+ }
+ else if (state.equals(StateEnumeration.Suspended)) {
+ this.task.setStatus(Status.SUSPENDED);
+ }
+ else if (state.equals(StateEnumeration.Pending)) {
+ this.task.setStatus(Status.SUBMITTED);
+ }
+ else {
+ logger.debug("Unknown status: " + state.getValue());
+ }
+ }
- private void cleanup() {
- this.gramJob.removeListener(this);
- logger.debug("Destroying remote service for task " + this.task.getIdentity().toString());
- try {
- gramJob.release();
- this.gramJob.destroy();
- }
- catch (Exception e) {
- logger.warn("Unable to destroy remote service for task "
- + this.task.getIdentity().toString(), e);
- }
- }
+ private void failTask(String message, Exception exception) {
+ Status newStatus = new StatusImpl();
+ Status oldStatus = this.task.getStatus();
+ newStatus.setPrevStatusCode(oldStatus.getStatusCode());
+ newStatus.setStatusCode(Status.FAILED);
+ newStatus.setMessage(message);
+ newStatus.setException(exception);
+ this.task.setStatus(newStatus);
+ }
- private Authorization getAuthorization(GlobusSecurityContextImpl securityContext) {
- Authorization authorization = HostAuthorization.getInstance();
+ private void cleanup() {
+ this.gramJob.removeListener(this);
+ logger.debug("Destroying remote service for task "
+ + this.task.getIdentity().toString());
+ try {
+ gramJob.release();
+ gramJob.destroy();
+ }
+ catch (Exception e) {
+ logger.warn("Unable to destroy remote service for task "
+ + this.task.getIdentity().toString(), e);
+ }
+ }
- org.globus.gsi.gssapi.auth.Authorization auth = securityContext.getAuthorization();
- // map to GT4 authorization
- if (auth instanceof org.globus.gsi.gssapi.auth.SelfAuthorization) {
- authorization = SelfAuthorization.getInstance();
- }
- else if (auth instanceof org.globus.gsi.gssapi.auth.HostAuthorization) {
- authorization = HostAuthorization.getInstance();
- }
- return authorization;
- }
+ private Authorization getAuthorization(
+ GlobusSecurityContextImpl securityContext) {
+ Authorization authorization = HostAuthorization.getInstance();
+
+ org.globus.gsi.gssapi.auth.Authorization auth = securityContext
+ .getAuthorization();
+ // map to GT4 authorization
+ if (auth instanceof org.globus.gsi.gssapi.auth.SelfAuthorization) {
+ authorization = SelfAuthorization.getInstance();
+ }
+ else if (auth instanceof org.globus.gsi.gssapi.auth.HostAuthorization) {
+ authorization = HostAuthorization.getInstance();
+ }
+ return authorization;
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|