On Tue, Mar 10, 2009 at 4:11 PM, Sacauskis, Mike <[email protected]> wrote: > From an earlier post I was told: > > > > Let's consider the policy-logging as an example here.When you provide a new > itent (in your module definitions.xml), > > > > <intent name="logging" constrains="sca:implementation.java > sca:implementation.spring"> > > <description> > > All messages to and from this implementation must be > logged > > </description> > > </intent> > > > > You then use the LoggingPolicyDefinitionsProvider (registering it via > META-INF\services\org.apache.tuscany.sca.provider.SCADefinitionsProvider) > > to parse the definitions.xml and provide your intent using SCADefinitions > model class. > > > > What exactly do you mean registering it via > META-INF\service\org.apache.tuscany.sca.provider.SCADefinitionsProvider. > That file exists with entries in it already. Do I need to add my policy to > that file?
If you are using policy-logging, all the work has already been done for you in order to contribute the intents, processors, etc to the runtime. >That file seems to be a composite of several > SCADefinitionsProider. In the case of /tuscany-policy-logging/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider has the implementation class (org.apache.tuscany.sca.policy.logging.LoggingPolicyDefinitionsProvider) that will be used to provide the policy logging intents to the tuscany runtime (this is using service discover pattern). The actual LoggingPolicyDefinitionsProvider implementation only parses /tuscany-policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml >If so that begs the question, do I need to rebuild > Tuscany to include my policy or is there a dynamic way to register my > policy? > Not really, you could just add your policy to the Tuscany classpath (e.g in a Tuscany Distribution, add your policy jar to the modules) and the runtime will use the Tuscany extensibility story to contribute any necessary artifacts to the runtime. > If you are creating your own policy, you will need to follow the policy-logging as an example to contribute your intents, processors, etc to the runtime. > > > > Mike Sacauskis > > -- Luciano Resende Apache Tuscany, Apache PhotArk http://people.apache.org/~lresende http://lresende.blogspot.com/
