KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > transport > TransportDefault


1 /*
2  * @(#)TransportDefault.java 1.19 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.spi.transport ;
9
10 import com.sun.corba.se.spi.protocol.CorbaClientDelegate ;
11 import com.sun.corba.se.spi.protocol.ClientDelegateFactory ;
12 import com.sun.corba.se.spi.transport.CorbaContactInfoList ;
13 import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ;
14 import com.sun.corba.se.spi.transport.ReadTimeouts;
15 import com.sun.corba.se.spi.transport.ReadTimeoutsFactory;
16 import com.sun.corba.se.spi.orb.ORB ;
17 import com.sun.corba.se.spi.ior.IOR ;
18
19 // Internal imports, not used in the interface to this package
20
import com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl ;
21 import com.sun.corba.se.impl.transport.CorbaContactInfoListImpl;
22 import com.sun.corba.se.impl.transport.ReadTCPTimeoutsImpl;
23
24 /** This class provices standard building blocks for the ORB, as do all Default classes
25  * in the various packages.
26  */

27 public abstract class TransportDefault {
28     private TransportDefault() {}
29
30     public static CorbaContactInfoListFactory makeCorbaContactInfoListFactory(
31     final ORB broker )
32     {
33     return new CorbaContactInfoListFactory() {
34         public void setORB(ORB orb) { }
35         public CorbaContactInfoList create( IOR ior ) {
36         return new CorbaContactInfoListImpl(
37             (com.sun.corba.se.spi.orb.ORB)broker, ior ) ;
38         }
39     };
40     }
41
42     public static ClientDelegateFactory makeClientDelegateFactory(
43     final ORB broker )
44     {
45     return new ClientDelegateFactory() {
46         public CorbaClientDelegate create( CorbaContactInfoList info ) {
47         return new CorbaClientDelegateImpl(
48             (com.sun.corba.se.spi.orb.ORB)broker, info ) ;
49         }
50     };
51     }
52
53     public static IORTransformer makeIORTransformer(
54     final ORB broker )
55     {
56     return null ;
57     }
58
59     public static ReadTimeoutsFactory makeReadTimeoutsFactory()
60     {
61     return new ReadTimeoutsFactory() {
62         public ReadTimeouts create(int initial_wait_time,
63                                int max_wait_time,
64                        int max_giop_hdr_wait_time,
65                        int backoff_percent_factor)
66         {
67         return new ReadTCPTimeoutsImpl(
68             initial_wait_time,
69             max_wait_time,
70             max_giop_hdr_wait_time,
71             backoff_percent_factor);
72         };
73     };
74     }
75 }
76     
77 // End of file.
78
Popular Tags