1 /*
   2  * Copyright (c) 2002, 2003, 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.protocol ;
  27 
  28 import com.sun.corba.se.pept.protocol.ClientRequestDispatcher;
  29 
  30 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
  31 import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
  32 
  33 import com.sun.corba.se.spi.orb.ORB ;
  34 
  35 // Used only in the implementation: no client of this class ever needs these
  36 import com.sun.corba.se.spi.ior.IOR ;
  37 
  38 import com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl ;
  39 import com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl ;
  40 import com.sun.corba.se.impl.protocol.MinimalServantCacheLocalCRDImpl ;
  41 import com.sun.corba.se.impl.protocol.InfoOnlyServantCacheLocalCRDImpl ;
  42 import com.sun.corba.se.impl.protocol.FullServantCacheLocalCRDImpl ;
  43 import com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl ;
  44 import com.sun.corba.se.impl.protocol.POALocalCRDImpl ;
  45 import com.sun.corba.se.impl.protocol.INSServerRequestDispatcher ;
  46 import com.sun.corba.se.impl.protocol.BootstrapServerRequestDispatcher ;
  47 
  48 public final class RequestDispatcherDefault {
  49     private RequestDispatcherDefault() {}
  50 
  51     public static ClientRequestDispatcher makeClientRequestDispatcher()
  52     {
  53         return new CorbaClientRequestDispatcherImpl() ;
  54     }
  55 
  56     public static CorbaServerRequestDispatcher makeServerRequestDispatcher( ORB orb )
  57     {
  58         return new CorbaServerRequestDispatcherImpl( (com.sun.corba.se.spi.orb.ORB)orb ) ;
  59     }
  60 
  61     public static CorbaServerRequestDispatcher makeBootstrapServerRequestDispatcher( ORB orb )
  62     {
  63         return new BootstrapServerRequestDispatcher( orb ) ;
  64     }
  65 
  66     public static CorbaServerRequestDispatcher makeINSServerRequestDispatcher( ORB orb )
  67     {
  68         return new INSServerRequestDispatcher( orb ) ;
  69     }
  70 
  71     public static LocalClientRequestDispatcherFactory makeMinimalServantCacheLocalClientRequestDispatcherFactory( final ORB orb )
  72     {
  73         return new LocalClientRequestDispatcherFactory() {
  74             public LocalClientRequestDispatcher create( int id, IOR ior ) {
  75                 return new MinimalServantCacheLocalCRDImpl( orb, id, ior ) ;
  76             }
  77         } ;
  78     }
  79 
  80     public static LocalClientRequestDispatcherFactory makeInfoOnlyServantCacheLocalClientRequestDispatcherFactory( final ORB orb )
  81     {
  82         return new LocalClientRequestDispatcherFactory() {
  83             public LocalClientRequestDispatcher create( int id, IOR ior ) {
  84                 return new InfoOnlyServantCacheLocalCRDImpl( orb, id, ior ) ;
  85             }
  86         } ;
  87     }
  88 
  89     public static LocalClientRequestDispatcherFactory makeFullServantCacheLocalClientRequestDispatcherFactory( final ORB orb )
  90     {
  91         return new LocalClientRequestDispatcherFactory() {
  92             public LocalClientRequestDispatcher create( int id, IOR ior ) {
  93                 return new FullServantCacheLocalCRDImpl( orb, id, ior ) ;
  94             }
  95         } ;
  96     }
  97 
  98     public static LocalClientRequestDispatcherFactory makeJIDLLocalClientRequestDispatcherFactory( final ORB orb )
  99     {
 100         return new LocalClientRequestDispatcherFactory() {
 101             public LocalClientRequestDispatcher create( int id, IOR ior ) {
 102                 return new JIDLLocalCRDImpl( orb, id, ior ) ;
 103             }
 104         } ;
 105     }
 106 
 107     public static LocalClientRequestDispatcherFactory makePOALocalClientRequestDispatcherFactory( final ORB orb )
 108     {
 109         return new LocalClientRequestDispatcherFactory() {
 110             public LocalClientRequestDispatcher create( int id, IOR ior ) {
 111                 return new POALocalCRDImpl( orb, id, ior ) ;
 112             }
 113         } ;
 114     }
 115 }