1 /*
   2  * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.corba.se.spi.transport ;
  27 
  28 import com.sun.corba.se.spi.protocol.CorbaClientDelegate ;
  29 import com.sun.corba.se.spi.protocol.ClientDelegateFactory ;
  30 import com.sun.corba.se.spi.transport.CorbaContactInfoList ;
  31 import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ;
  32 import com.sun.corba.se.spi.transport.ReadTimeouts;
  33 import com.sun.corba.se.spi.transport.ReadTimeoutsFactory;
  34 import com.sun.corba.se.spi.orb.ORB ;
  35 import com.sun.corba.se.spi.ior.IOR ;
  36 
  37 // Internal imports, not used in the interface to this package
  38 import com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl ;
  39 import com.sun.corba.se.impl.transport.CorbaContactInfoListImpl;
  40 import com.sun.corba.se.impl.transport.ReadTCPTimeoutsImpl;
  41 
  42 /** This class provices standard building blocks for the ORB, as do all Default classes
  43  * in the various packages.
  44  */
  45 public abstract class TransportDefault {
  46     private TransportDefault() {}
  47 
  48     public static CorbaContactInfoListFactory makeCorbaContactInfoListFactory(
  49         final ORB broker )
  50     {
  51         return new CorbaContactInfoListFactory() {
  52             public void setORB(ORB orb) { }
  53             public CorbaContactInfoList create( IOR ior ) {
  54                 return new CorbaContactInfoListImpl(
  55                     (com.sun.corba.se.spi.orb.ORB)broker, ior ) ;
  56             }
  57         };
  58     }
  59 
  60     public static ClientDelegateFactory makeClientDelegateFactory(
  61         final ORB broker )
  62     {
  63         return new ClientDelegateFactory() {
  64             public CorbaClientDelegate create( CorbaContactInfoList info ) {
  65                 return new CorbaClientDelegateImpl(
  66                     (com.sun.corba.se.spi.orb.ORB)broker, info ) ;
  67             }
  68         };
  69     }
  70 
  71     public static IORTransformer makeIORTransformer(
  72         final ORB broker )
  73     {
  74         return null ;
  75     }
  76 
  77     public static ReadTimeoutsFactory makeReadTimeoutsFactory()
  78     {
  79         return new ReadTimeoutsFactory() {
  80             public ReadTimeouts create(int initial_wait_time,
  81                                        int max_wait_time,
  82                                        int max_giop_hdr_wait_time,
  83                                        int backoff_percent_factor)
  84             {
  85                 return new ReadTCPTimeoutsImpl(
  86                     initial_wait_time,
  87                     max_wait_time,
  88                     max_giop_hdr_wait_time,
  89                     backoff_percent_factor);
  90             };
  91         };
  92     }
  93 }
  94 
  95 // End of file.