KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > javax > management > relation > SimpleRelationType


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package test.javax.management.relation;
10
11 import javax.management.relation.RelationTypeSupport JavaDoc;
12 import javax.management.relation.RoleInfo JavaDoc;
13
14 /**
15  * @version $Revision: 1.5 $
16  */

17 public class SimpleRelationType extends RelationTypeSupport JavaDoc
18 {
19    public SimpleRelationType(String JavaDoc relationTypeName)
20    {
21       super(relationTypeName);
22       try
23       {
24          RoleInfo JavaDoc primaryRoleInfo = new RoleInfo JavaDoc("primary",
25                                                  "test.javax.management.relation.SimpleStandard",
26                                                  true, //read
27
true, //write
28
2,
29                                                  2,
30                                                  "Primary :)");
31          addRoleInfo(primaryRoleInfo);
32
33          RoleInfo JavaDoc secondaryRoleInfo = new RoleInfo JavaDoc("secondary",
34                                                    "test.javax.management.relation.SimpleStandard",
35                                                    true,
36                                                    false,
37                                                    2,
38                                                    2,
39                                                    "Secondary");
40          addRoleInfo(secondaryRoleInfo);
41       }
42       catch (Exception JavaDoc ex)
43       {
44          throw new RuntimeException JavaDoc(ex.getMessage());
45       }
46    }
47 }
48
Popular Tags