KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > orb > RecursiveParamServerImpl


1 package org.jacorb.test.orb;
2
3 import java.io.*;
4 import junit.framework.*;
5 import junit.extensions.*;
6 import org.omg.CORBA.*;
7 import org.omg.PortableServer.*;
8 import org.jacorb.util.*;
9 import org.jacorb.test.*;
10 import org.jacorb.test.RecursiveParamServerPackage.*;
11 import org.jacorb.test.RecursiveParamServerPackage.ParmPackage.*;
12
13
14 public class RecursiveParamServerImpl extends RecursiveParamServerPOA
15 {
16     public void passParm( Parm p )
17     {
18         System.out.println("Parm name" + p.name );
19         System.out.println("Parm value");
20         switch( p.value.discriminator().value() )
21         {
22             case ParmValueType._string_type :
23             System.out.println( p.value.string_value());
24             break;
25             case ParmValueType._nested_type:
26             System.out.println("nested:");
27             Parm[][] nested = p.value.nested_value();
28             for( int i = 0; i < nested.length; i++ )
29                 for( int j = 0; j < nested[i].length; j++ )
30                     passParm( nested[i][j]);
31         }
32         System.out.println("Parm ok");
33     }
34
35
36     public void passAny( Any a )
37     {
38         try
39         {
40             blubT union = blubTHelper.extract( a );
41             if( union.discriminator() )
42             {
43                 blubT[] blubs = union.b();
44             }
45             System.out.println("Any ok");
46         }
47         catch (Exception JavaDoc e )
48         {
49             e.printStackTrace();
50         }
51     }
52 }
53
Popular Tags