KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > ir > gui > typesystem > remote > IROperation


1 /*
2  * JacORB - a free Java ORB
3  *
4  * Copyright (C) 1999-2004 Gerald Brose
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */

21 package org.jacorb.ir.gui.typesystem.remote;
22
23 /**
24  * This class was generated by a SmartGuide.
25  *
26  */

27  
28 import java.util.*;
29 import org.omg.CORBA.*;
30 import javax.swing.tree.*;
31 import org.jacorb.ir.gui.typesystem.*;
32  
33 public class IROperation extends IRNodeWithType implements AbstractContainer
34 {
35     protected IRParameter[] parameters;
36     protected IRException[] exceptions;
37     private String JavaDoc instanceNodeTypeName;
38     private OperationDef operationDef;
39
40
41     /**
42      * Default-Konstruktor: wird von TypeSystem.createNode(...) benutzt
43      */

44     public IROperation ( ) {
45     super();
46     }
47     /**
48      * This method was created by a SmartGuide.
49      * @param irObject org.omg.CORBA.IRObject
50      */

51     public IROperation ( IRObject irObject) {
52     super(irObject);
53     this.operationDef = OperationDefHelper.narrow((org.omg.CORBA.Object JavaDoc)irObject);
54     setAssociatedTypeSystemNode(RemoteTypeSystem.createTypeSystemNode(operationDef.result_def()));
55     String JavaDoc dummy = super.getInstanceNodeTypeName();
56     if (operationDef.mode().value() == OperationMode._OP_ONEWAY) {
57             dummy = "oneway" + " " + dummy;
58     }
59     this.instanceNodeTypeName = dummy;
60     }
61     /**
62      * contents method comment.
63      */

64     public org.jacorb.ir.gui.typesystem.ModelParticipant[] contents() {
65         // if (!getAbsoluteName().equals("::org::omg::CORBA::DynamicImplementation::invoke")) {
66
OperationDef operationDef= OperationDefHelper.narrow((org.omg.CORBA.Object JavaDoc)this.irObject);
67         ParameterDescription[] contents = operationDef.params();
68         org.jacorb.ir.gui.typesystem.TypeSystemNode[] result = new org.jacorb.ir.gui.typesystem.TypeSystemNode[contents.length];
69         for (int i=0; i<contents.length; i++) {
70             result[i] = RemoteTypeSystem.createTypeSystemNode(contents[i]);
71         } // for
72
return result;
73         // }
74
// return new org.jacorb.ir.gui.typesystem.TypeSystemNode[0];
75
}
76     /**
77      * This method was created by a SmartGuide.
78      * @return java.lang.String
79      */

80     public String JavaDoc getInstanceNodeTypeName ( ) {
81     return instanceNodeTypeName;
82     }
83     /**
84      * This method was created by a SmartGuide.
85      * @return java.lang.String
86      */

87     public static String JavaDoc nodeTypeName() {
88     return "operation";
89     }
90
91     public String JavaDoc description() {
92     String JavaDoc result = super.description();
93     if (exceptions==null) {
94             ExceptionDef[] exceptionDefs = operationDef.exceptions();
95             exceptions = new IRException[exceptionDefs.length];
96             for (int i=0; i<exceptionDefs.length; i++) {
97                 exceptions[i] = (IRException)RemoteTypeSystem.createTypeSystemNode(exceptionDefs[i]);
98             } // for
99
}
100     if (exceptions.length>0) {
101             result = result + "\nExceptions:\t ";
102             for (int i = 0; i<exceptions.length; i++) {
103                 result = result + ((TypeSystemNode)exceptions[i]).getAbsoluteName();
104                 if (!(i==exceptions.length-1)) {
105                     result = result + ", ";
106                 }
107             }
108     }
109     else {
110             result = result + "\nExceptions:\t:none";
111     }
112     return result;
113     }
114 }
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Popular Tags