Hi,

A few more points to make:

1) There are a set of built-in phases defined in org.apache.tuscany.sca.invocation.Phase. You can just use them unless they don't fit your needs. 2) Tuscany supports declarative approach to add interceptors via ProviderFactoryExtensionPoint. You can implement PolicyProviderFactory and register it using META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory file. See tuscany-policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory.

We can also add a new extension point if we see such needs to add cross-cutting interceptors in a more general way than policies. If you can share some of the usage scenarios, it will be helpful for us to come up a good plug point.

Thanks,
Raymond
--------------------------------------------------
From: "Smith, Alfred" <[email protected]>
Sent: Friday, September 04, 2009 10:57 AM
To: "Raymond Feng" <[email protected]>
Subject: RE: Adding phase-based ordering support for invokers/interceptors in the InvocationChain

Thank you very much!

Coming from a Spring background I was expecting it to be a simple XML
configuration, that used on AOP.  Tuscany interceptors seem more
complex, but maybe it's because I'm a newbie on a deadline.  I'll dive
into information you provided and see what I can make happen!

Once again, thanks for your TIME!

Cheers,
Al

-----Original Message-----
From: Raymond Feng [mailto:[email protected]]
Sent: Friday, September 04, 2009 10:46 AM
To: Smith, Alfred
Subject: Re: Adding phase-based ordering support for
invokers/interceptors in the InvocationChain

Hi,

Adding an interceptor to the invocation chain at certain phase is
considered
as a task to extend Tuscany. There are two steps involved.

1) Defining a new phase. You can add an extension module and declare the

phases in the file named as
META-INF/services/org.apache.tuscany.sca.invocation.Phase. An example
can be
found at
/tuscany-core/src/test/resources/META-INF/services/org.apache.tuscany.sc
a.invocation.PhaseTest.

2) Adding the interceptor to the invocation chain at the given phase.
You
use the
org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint or
org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint to add
your
interceptors.

An example:
org.apache.tuscany.sca.core.databinding.wire.DataBindingRuntimeWireProce
ssor.

This processor is registered using a module activator:
org.apache.tuscany.sca.core.databinding.module.DataBindingModuleActivato
r

Thanks,
Raymond

From: Smith, Alfred
Sent: Friday, September 04, 2009 10:06 AM
To: [email protected]
Subject: Adding phase-based ordering support for invokers/interceptors
in
the InvocationChain


Hello Raymond,

I came across your posting about adding invokers and interceptors to
SCA/Tuscany InvocationChain which is something I'm trying to accomplish
right now.  Unfortunately, the only examples I've located are box
diagrams,
but no real composite examples.  If you could provide me with a simple
code
snippet of how to configure an invoker/interceptor into the
InvocationChain
I'd really appreciate it.

Cheers,
Al

Reply via email to