SALOME documentation central

SALOME_LifeCycleCORBA Class Reference

A class to manage life cycle of SALOME components. More...

Public Member Functions

 SALOME_LifeCycleCORBA (SALOME_NamingService *ns=0)
virtual ~SALOME_LifeCycleCORBA ()
Engines::Component_ptr FindComponent (const Engines::MachineParameters &params, const char *componentName, int studyId=0)
 Find an already existing and registered component instance.
Engines::Component_ptr LoadComponent (const Engines::MachineParameters &params, const char *componentName, int studyId=0)
 Load a component instance on a container defined by machine parameters.
Engines::Component_ptr FindOrLoad_Component (const Engines::MachineParameters &params, const char *componentName, int studyId=0)
 Find an already existing and registered component instance or load a new component instance on a container defined by machine parameters.
Engines::Component_ptr FindOrLoad_Component (const char *containerName, const char *componentName)
 Find an already existing and registered component instance or load a new component instance on a container defined by name.
Engines::Component_ptr Load_ParallelComponent (const Engines::MachineParameters &params, const char *componentName, int studyId)
 Load a parallel component instance.
bool isKnownComponentClass (const char *componentName)
 Check if the component class is known in module catalog.
bool isMpiContainer (const Engines::MachineParameters &params) throw (IncompatibleComponent)
int NbProc (const Engines::MachineParameters &params)
Engines::ContainerManager_ptr getContainerManager ()
 Get the container manager.
Engines::ResourcesManager_ptr getResourcesManager ()
 Get the resources manager.
SALOME_NamingServicenamingService ()
 get the naming service used by the life cycle
CORBA::ORB_ptr orb ()
 get the orb used by the life cycle
void copyFile (const char *hostSrc, const char *fileSrc, const char *hostDest, const char *fileDest)
 copy a file from a source host to a destination host
void shutdownServers ()
 shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd

Static Public Member Functions

static void preSet (Engines::MachineParameters &outparams)
 Initialisation of a given Engines::MachineParameters with default values.
static void killOmniNames ()
 shutdown omniNames and notifd

Protected Member Functions

Engines::Component_ptr _FindComponent (const Engines::MachineParameters &params, const char *componentName, int studyId, const Engines::MachineList &listOfMachines)
 Find an already existing and registered component instance.
Engines::Component_ptr _LoadComponent (const Engines::MachineParameters &params, const char *componentName, int studyId)
 Load a component instance.

Protected Attributes

SALOME_NamingService_NS
SALOME_NamingService_NSnew
Engines::ContainerManager_var _ContManager
Engines::ResourcesManager_var _ResManager

Detailed Description

A class to manage life cycle of SALOME components.


Constructor & Destructor Documentation

SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA ( SALOME_NamingService ns = 0  ) 

Constructor

SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA (  )  [virtual]

Destructor


Member Function Documentation

Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent ( const Engines::MachineParameters params,
const char *  componentName,
int  studyId = 0 
)

Find an already existing and registered component instance.

Parameters:
params machine parameters like type or name...
componentName the name of component class
studyId default = 0 : multistudy instance
Returns:
a CORBA reference of the component instance, or _nil if not found
Engines::Component_ptr SALOME_LifeCycleCORBA::LoadComponent ( const Engines::MachineParameters params,
const char *  componentName,
int  studyId = 0 
)

Load a component instance on a container defined by machine parameters.

Parameters:
params machine parameters like type or name...
componentName the name of component class
studyId default = 0 : multistudy instance
Returns:
a CORBA reference of the component instance, or _nil if problem
Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component ( const Engines::MachineParameters params,
const char *  componentName,
int  studyId = 0 
)

Find an already existing and registered component instance or load a new component instance on a container defined by machine parameters.

Parameters:
params machine parameters like type or name...
componentName the name of component class
studyId default = 0 : multistudy instance
Returns:
a CORBA reference of the component instance, or _nil if problem
Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component ( const char *  containerName,
const char *  componentName 
)

