Examples

Package SALOME_ModuleCatalog

      interface SALOME_ModuleCatalog::ModuleCatalog

Package SALOME

   
interface SALOME::Session

Package Engines
   

    interface Engines::Container

   
   


    SALOME_ModuleCatalog::ModuleCatalog interface



Acomponent GetComponent (in string componentname)

See the example below


SALOME::Session interface



GetInterface (), StopSession () raises (GUIActive, RunningStudies)

Stop session and restart GUI application:

mySession.StopSession()

mySession.GetInterface()


Engines::Container interface


EngineComponent load_impl (in string nameToRegister, in string componentName)

Load component with defined component name:

compinfo = module_catalog.GetComponent(componentName)

 try:
    machineName = theComputer # name of machine
    path = compoinfo.GetPathPrefix(machineName) + "/"
 except SALOME_ModuleCatalog.NotFound, ex:
    MESSAGE( "machine " + machineName + " not found in Module Catalog" )
    MESSAGE( "trying localhost" )
    try:
    path = compoinfo.GetPathPrefix("localhost") + "/"
    except SALOME_ModuleCatalog.NotFound, ex:
    path = ""

implementation = path + "lib" + componentName + "Engine.so"
MESSAGE( "Trying to load " + implementation )

 try:
    component = container.load_impl(componentName, implementation) # Loads into the container a new component, registers it and starts it's CORBA servant.
    MESSAGE( "component " + component._get_instanceName() + " launched !" )
    return component
except:
    MESSAGE( "component " + componentName + " NOT launched !" )