1 /*
   2  * Copyright (c) 2002, 2012, 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 java.util.Set;
  29 
  30 import com.sun.corba.se.pept.protocol.ClientRequestDispatcher ;
  31 import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
  32 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
  33 
  34 import com.sun.corba.se.spi.oa.ObjectAdapterFactory ;
  35 
  36 /**
  37  * This is a registry of all subcontract ID dependent objects.  This includes:
  38  * LocalClientRequestDispatcherFactory, ClientRequestDispatcher, ServerRequestDispatcher, and
  39  * ObjectAdapterFactory.
  40  */
  41 public interface RequestDispatcherRegistry {
  42 
  43     /** Register a ClientRequestDispatcher for a particular subcontract ID.
  44      * The subcontract ID appears in the ObjectKey of an object reference, and is used
  45      * to control how a remote method invocation is processed by the ORB for a
  46      * particular kind of object reference.
  47      */
  48     void registerClientRequestDispatcher( ClientRequestDispatcher csc, int scid) ;
  49 
  50     /** Get the ClientRequestDispatcher for subcontract ID scid.
  51      */
  52     ClientRequestDispatcher getClientRequestDispatcher( int scid ) ;
  53 
  54     /** Register a LocalClientRequestDispatcher for a particular subcontract ID.
  55      * The subcontract ID appears in the ObjectKey of an object reference, and is used
  56      * to control how a particular kind of colocated request is processed.
  57      */
  58     void registerLocalClientRequestDispatcherFactory( LocalClientRequestDispatcherFactory csc, int scid) ;
  59 
  60     /** Get the LocalClientRequestDispatcher for subcontract ID scid.
  61      */
  62     LocalClientRequestDispatcherFactory getLocalClientRequestDispatcherFactory( int scid ) ;
  63 
  64     /** Register a CorbaServerRequestDispatcher for a particular subcontract ID.
  65      * The subcontract ID appears in the ObjectKey of an object reference, and is used
  66      * to control how a particular kind of request is processed when received by the ORB.
  67      */
  68     void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, int scid) ;
  69 
  70     /** Get the CorbaServerRequestDispatcher for subcontract ID scid.
  71      */
  72     CorbaServerRequestDispatcher getServerRequestDispatcher(int scid) ;
  73 
  74     /** Register a CorbaServerRequestDispatcher for handling an explicit object key name.
  75      * This is used for non-standard invocations such as INS and the bootstrap name service.
  76      */
  77     void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, String name ) ;
  78 
  79     /** Get the CorbaServerRequestDispatcher for a particular object key.
  80      */
  81     CorbaServerRequestDispatcher getServerRequestDispatcher( String name ) ;
  82 
  83     /** Register an ObjectAdapterFactory for a particular subcontract ID.
  84      * This controls how Object references are created and managed.
  85      */
  86     void registerObjectAdapterFactory( ObjectAdapterFactory oaf, int scid) ;
  87 
  88     /** Get the ObjectAdapterFactory for a particular subcontract ID scid.
  89      */
  90     ObjectAdapterFactory getObjectAdapterFactory( int scid ) ;
  91 
  92     /** Return the set of all ObjectAdapterFactory instances that are registered.
  93      */
  94     Set<ObjectAdapterFactory> getObjectAdapterFactories();
  95 }