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

                 Key: TUSCANY-3356
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3356
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Policy, Java SCA Samples
    Affects Versions: Java-SCA-1.5.1, Java-SCA-Next
         Environment: Windows XP Pro, Java 1.5.0_18, Tuscany SCA Java 1.5.1 & 
1.6 SNAPSHOT (r826612)
            Reporter: Chad Phillips


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).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to