View Javadoc

1   package fr.in2p3.jsaga.impl.task;
2   
3   import org.ogf.saga.attributes.Attributes;
4   import org.ogf.saga.error.*;
5   import org.ogf.saga.session.Session;
6   import org.ogf.saga.task.*;
7   
8   /* ***************************************************
9    * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
10   * ***             http://cc.in2p3.fr/             ***
11   * ***************************************************
12   * File:   AbstractAsyncTaskImpl
13   * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
14   * Date:   4 juin 2009
15   * ***************************************************
16   * Description:                                      */
17  /**
18   *
19   */
20  public abstract class AbstractAsyncTaskImpl<A extends Attributes> extends AbstractTaskImplWithAsyncAttributes<Void,Void,A> {
21      /** constructor */
22      protected AbstractAsyncTaskImpl(Session session, boolean create) throws NotImplementedException {
23          super(session, create);
24      }
25  
26      public Task<Task,Void> run(TaskMode mode) throws NotImplementedException {
27          return new AbstractThreadedTask<Task,Void>(mode) {
28              public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
29                  AbstractAsyncTaskImpl.super.run();
30                  return null;
31              }
32          };
33      }
34  
35      public Task<Task,Void> cancel(TaskMode mode) throws NotImplementedException {
36          return new AbstractThreadedTask<Task,Void>(mode) {
37              public Void invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
38                  AbstractAsyncTaskImpl.super.cancel();
39                  return null;
40              }
41          };
42      }
43  
44      public Task<Task,State> getState(TaskMode mode) throws NotImplementedException {
45          return new AbstractThreadedTask<Task,State>(mode) {
46              public State invoke() throws NotImplementedException, IncorrectURLException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, BadParameterException, IncorrectStateException, AlreadyExistsException, DoesNotExistException, TimeoutException, NoSuccessException {
47                  return AbstractAsyncTaskImpl.super.getState();
48              }
49          };
50      }
51  }