• No results found

Figure 21: Tinfi runtime platform

content

content content

Tinfi Runtime Platform

a client), composite (a component instance per containing top-level component). The sca-content- controller is in charge of managing the SCA component instances according to these policies. This control interface is used internally by the interceptors and is not meant to be manipulated by some peer components or controllers of the platform. The following methods are available with this interface:

● Object getFcContent() throws InstantiationException: Returns a content instance according to the scope policy defined for this component. Throws InstantiationException if the content can not be instantiated.

● void releaseFcContent( Object content, boolean isEndMethod ): Notifies the content controller that the specified content instance is no longer needed. If relevant with the scope policy, this gives the opportunity to the controller to call the @Destroy annotated method on the content instance.

Content is the content instance which is released. IsEndMethod values to true if the method which releases the content instance is annotated with @EndsConversation.

● Stack<RequestContext> getRequestContextStack(): Returns the thread-local stack of

request contexts.

● void setRequestContextStack( Stack<RequestContext> stack ): Sets the thread-local stack of request contexts.

● void eagerInit() throws InstantiationException: Eager initializes the content instance associated with this component. Relevant only for composite-scoped components. Throws

InstantiationException if the content can not be instantiated.

● sca-property-controller

This control interface manages the properties of an SCA component. The following methods are available with this interface:

● void set( String name, Object value ): Sets the value for the specified property name. If the property has already been set, the old value is lost, and the new value is recorded.

● Object get( String name ): Returns the value for the specified property name. Return null if the property has not been set.

● boolean containsKey( String name ): Returns true if the specified property name has been set.

● Map<String,Object> getAll() : Returns all property names and values.

● void setPromoter( String name, SCAPropertyController promoter ): Sets the reference of the property controller which promotes the specified property to the current property controller.

● SCAPropertyController setPromoter( String name ): Returns the reference of the property controller which promotes the specified property. Returns null if the property is managed locally by the current property controller.

● sca-intent-controller

This control interface manages the intent handlers associated with an SCA component. The following methods are available with this interface:

● void addFcIntentHandler( IntentHandler handler ): Adds the specified intent handler on all service and reference methods of the current component.

● IntentHandler[] listFcIntentHandler(): Returns the list of intent handlers associated with the current component.

● void removeFcIntentHandler( IntentHandler handler ): Removes the specified intent handler from the current component.

The five remaining control interfaces are Fractal/Julia standard interfaces [6].

● binding-controller: Manages the binding between the services required by the component and the services provided by peer components. The following methods are provided:

○ String[] listFc(): Returns the list client interface names associated with this component.

○ void bindFc( String name, Object dst): Binds the dst server interface to the name client interface.

○ Object lookupFc( String name ): Returns the server interface bounds to the name client interface.

○ void removeFc( String name ): Removes the binding for the name client interface.

● lifecycle-controller: Manages the life cycle of the component. The following methods are provided:

○ void startFc(): Starts the component.

○ void stopFc(): Stops the component.

● component: Manages the Fractal identity and the structure of the component. The following methods are

provided:

○ Object getFcInterface( String name ): Returns the interface named name.

○ Object[] getFcInterfaces(): Returns the array of interfaces belonging to the current component.

○ Type getFcType(): Returns the type of the current component.

● super-controller: Manages the component hierarchy by allowing to navigate in parent components. The following methods are provided:

○ Component[] getFcSuperComponents(): Returns the array of super components.

● name-controller: Manages the name of the component. The following methods are provided: ○ String getFcName(): Returns the name of the current component.

○ void setFcName( String name ): Sets the name of the current component.

Nine control interfaces are associated to a scaComposite component. The three four interfaces are specific to

scaComposite components: sca-component-controller, sca-property-controller and sca-intent- controller. These interfaces are the same than the one described previously. The remaining six control interfaces are standard Fractal/Julia interfaces for composite components: binding-controller, lifecycle-controller,

component, super-controller, name-controller and content-controller (the first five are the same than the ones described previously and content-controller manages the subcomponents inserted into the composite). The content-controller control interface provides the following methods:

○ void addFcSubComponent( Component component ): Adds the specified subcomponent. ○ Component[] getFcSubComponents(): Returns the array of subcomponents.

○ void removeFcSubComponent( Component component ): Removes the specified subcomponent.

○ Object getFcInternalInterface( String name ): Returns the internal interface named name.

○ Object[] getFcInternalInterfaces(): Returns the array of internal interfaces.

The fact that scaPrimitive (resp. scaComposite) components provide both some control interfaces which are specific to SCA and some which are standard to Fractal means that scaPrimitive (resp. scaComposite) components are both SCA and Fractal compliant. In other terms, a scaPrimitive (resp. scaComposite) can be assembled with other regular (non-SCA) Fractal components, while keeping its dual SCA personality.

d) Tinfi controller implementations

As mentioned previously, a control interface is implemented by a controller. Among the eight above mentioned control interfaces, five own an implementation which is specific to Tinfi: sca-component-controller, sca-content- controller, sca-property-controller, binding-controller and lifecycle-controller. For the three

other control interfaces (component, super-controller and name-controller), the standard Fractal/Julia controllers are reused.

control semantics specified by the SCA model is not implemented by nine isolated entities but is the result of the cooperation of these entities. They define some provided and some required services which are wired together. They form the architecture of the Tinfi platform.

By the same way, the nine controllers of a Tinfi scaComposite membrane are assembled together as illustrated in

Figure 23.

e) Tinfi interceptors

As mentioned previously, a control membrane is composed of controllers and interceptors (interceptors are not mandatory). Three interceptor types are defined by the Tinfi platform.

● lifecycle-interceptor: This is the standard Fractal/Julia interceptor. Its role is to apply the life cycle

policy onto business interfaces. More precisely, this interceptor blocks operation invocations of a stopped component and releases them once the component is started. The purpose is thus to ensure that a software