8ddaa5fed669a019cf996dada99563474f7df736
[jabaws.git] / engine / compbio / engine / cluster / drmaa / _JobStatus.java
1 /* Copyright (c) 2009 Peter Troshin\r
2  *  \r
3  *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0     \r
4  * \r
5  *  This library is free software; you can redistribute it and/or modify it under the terms of the\r
6  *  Apache License version 2 as published by the Apache Software Foundation\r
7  * \r
8  *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
9  *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
10  *  License for more details.\r
11  * \r
12  *  A copy of the license is in apache_license.txt. It is also available here:\r
13  * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
14  * \r
15  * Any republication or derived work distributed in source code form\r
16  * must include this copyright and license notice.\r
17  */\r
18 package compbio.engine.cluster.drmaa;\r
19 \r
20 import org.ggf.drmaa.DrmaaException;\r
21 import org.ggf.drmaa.Session;\r
22 import org.ggf.drmaa.SessionFactory;\r
23 import org.ggf.drmaa.Version;\r
24 \r
25 public class _JobStatus {\r
26 \r
27         \r
28         \r
29         public static void main(String[] args) {\r
30 \r
31                 SessionFactory factory = SessionFactory.getFactory();\r
32                 Session session = factory.getSession();\r
33 \r
34                 try {\r
35                         System.out.println("Supported contact strings: \""\r
36                                         + session.getContact() + "\"");\r
37                         System.out.println("Supported DRM systems: \""\r
38                                         + session.getDrmSystem() + "\"");\r
39                         System.out.println("Supported DRMAA implementations: \""\r
40                                         + session.getDrmaaImplementation() + "\"");\r
41 \r
42                         session.init("");\r
43 \r
44                         System.out.println("Using contact strings: \""\r
45                                         + session.getContact() + "\"");\r
46                         System.out.println("Using DRM systems: \"" + session.getDrmSystem()\r
47                                         + "\"");\r
48                         System.out.println("Using DRMAA implementations: \""\r
49                                         + session.getDrmaaImplementation() + "\"");\r
50 \r
51                         Version version = session.getVersion();\r
52 \r
53                         System.out.println("Using DRMAA version " + version.toString());\r
54 \r
55                         session.exit();\r
56                 } catch (DrmaaException e) {\r
57                         System.out.println("Error: " + e.getMessage());\r
58                 }\r
59 \r
60         }\r
61 }\r