View Javadoc

1   package fr.in2p3.jsaga.adaptor.data.impl;
2   
3   import fr.in2p3.jsaga.adaptor.schema.data.emulator.Server;
4   import fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType;
5   import org.ogf.saga.error.NoSuccessException;
6   import org.ogf.saga.error.TimeoutException;
7   
8   /* ***************************************************
9   * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
10  * ***             http://cc.in2p3.fr/             ***
11  * ***************************************************
12  * File:   DataEmulatorConnection
13  * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
14  * Date:   26 juin 2007
15  * ***************************************************
16  * Description:                                      */
17  /**
18   *
19   */
20  public class DataEmulatorConnection extends DataEmulatorConnectionAbstract {
21      private Server m_serverRoot;
22  
23      public DataEmulatorConnection(String protocol, String host, int port) throws TimeoutException, NoSuccessException {
24          super();
25          m_serverRoot = m_grid.connect(protocol, host, port);
26          if (m_serverRoot == null) {
27              throw new TimeoutException("Failed to connect to host: "+host);
28          }
29      }
30  
31      public void destroy() {
32          m_grid.disconnect(m_serverRoot);
33      }
34  
35      protected ServerType getServerRoot() {
36          return m_serverRoot;
37      }
38  }