KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > orb > connection > BiDirSetup


1 package org.jacorb.test.orb.connection;
2
3 import java.util.Properties JavaDoc;
4
5 import org.omg.PortableServer.*;
6 import org.omg.BiDirPolicy.*;
7 import org.omg.CORBA.*;
8
9 import junit.framework.*;
10
11 import org.jacorb.test.common.*;
12
13 /**
14  * @author Andre Spiegel
15  * @version $Id: BiDirSetup.java,v 1.1 2003/04/27 12:33:21 andre.spiegel Exp $
16  */

17 public class BiDirSetup extends ClientServerSetup
18 {
19     private POA biDirPOA = null;
20     
21     public BiDirSetup (Test test,
22                        Properties JavaDoc clientProperties,
23                        Properties JavaDoc serverProperties)
24     {
25         super(test, "org.jacorb.test.orb.connection.BiDirServerImpl",
26               clientProperties, serverProperties);
27     }
28
29     public String JavaDoc getTestServerMain()
30     {
31         return "org.jacorb.test.orb.connection.BiDirServerImpl";
32     }
33     
34     public void setUp() throws Exception JavaDoc
35     {
36         super.setUp();
37         
38         Policy[] policies = new Policy[4];
39         policies[0] =
40             clientRootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
41
42         policies[1] =
43             clientRootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID);
44
45         policies[2] =
46             clientRootPOA.create_implicit_activation_policy( ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION );
47
48         Any any = clientOrb.create_any();
49         BidirectionalPolicyValueHelper.insert( any, BOTH.value );
50         policies[3] = clientOrb.create_policy( BIDIRECTIONAL_POLICY_TYPE.value,
51                                          any );
52
53         biDirPOA = clientRootPOA.create_POA( "BiDirPOA",
54                                              clientRootPOA.the_POAManager(),
55                                              policies );
56         biDirPOA.the_POAManager().activate();
57     }
58
59     public POA getBiDirPOA()
60     {
61         return biDirPOA;
62     }
63
64 }
65
Popular Tags