1 // Tags: not-a-test |
|
2 // Copyright (c) Object Oriented Concepts, Inc. Billerica, MA, USA |
|
3 |
|
4 // Adapted for Mauve by Audrius Meskauskas <audriusa@bluewin.ch> |
|
5 |
|
6 // This file is part of Mauve. |
|
7 |
|
8 // Mauve is free software; you can redistribute it and/or modify |
|
9 // it under the terms of the GNU General Public License as published by |
|
10 // the Free Software Foundation; either version 2, or (at your option) |
|
11 // any later version. |
|
12 |
|
13 // Mauve is distributed in the hope that it will be useful, |
|
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 // GNU General Public License for more details. |
|
17 |
|
18 // You should have received a copy of the GNU General Public License |
|
19 // along with Mauve; see the file COPYING. If not, write to |
|
20 // the Free Software Foundation, 59 Temple Place - Suite 330, |
|
21 // Boston, MA 02111-1307, USA. |
|
22 |
|
23 /* |
|
24 This code originally came from the OMG's CORBA Open Source Testing project, |
|
25 which lived at cost.omg.org. That site no longer exists. |
|
26 |
|
27 All the contributing companies agreed to release their tests under the |
|
28 terms of the GNU Lesser General Public License, available in the file |
|
29 COPYING.LIB. |
|
30 |
|
31 The code has been modified integrating into Mauve test environment and |
|
32 removing tests that are not yet supported by Suns jre 1.4. Hence the license |
|
33 is now GPL. |
|
34 |
|
35 We downloaded the code from http://sourceforge.net/projects/corba-cost/, |
|
36 administrated by Duncan Grisby. |
|
37 */ |
|
38 |
|
39 package gnu.testlet.org.omg.PortableServer.POA; |
|
40 |
|
41 import org.omg.CORBA.BAD_OPERATION; |
|
42 import org.omg.CORBA.CompletionStatus; |
|
43 import org.omg.CORBA.ORB; |
|
44 import org.omg.CORBA.portable.InputStream; |
|
45 import org.omg.CORBA.portable.InvokeHandler; |
|
46 import org.omg.CORBA.portable.OutputStream; |
|
47 import org.omg.CORBA.portable.ResponseHandler; |
|
48 import org.omg.PortableServer.Servant; |
|
49 |
|
50 public abstract class TestLocationForwardPOA |
|
51 extends org.omg.PortableServer.Servant |
|
52 implements TestLocationForwardOperations, InvokeHandler |
|
53 { |
|
54 // Constructors |
|
55 private static java.util.Hashtable _methods = new java.util.Hashtable(); |
|
56 |
|
57 static |
|
58 { |
|
59 _methods.put("deactivate_servant", new Integer(0)); |
|
60 _methods.put("aMethod", new Integer(1)); |
|
61 } |
|
62 |
|
63 public OutputStream _invoke(String $method, InputStream in, ResponseHandler rh) |
|
64 { |
|
65 OutputStream out = null; |
|
66 Integer __method = (Integer) _methods.get($method); |
|
67 if (__method == null) |
|
68 throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); |
|
69 |
|
70 switch (__method.intValue()) |
|
71 { |
|
72 case 0 : // test/poa/TestLocationForward/deactivate_servant |
|
73 { |
|
74 this.deactivate_servant(); |
|
75 out = rh.createReply(); |
|
76 break; |
|
77 } |
|
78 |
|
79 case 1 : // test/poa/Test/aMethod |
|
80 { |
|
81 this.aMethod(); |
|
82 out = rh.createReply(); |
|
83 break; |
|
84 } |
|
85 |
|
86 default : |
|
87 throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); |
|
88 } |
|
89 |
|
90 return out; |
|
91 } // _invoke |
|
92 |
|
93 // Type-specific CORBA::Object operations |
|
94 private static String[] __ids = |
|
95 { "IDL:test/poa/TestLocationForward:1.0", "IDL:test/poa/Test:1.0" }; |
|
96 |
|
97 public String[] _all_interfaces(org.omg.PortableServer.POA poa, |
|
98 byte[] objectId |
|
99 ) |
|
100 { |
|
101 return __ids; |
|
102 } |
|
103 |
|
104 public TestLocationForward _this() |
|
105 { |
|
106 return TestLocationForwardHelper.narrow(super._this_object()); |
|
107 } |
|
108 |
|
109 public TestLocationForward _this(ORB orb) |
|
110 { |
|
111 return TestLocationForwardHelper.narrow(super._this_object(orb)); |
|
112 } |
|
113 } |
|