iPOPO Decorators

Component definition

Those decorators describe the component. They must decorate the factory class itself.

Factory definition

The factory definition decorator must be unique per class and must always be the last one executed, i.e. the top one in the source code.

Component properties

Special properties

Note that some properties have a special meaning for iPOPO and Pelix.

Name Type Description
instance.name str The name of the iPOPO component instance
service.id int The registration number of a service
service.ranking int The rank (priority) of the services provided by this component
@ComponentFactory()
@Property('_name', 'instance.name')    # Special property
@Property('_value', 'my.value')        # Some property
@Property('_answer', 'the.answer', 42) # Some property, with a default value
class Foo(object):
   def __init__(self):
       self._name = None    # This will overwritten by iPOPO
       self._value = 12     # 12 will be used if this property is not configured
       self._answer = None  # 42 will be used by default

Provided Services

Requirements

Instance definition

Life-cycle events

Those decorators store behavioural information on component methods. They must decorate methods in the component class.

Component state

When all its requirements are fulfilled, the component goes into the VALID state. During the transition, it is in VALIDATING state and the following decorators indicate which method must be called at that time. If the decorated method raises an exception, the component goes into the ERRONEOUS state.

When one of its requirements is missing, or when it is killed, the component goes into the INVALID state. During the transition, it is in INVALIDATING state and the following decorators indicate which method must be called at that time.

Exceptions raised by the decorated method are ignored.

Injections

Service state