KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > clustering > CarbonUserMessage


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.clustering;
19
20 import java.io.Serializable JavaDoc;
21 import java.net.InetAddress JavaDoc;
22
23 /**
24  * <p>This is the template for Classes.</p>
25  *
26  *
27  * @since carbon 1.0
28  * @author Greg Hinkle, January 2002
29  * @version $Revision: 1.3 $($Author: dvoet $ / $Date: 2003/05/05 21:21:08 $)
30  * @copyright 2002 Sapient
31  */

32 public class CarbonUserMessage implements Serializable JavaDoc {
33
34     private String JavaDoc userName =
35         System.getProperty("user.name");
36     private String JavaDoc osName =
37         System.getProperty("os.name");
38     private String JavaDoc osVersion =
39         System.getProperty("os.version");
40
41     private String JavaDoc javaVendor =
42         System.getProperty("java.vendor");
43     private String JavaDoc javaVersion =
44         System.getProperty("java.version");
45     private int key =
46         System.identityHashCode(Runtime.getRuntime());
47
48     private InetAddress JavaDoc localHost;
49
50     public CarbonUserMessage() {
51         try {
52             this.localHost = InetAddress.getLocalHost();
53         } catch (Exception JavaDoc e) {
54             e.printStackTrace();
55         }
56     }
57
58     public String JavaDoc toString() {
59         return
60             "Carbon User: " + this.userName + "@" + this.localHost + "\n" +
61             "\tOperating System: " + this.osName + "[" + this.osVersion + "]\n" +
62             "\tJava: " + this.javaVendor + "[" + this.javaVersion + "]\n" +
63             "\tSystemKey: " + this.key;
64     }
65 }
66
Popular Tags