Information
We are currently investigating an issue with the editor of some pages. Please save your work and avoid to create new pages until this banner is gone.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
... <e Name="CPP_HELLO_COMP" Code="HelloComponentImpl" Type="IDL:acsws/workshop/HelloComponent:1.0" Container="bilboContainer" ImplLang="cpp"/> <e Name="JAVA_HELLO_COMP" Code="acsws.workshop.HelloComponentImpl.HelloComponentComponentHelper" Type="IDL:acsws/workshop/HelloComponent:1.0" Container="frodoContainer" ImplLang="java"/> <e Name="PY_HELLO_COMP" Code="workshopws.HelloComponentImpl" Type="IDL:acsws/workshop/HelloComponent:1.0" Container="aragornContainer" ImplLang="py"/> ... |
...
Code Block |
---|
> getTemplateForDirectory MODROOT_WS pyHelloComp > cd pyHelloComp/src > mkdir workshop ws > touch ws/__init__.py > touch workshopws/HelloComponentImpl.py |
We modify the Makefile for this component:
Code Block | ||
---|---|---|
| ||
... PY_PACKAGEPACKAGES = workshopws ... |
We fill the component code as follows:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#Client stubs and definitions, such as structs, enums, etc. import workshop #Skeleton infrastructure for server implementation import workshop__POA #Base component implementation from Acspy.Servants.ACSComponent import ACSComponent #Services provided by the container to the component from Acspy.Servants.ContainerServices import ContainerServices #Basic component lifecycle (initialize, execute, cleanUp and aboutToAbort methods) from Acspy.Servants.ComponentLifecycle import ComponentLifecycle class HelloComponentImpl(<Module>workshop__POA.HelloComponent, ACSComponent, ContainerServices, ComponentLifecycle): def __init__(self): ACSComponent.__init__(self) ContainerServices.__init__(self) self._logger = self.getLogger() def printHello(self): print("Just printing 'Hello World!'") |
...