KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > Version


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.axis;
18
19 import org.apache.axis.client.Call;
20 import org.apache.axis.utils.Messages;
21
22 /**
23  * Little utility to get the version and build date of the axis.jar.
24  *
25  * The messages referenced here are automatically kept up-to-date by the
26  * build.xml.
27  *
28  * @author Glen Daniels (gdaniels@apache.org)
29  */

30 public class Version {
31     /**
32      * Get the version of this AXIS.
33      *
34      * @return the version of this axis
35      */

36     public static String JavaDoc getVersion()
37     {
38         return Messages.getMessage("axisVersion") + "\n" +
39                Messages.getMessage("builtOn");
40     }
41
42     /**
43      * Returns the Axis Version number and build date.
44      * <p>
45      * Example output: 1.1 Jul 08, 2003 (09:00:12 EDT)
46      *
47      * @return the full version of this axis
48      **/

49     public static String JavaDoc getVersionText()
50     {
51         return Messages.getMessage("axisVersionRaw") + " " + Messages.getMessage("axisBuiltOnRaw");
52     }
53
54     /**
55      * Entry point.
56      * <p>
57      * Calling this with no arguments returns the version of the client-side
58      * axis.jar. Passing a URL which points to a remote Axis server will
59      * attempt to retrieve the version of the server via a SOAP call.
60      */

61     public static void main(String JavaDoc[] args) {
62         if (args.length != 1)
63             System.out.println(getVersion());
64         else
65             try {
66                 Call call = new Call(args[0]);
67                 String JavaDoc result = (String JavaDoc)call.invoke("Version", "getVersion",
68                                                     null);
69                 System.out.println(result);
70             } catch (Exception JavaDoc e) {
71                 e.printStackTrace();
72             }
73     }
74 }
75
Popular Tags