Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-3356

Policies are being applied to references even when they have not been attached

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Java-SCA-1.5.1, Java-SCA-1.x
    • None
    • None
    • Windows XP Pro, Java 1.5.0_18, Tuscany SCA Java 1.5.1 & 1.6 SNAPSHOT (r826612)

    Description

      It appears that if a policy is present in the classpath of a composite that the policy will be applied to references even when it has not been attached. I'm not sure if this is a problem with the policy framework, the logging policy implementation classes, or the sample program.

      I've also seen the same thing happen to remote services when the intent was applied to binding.ws on a separate project; the policy implementation classes for that project are using the same kind of logic that's used by the logging policy implementation.

      Steps to reproduce the issue:

      1.) Start by building the calculator-implementation-policies sample:

      cd calculator-implementation-policies
      mvn

      1a.) When the unit tests are executed as part of the build, log entries from the components are displayed as expected. Example:

      Oct 28, 2009 2:16:21 PM component.implementation: AnotherCalculatorServiceComponent(org.apache.tuscany.sca.implementation.java.impl.JavaImplementationImpl)
      FINER: Returning from operation divide with return value 1.5

      2.) Replace the calculator-implementation-policies\src\main\resources\Calculator.composite file with the attached version and run a clean build:

      mvn clean test

      2a.) The modified version of the .composite file removes the intents from the component definitions; this should have the effect of disabling all of the logging. However, when the unit tests are executed, the log entries are still being displayed when the CalculatorServiceComponent is accessed (which is not expected).

      3.) Move the calculator-implementation-policies\src\main\resources\definitions.xml somewhere else so that it's not included in the jar and run a clean build. The output from the unit test does not contain the log entries from the components (just the expected log entries from the node being cycled).

      Attachments

        1. Calculator.composite
          3 kB
          Chad Phillips
        2. step1.out
          16 kB
          Chad Phillips
        3. step2.out
          9 kB
          Chad Phillips
        4. step3.out
          3 kB
          Chad Phillips

        Activity

          People

            Unassigned Unassigned
            cphillips Chad Phillips
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: