else
{
Py_ACQUIRE_NEW_THREAD;
- PyObject *mainmod = PyImport_AddModule("__main__");
+ PyObject *mainmod = PyImport_AddModule((char *)"__main__");
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- "import_component",
- "s",componentName);
+ (char*)"import_component",
+ (char*)"s",componentName);
int ret= PyInt_AsLong(result);
SCRUTE(ret);
Py_RELEASE_NEW_THREAD;
_containerName + "/" + instanceName;
Py_ACQUIRE_NEW_THREAD;
- PyObject *mainmod = PyImport_AddModule("__main__");
+ PyObject *mainmod = PyImport_AddModule((char*)"__main__");
PyObject *globals = PyModule_GetDict(mainmod);
PyObject *pyCont = PyDict_GetItemString(globals, "pyCont");
PyObject *result = PyObject_CallMethod(pyCont,
- "create_component_instance",
- "ssl",
+ (char*)"create_component_instance",
+ (char*)"ssl",
aCompName.c_str(),
instanceName.c_str(),
studyId);
return iobject._retn();
}
+ return Engines::Component::_nil() ;
}
Engines::Component_ptr
{
thread_st *st = (thread_st*)s;
(Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->load_component_Library(st->compoName.c_str());
+ return NULL;
}
void *th_createcomponentinstance(void *s)
{
thread_st *st = (thread_st*)s;
(Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->create_component_instance(st->compoName.c_str(),st->studyId);
+ return NULL;
}
void *th_loadimpl(void *s)
{
thread_st *st = (thread_st*)s;
(Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->load_impl(st->nameToRegister.c_str(),st->compoName.c_str());
+ return NULL;
}
void *th_removeimpl(void *s)
{
thread_st *st = (thread_st*)s;
(Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->remove_impl(st->cptr);
+ return NULL;
}
void *th_finalizeremoval(void *s)
{
thread_st *st = (thread_st*)s;
(Engines::MPIContainer::_narrow((*(st->tior))[st->ip]))->finalize_removal();
+ return NULL;
}
-
int main(int argc, char* argv[])
{
int nbproc, numproc;
- Engines_MPIContainer_i * myContainer=NULL;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&nbproc);
// obtain the root poa manager
PortableServer::POAManager_var pman = root_poa->the_POAManager();
- // define policy objects
- PortableServer::ImplicitActivationPolicy_var implicitActivation =
- root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION) ;
-
- // default = NO_IMPLICIT_ACTIVATION
- PortableServer::ThreadPolicy_var threadPolicy =
- root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL) ;
- // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
-
- // create policy list
- CORBA::PolicyList policyList;
- policyList.length(2);
- policyList[0] = PortableServer::ImplicitActivationPolicy::_duplicate(implicitActivation) ;
- policyList[1] = PortableServer::ThreadPolicy::_duplicate(threadPolicy) ;
-
- // create the child POA
- PortableServer::POAManager_var nil_mgr = PortableServer::POAManager::_nil() ;
- PortableServer::POA_var factory_poa =
- root_poa->create_POA("factory_poa", pman, policyList) ;
- //with nil_mgr instead of pman, a new POA manager is created with the new POA
-
- // destroy policy objects
- implicitActivation->destroy() ;
- threadPolicy->destroy() ;
-
- char *containerName = "";
+ char *containerName = (char *)"";
if (argc >1)
{
containerName = argv[1] ;
}
MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant");
- new Engines_MPIContainer_i(nbproc,numproc,orb,factory_poa, containerName,argc,argv);
+ new Engines_MPIContainer_i(nbproc,numproc,orb,root_poa, containerName,argc,argv);
pman->activate();