home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / win32 / medianet / server / include / yoboa.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-18  |  8.1 KB  |  208 lines

  1. /* Copyright (c) 1995 by Oracle Corporation.  All Rights Reserved.
  2.  *
  3.  * boa.h - Oracle BOA compatiblity layer
  4.  */
  5.  
  6. #ifndef YOBOA_ORACLE
  7. #define YOBOA_ORACLE
  8.  
  9. #ifndef YOORB_ORACLE
  10. #include <yoorb.h>
  11. #endif
  12. #ifndef YOCOA_ORACLE
  13. #include <yocoa.h>
  14. #endif
  15.  
  16. EXTC_START
  17.  
  18. typedef CORBA_Object CORBA_BOA;
  19.  
  20. /*
  21.  * CORBA_BOA_create - create an object
  22.  *
  23.  * DESCRIPTION
  24.  * CORBA_BOA_create() creates an object.  intf and impl together must define
  25.  * an implementation previously specified with ORA_CORBA_BOA_set_impl().  An
  26.  * object reference to the created object is returned.
  27.  *
  28.  * id is a pointer to reference data whose type is sequence<octet>.
  29.  * The id is immutable identification information, chosen by the
  30.  * implementation at object creation time and never changed.  The
  31.  * usage of the id is entirely implementation-defined.  Two objects
  32.  * created with the same id are not the same object as far as the
  33.  * object layer is concerned.  For implementations with loaders,
  34.  * the reference data is made available to the loader to allow
  35.  * the object to be reactivated.  In other words, it persists past
  36.  * the activation (unlike the state).  The id may be null.  If id is
  37.  * non-null, the value is copied into the reference returned.
  38.  */
  39. CORBA_Object CORBA_BOA_create(CORBA_BOA boa, CORBA_Environment *ev,
  40.                          CORBA_ReferenceData *id, CORBA_InterfaceDef intf,
  41.                          CORBA_ImplementationDef impl);
  42. /*
  43.  * CORBA_BOA_dispose - destroy an object
  44.  *
  45.  * DESCRIPTION
  46.  * CORBA_BOA_dispose() destroys an object.  This may be used even if there
  47.  * are still outstanding references to the object.  These references will
  48.  * no longer be valid.
  49.  */
  50. void CORBA_BOA_dispose(CORBA_BOA boa, CORBA_Environment *ev, CORBA_Object obj);
  51.  
  52. /*
  53.  * CORBA_BOA_get_id - reference data from an object
  54.  *
  55.  * DESCRIPTION
  56.  * Returns a copy of the reference data associated with the specified object.
  57.  * ORA_CORBA_BOA_free_id() should be used to free the reference data returned.
  58.  */
  59. CORBA_ReferenceData *CORBA_BOA_get_id(CORBA_BOA boa, CORBA_Environment *ev,
  60.                                       CORBA_Object obj);
  61. /*
  62.  * CORBA_BOA_set_exception - set exception
  63.  *
  64.  * DESCRIPTION
  65.  * Places the excpetion described by major, userid, and param into the
  66.  * environment, ev.  Major specifies the type of the exception.  userid
  67.  * specifies the exception id which is returned via CORBA_exception_id().
  68.  * param specifies the value returned via CORBA_exception_value().
  69.  */
  70. void CORBA_BOA_set_exception(CORBA_BOA boa, CORBA_Environment *ev,
  71.                              CORBA_exception_type major, CORBA_char *userid,
  72.                              void *param);
  73. /*
  74.  * CORBA_BOA_impl_is_ready - implemenation ready
  75.  *
  76.  * DESCRIPTION
  77.  * CORBA_BOA_impl_is_ready() notifies the ORB that all interfaces with the
  78.  * specified impl are ready to process requests.
  79.  */
  80. void CORBA_BOA_impl_is_ready(CORBA_BOA boa, CORBA_Environment *ev,
  81.                              CORBA_ImplementationDef impl);
  82. /*
  83.  * CORBA_BOA_deactivate_impl - implementation deactivate
  84.  *
  85.  * DESCRIPTION
  86.  * CORBA_BOA_deactivate_impl() notifies the ORB that the specified impl is 
  87.  * no longer available to process requests.
  88.  */
  89. void CORBA_BOA_deactivate_impl(CORBA_BOA boa, CORBA_Environment *ev,
  90.                                CORBA_ImplementationDef impl);
  91.  
  92. /* BOA extensions */
  93.  
  94. /* 
  95.  * ORA_CORBA_ORB_BOA_init - init & term BOA
  96.  *
  97.  * DESCRIPTION
  98.  * ORA_CORBA_ORB_BOA_init() inits the BOA and returns a CORBA_BOA object
  99.  * reference for use with all of the interfaces described in this interface
  100.  * file.
  101.  * ORA_CORBA_ORB_BOA_term() terminates the BOA.
  102.  */
  103. CORBA_BOA ORA_CORBA_ORB_BOA_init(void);
  104. void ORA_CORBA_ORB_BOA_term(CORBA_BOA boa, CORBA_Environment *ev);
  105.  
  106. /*
  107.  * ORA_CORBA_BOA_set_impl - define an implementation
  108.  *
  109.  * DESCRIPTION
  110.  * ORA_CORBA_BOA_set_impl() binds an interface to its implementation.
  111.  * The interface is identified by its CORBA_InterfaceDef object reference
  112.  * generated by calling ORA_CORBA_IdToIntfDef with the IDL compiler with the
  113.  * name <interface>__id.  The implementation is identified by its
  114.  * CORBA_ImplementationDef. If no implementation id is specified,
  115.  * the program name is used (taken from ysProgName()) to create the
  116.  * CORBA_ImplementationDef.
  117.  *
  118.  * An implementation consists of a set of stubs, an implementation
  119.  * dispatch vector, an object adapter, and optionally, a object loader.
  120.  * The elements are explained as follows:
  121.  *
  122.  * stubs is a null-terminated array of server-side stub routines that
  123.  * will be invoked when a request arrives.  These are the skeletons
  124.  * that perform the unmarshalling of the request, make the upcall,
  125.  * and then marshal the results.  The server-side stub routines are
  126.  * generated by the IDL compiler which also generates an array
  127.  * named <interface>__stubs for use here.  Note that the stubs are
  128.  * specific to the interface, not the implementation, and
  129.  * so the same set of stubs may be used for several different
  130.  * implementations to the same interface.
  131.  *
  132.  * The impldef is a structure whose fields point to the actual routines
  133.  * that implement the operations.  The type of the structure is generated
  134.  * by the IDL Compiler as is a default initialization for the structure.
  135.  * This may be modified as necessary to bind different routines to the
  136.  * operation names.  The name of the structure generated is
  137.  * <interface>__impl.
  138.  *
  139.  * loader is the name of the loader function that is to be used during
  140.  * object activation and deactivation of persistent objects.  If no
  141.  * loader is provided, then objects for this implementation must be
  142.  * created during execution and cannot live longer than the process itself.
  143.  *
  144.  * state is a pointer to some optional state information which may be
  145.  * associated with a particular implementation.
  146.  *
  147.  * stateless is a boolean which indicates if the implementation is stateless.
  148.  * If an implementation is stateless, the ORBD will be notified of the
  149.  * existance of the implemenation.  Calling yoGetState() or yoSetState()
  150.  * with a stateless object reference will result in an exception.
  151.  */
  152.  
  153. void ORA_CORBA_BOA_set_impl(CORBA_BOA boa, CORBA_Environment *ev,
  154.                             CORBA_InterfaceDef intf,
  155.                             CORBA_ImplementationDef impl, yostub *stubs,
  156.                             void *impldef, yoload loader, boolean stateless,
  157.                             void *state);
  158. /*
  159.  * ORA_CORBA_BOA_set_state, get_state - set & get in-memory state
  160.  *
  161.  * DESCRIPTION
  162.  * Associated with each activated object is some in-memory state.
  163.  * These routines allow a pointer to this state to be retrieved
  164.  * from and set into the object reference.
  165.  */
  166. void ORA_CORBA_BOA_set_state(CORBA_BOA boa, CORBA_Environment *ev,
  167.                              CORBA_Object obj, void *state);
  168. void *ORA_CORBA_BOA_get_state(CORBA_BOA boa, CORBA_Environment *ev,
  169.                               CORBA_Object obj);
  170. /*
  171.  * ORA_CORBA_BOA_get_impl_state - get implementation state
  172.  *
  173.  * DESCRIPTION
  174.  * This routine allows the implementation state information to be retrieved
  175.  * from the object reference.
  176.  */
  177. void *ORA_CORBA_BOA_get_impl_state(CORBA_BOA boa, CORBA_Environment *ev,
  178.                                    CORBA_Object obj);
  179. /*
  180.  * ORA_CORBA_BOA_service, shutdown - begin & end service
  181.  *
  182.  * DESCRIPTION
  183.  * ORA_CORBA_BOA_service() begins servicing incoming implementation/object
  184.  * requests. ORA_CORBA_BOA_service blocks until ORA_CORBA_BOA_shutdown() is
  185.  * called.
  186.  *
  187.  * ORA_CORBA_BOA_shutdown() is used to terminate service started with
  188.  * ORA_CORBA_BOA_service().  All unprocessed requests are rejected and no new
  189.  * ones will be accepted.
  190.  */
  191.  
  192. void ORA_CORBA_BOA_service(CORBA_BOA boa, CORBA_Environment *ev);
  193. void ORA_CORBA_BOA_shutdown(CORBA_BOA boa, CORBA_Environment *ev);
  194.  
  195. /*
  196.  * ORA_CORBA_BOA_free_id - free refdata
  197.  *
  198.  * DESCRIPTION
  199.  * ORA_CORBA_BOA_free_id() frees the CORBA_ReferenceData storage returned by
  200.  * CORBA_BOA_get_id().
  201.  */
  202.  
  203. void ORA_CORBA_BOA_free_id(CORBA_BOA boa, CORBA_Environment *ev,
  204.                            CORBA_ReferenceData *id);
  205. EXTC_END
  206. #endif /* YOBOA_ORACLE */
  207.  
  208.