Find an already existing and registered component instance or load a new component instance on a container defined by name.

Parameters:
containerName the name of container, under one of the forms

  • 1 aContainer (local container)
  • 2 machine/aContainer (container on hostname = machine)
componentName the name of component class
Returns:
a CORBA reference of the component instance, or _nil if problem
Engines::Component_ptr SALOME_LifeCycleCORBA::Load_ParallelComponent ( const Engines::MachineParameters params,
const char *  componentName,
int  studyId 
)

Load a parallel component instance.

Parameters:
params machine parameters like type or name...
componentName the name of component class
studyId default = 0 : multistudy instance
Returns:
a CORBA reference of the parallel component instance, or _nil if problem
bool SALOME_LifeCycleCORBA::isKnownComponentClass ( const char *  componentName  ) 

Check if the component class is known in module catalog.

Parameters:
componentName the name of component class
Returns:
true if found, false otherwise
bool SALOME_LifeCycleCORBA::isMpiContainer ( const Engines::MachineParameters params  )  throw (IncompatibleComponent)

Not so complex... useful ?

int SALOME_LifeCycleCORBA::NbProc ( const Engines::MachineParameters params  ) 
Returns:
a number of processors not 0, only for MPI containers
void SALOME_LifeCycleCORBA::preSet ( Engines::MachineParameters params  )  [static]

Initialisation of a given Engines::MachineParameters with default values.

  • container_name = "" : not relevant
  • hostname = "" : not relevant
  • OS = "" : not relevant
  • mem_mb = 0 : not relevant
  • cpu_clock = 0 : not relevant
  • nb_proc_per_node = 0 : not relevant
  • nb_node = 0 : not relevant
  • isMPI = false : standard components
Engines::ContainerManager_ptr SALOME_LifeCycleCORBA::getContainerManager (  ) 

Get the container manager.

Returns:
the container Manager
Engines::ResourcesManager_ptr SALOME_LifeCycleCORBA::getResourcesManager (  ) 

Get the resources manager.

Returns:
the container Manager
SALOME_NamingService * SALOME_LifeCycleCORBA::namingService (  ) 

get the naming service used by the life cycle

Returns:
the naming service
CORBA::ORB_ptr SALOME_LifeCycleCORBA::orb (  ) 

get the orb used by the life cycle

Returns:
the orb
void SALOME_LifeCycleCORBA::copyFile ( const char *  hostSrc,
const char *  fileSrc,
const char *  hostDest,
const char *  fileDest 
)

copy a file from a source host to a destination host

Parameters:
hostSrc the source host
fileSrc the file to copy from the source host to the destination host
hostDest the destination host
fileDest the destination file
void SALOME_LifeCycleCORBA::shutdownServers (  ) 

shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd

void SALOME_LifeCycleCORBA::killOmniNames (  )  [static]

shutdown omniNames and notifd

Engines::Component_ptr SALOME_LifeCycleCORBA::_FindComponent ( const Engines::MachineParameters params,
const char *  componentName,
int  studyId,
const Engines::MachineList listOfMachines 
) [protected]

Find an already existing and registered component instance.

Establish if a component called "componentName" in a container called "containerName" exists among the list of resources in "listOfMachines". This method uses Naming Service to find the component.

  • build a list of machines on which an instance of the component is running,
  • find the best machine among the list
Parameters:
params machine parameters like type or name...
componentName the name of component class
studyId default = 0 : multistudy instance
listOfMachines list of machine address
Returns:
a CORBA reference of the component instance, or _nil if not found
Engines::Component_ptr SALOME_LifeCycleCORBA::_LoadComponent ( const Engines::MachineParameters params,
const char *  componentName,
int  studyId 
) [protected]

Load a component instance.

  • Finds a container in the list of machine or start one.
  • Try to load the component library in the container,
  • then create an instance of the component.
Parameters:
params machine parameters like type or name...
componentName the name of component class
studyId default = 0 : multistudy instance
Returns:
a CORBA reference of the component instance, or _nil if problem

Copyright © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS