Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / GIOP_Fragments / Java_Big_Reply / server.java
blob1449f2e96751b6910ff81d89bec4152548c5362f
1 // If this server is compiled and run with the JDK ORB, it will
2 // fragment the GIOP Messages sent when get_big_reply() is called.
4 import org.omg.CORBA.*;
5 import org.omg.PortableServer.*;
6 import Test.Big_ReplyPOA;
8 class Big_ReplyImpl extends Big_ReplyPOA
10 private org.omg.CORBA.ORB orb_;
12 public byte[] get_big_reply () {
13 byte [] seq = new byte [1000000];
14 for (int i = 0; i < seq.length; i++)
15 seq [i] = 'A';
16 return seq;
19 public void setORB (org.omg.CORBA.ORB orb_val) {
20 orb_ = orb_val;
23 public void ping () {
26 public void shutdown () {
27 orb_.shutdown (false);
32 public class server
34 public static void main (String args[]) {
35 try {
36 ORB orb = ORB.init (args, null);
37 POA poa = org.omg.PortableServer.POAHelper.narrow (
38 orb.resolve_initial_references ("RootPOA"));
40 Big_ReplyImpl servant = new Big_ReplyImpl ();
41 servant.setORB (orb);
42 poa.activate_object (servant);
44 String filename = new String ("server.ior");
45 String ior = orb.object_to_string (servant._this ());
46 java.io.FileWriter file = new java.io.FileWriter (filename);
47 file.write (ior);
48 file.flush ();
49 file.close ();
51 poa.the_POAManager ().activate ();
52 System.out.println ("Ready...");
53 orb.run ();
55 catch (Exception e) {
56 System.err.println ("ERROR: " + e);
57 e.printStackTrace (System.out);