One of the things that is changing in the spec is the way in which
user code outside SCA can access SCA resources. The CompositeContext
and CurrentCompositeContext classes have been replaced with
ComponentContext. You can see a prototype of this in the spec/sca-api-
r1.0 module.
This has a direct impact on user code including all our samples and
SCATestCase. The old way using CurrentCompositeContext is no longer
available and so we need to define alternatives.
There are many ways in which a Tuscany runtime can be started,
including:
* from application code, using an installed distribution
* from a Maven plugin like the itest one
* using a command line wrapper like the launcher and startServer
commands
* in a web-application using a ServletContextListener
and so forth.
For the web-app case, I think the easiest solution for users is to
automatically make the ComponentContext, Property values, and
References available as ServletContext attributes. They would supply
the URI for a component whose implementation type is <tuscany:webapp>
as a context parameter and the listener would do the rest.
Application code (servlets and jsps) would typically get properties
and references from the servlet context.
The same could be used for the launcher. Instead of passing in a jar
file on the command line, the would supply the URI for a component
whose implementation is <tuscany:launched> which would reference a
class that implemented Runnable. The launcher would boot the runtime
and invoke the component's run() method.
The itest plugin would need a harness composite defined which would
either <include> the composite-under-test or use it to implement a
component. The harness composite would also contain a component whose
references would target services from the composite-under-test. We
can use a implementation of <tuscany:junit> to define the test class
and introspection to run the tests it contains (probably through
surefire); this can automatically inject property and reference
values into the TestCase instance.
For API code we can add
ComponentContext getComponentContext(URI componentId)
}
to the TuscanyRuntime interface. Code that is using an installed
standalone distribution can use the helpers in
o.a.t.runtime.standalone to instantiate a StandaloneRuntime and from
that get the ComponentContext for a component.
--
Jeremy
On Feb 6, 2007, at 7:46 AM, Venkata Krishnan wrote:
Hi Jeremy, Jim, Meeraj,
I assume that runtime/standalone/assembly is going to be the way a SCA
Runtime will be started. Is this right?
Is there any test or sample in the trunk that can be used to
understand how
to program a sca client for example things like how to get hold of a
ComponentContext and use methods over it. Could you please help
with some
pointers?
Thanks
- Venkat
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]