Hi Matthew,
Comments inline...
Jim
On Nov 14, 2006, at 4:12 PM, Matthieu Riou wrote:
Hi,
I have a better and better idea on how Apache Ode could be used as
a Tuscany
container. However I'm still wondering how I can get hold on some
resources
in Tuscany. To run Ode's BPEL engine we need basic services like a
transaction manager, a datasource or a thread scheduler (
java.util.concurrent.ExecutorService).
You can do this one of two ways, either by autowiring (@Autowire) or
through resource injection (@Resource). Autowiring right now is
pretty basic as in:
@Autowire
public void setSomething(Something something);
This will tell the runtime to inject your component with an
implementation of the interface Something. We are planning on
enhancing this by providing the ability to specify parameters and
intents but I think this should be sufficient for what you need.
Specifically, in the runtime, work is dispatched using a
WorkScheduler. If you extend from ComponentBuilderExtension you get
one for free (it uses autowiring to obtain one from the runtime).
Otherwise, you need to do the following:
@Autowire
public void setScheduler(WorkScheduler scheduler)
This will also work on constructors as well:
@Constructor
public MyConstructor(@Autowire WorkScheduler scheduler)
In a managed environment, WorkScheduler will be a wrapper around some
scheduling mechanism provided by the host.
For resources such as DataSource you can use @Resource in the same
manner. W have started implementing support for this as described
here: http://wiki.apache.org/ws/Tuscany/SpecProposals/Resources. In
order to get at data sources, you will need to configure the
datasource extension located under /persistence. This can use DBCP or
another provider.
A JTA TransactionManager should be accessible in the same way -
through @Resource. This means we will need to provide transactional
infrastructure in cases where we do not run on a host that has a JTA
implementation. We don't have a JTA implementation integrated yet but
Jeremy was going to look into seeing if we can separate out the
Geronimo transaction manager for this purpose (right now it seems to
drag in a bunch of other Geronimo dependencies). In doing so, we will
need to also be able to enlist DataSource resources in transactions.
I'm happy to help out so the best way to proceed is to probably
start asking more questions and I will try to answer them as best I can.
How could these be provided to the BPEL container? Do you already have
something for this? Or should we assume that we're running in a
managed
environment (i.e. Geronimo) and lookup these things ourselves?
Just to reiterate what I mentioned above, I wouldn't assume Tuscany
would be deployed in a managed environment. If you use @Autowire and
@Resource Tuscany will handle the portability issues.
Thanks,
Matthieu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]