Hi Raymond,

Comments inline....

Jim

On Feb 28, 2007, at 1:41 PM, Raymond Feng wrote:

Hi,

In the databinding framework, we need to attach some context such as the databinding-specific typing system to a composite. For example, in SDO databinding, we use "import.sdo" to populate SDO types into HelperContext for the given composite and the HelperContext will be used later on for data transformation. What's the best way to achieve this? This is required to get databinding-sdo back to work in trunk again.
There are some options coming into my mind:

1) Maintain a map keyed by the URI of the composite some where in the databding-sdo code? (I guess we need to register a "RuntimeEventListener" to listen on "ComponentEvent" so that we can respond to the composite lifecycle.)

2) Get the ScopeContainer for the composite, and register a SystemSingletonAtomicComponent which wraps the composite-scoped HelperContext?

Any suggestion will be appreciated.

Ultimately, we probably need to think about this in the context of distribution, the contribution mechanism, and artifact provisioning to nodes. In the meantime, to get this working, I would do the following:

Create a loader that autowires ComponentManager (remember to use @Reference and set autowire="true" in the extension SCDL). The loader will have access to the component URI through the deployment context. Create a wrapper for the HelperContext that implements Component and register it with ComponentManager.registerJavaObject(URI uri, ServiceContract<S> service, I instance) (you can also use the overloaded method to register multiple contract types for autowiring). When the composite stops, the Component should be notified. I don't think you need to have implementation instances or deal with ScopeContainers for this.

Let me know if you need any help getting this to work.

Jim



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to