/**
 * @file Container_Base.idl
 * @author William R. Otte <wotte@dre.vanderbilt.edu>
 * $Id: Container_Base.idl 84406 2009-02-11 14:59:08Z wotte $
 * Container local interface.
 */

#include "tao/PortableServer/PortableServer_include.pidl"
#include "ccm/CCM_Home.idl"
#include "ciao/Containers/CIAO_Servant_Activator.idl"

module CIAO
{
  module Container_Types
  {
    enum OA_Type
    {
      COMPONENT_t,
      HOME_t,
      FACET_CONSUMER_t
    };
  };
  
  exception InvalidComponent
  {  
  };
  
  /**
   * @interface Container
   * @brief Internal container interfaces. 
   *
   * This interface provides interfactes to two portions of the CIAO
   * container architecture:  The generic external container interface 
   * created by the component server, and the component specific container
   * portions generated by the CIDL compiler (the component servant)
   */
  local interface Container 
  {
    CORBA::PolicyList get_receptacle_policy (in string name);
    // **** Methods used by external container
    Components::CCMHome install_home (in string primary_artifact,
                                      in string entry_point,
                                      in string servant_artifact,
                                      in string servant_entrypoint,
                                      in string name);
    
    void uninstall_home (in Components::CCMHome homeptr);
    
    Components::CCMObject install_component (in string primary_artifact,
                                             in string entry_point,
                                             in string servant_artifact,
                                             in string servant_entrypoint,
                                             in string name);
    
    void activate_component (in Components::CCMObject name);
    
    void passivate_component (in Components::CCMObject name);
    
    void uninstall_component (in Components::CCMObject compptr);
    
    // *** Methods used by component specific container portions
    Object install_servant (in PortableServer::Servant svnt, 
                            in Container_Types::OA_Type type,
                            out PortableServer::ObjectId oid);
    
    void uninstall_servant (in PortableServer::Servant compptr, 
                            in Container_Types::OA_Type type,
                            out PortableServer::ObjectId oid);
    
    Servant_Activator ports_servant_activator ();
    
    Object generate_reference (in string obj_id,
                               in string repo_id,
                               in Container_Types::OA_Type type);
    
    Object get_objref (in PortableServer::Servant p);
    
    PortableServer::POA the_POA ();
    
    PortableServer::POA the_port_POA ();
  };
};
