Skip to Content.
Sympa Menu

notify-dpml - r1898 - trunk/main/metro/part/src/main/net/dpml/runtime

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1898 - trunk/main/metro/part/src/main/net/dpml/runtime
  • Date: Mon, 12 Mar 2007 05:57:06 +0100

Author: mcconnell
Date: 2007-03-12 05:57:06 +0100 (Mon, 12 Mar 2007)
New Revision: 1898

Modified:

trunk/main/metro/part/src/main/net/dpml/runtime/ComponentStrategyHandler.java
trunk/main/metro/part/src/main/net/dpml/runtime/Profile.java
Log:
updates to activation policy semantics

Modified:
trunk/main/metro/part/src/main/net/dpml/runtime/ComponentStrategyHandler.java
===================================================================
---
trunk/main/metro/part/src/main/net/dpml/runtime/ComponentStrategyHandler.java
2007-03-12 04:41:19 UTC (rev 1897)
+++
trunk/main/metro/part/src/main/net/dpml/runtime/ComponentStrategyHandler.java
2007-03-12 04:57:06 UTC (rev 1898)
@@ -37,6 +37,7 @@
import net.dpml.lang.StrategyHandler;
import net.dpml.lang.Buffer;

+import net.dpml.annotation.Activation;
import net.dpml.annotation.ActivationPolicy;

import net.dpml.util.Resolver;
@@ -98,7 +99,7 @@
Query q = new Query( query );
Element contextElement = ElementHelper.getChild( element, "context"
);
ContextModel context = getContextModel( classloader, c, path,
profile, contextElement, resolver, q );
- ActivationPolicy activation = getActivationPolicy( element, profile
);
+ ActivationPolicy activation = getActivationPolicy( element, profile,
c );

try
{
@@ -146,24 +147,27 @@
*
* @return the resolved activation policy
*/
- private static ActivationPolicy getActivationPolicy( Element element,
Profile profile )
+ private static ActivationPolicy getActivationPolicy( Element element,
Profile profile, Class<?> c )
{
- if( null == element )
+ if( null != element )
{
- return profile.getActivationPolicy();
- }
- else
- {
String value = ElementHelper.getAttribute( element, "activation"
);
- if( null == value )
+ if( null != value )
{
- return profile.getActivationPolicy();
- }
- else
- {
return ActivationPolicy.valueOf( value.toUpperCase() );
}
}
+ if( null != profile )
+ {
+ return profile.getActivationPolicy();
+ }
+ if( c.isAnnotationPresent( Activation.class ) )
+ {
+ Activation annotation =
+ c.getAnnotation( Activation.class );
+ return annotation.value();
+ }
+ return ActivationPolicy.SYSTEM;
}

private int getPriority( Element element, Resolver resolver )

Modified: trunk/main/metro/part/src/main/net/dpml/runtime/Profile.java
===================================================================
--- trunk/main/metro/part/src/main/net/dpml/runtime/Profile.java
2007-03-12 04:41:19 UTC (rev 1897)
+++ trunk/main/metro/part/src/main/net/dpml/runtime/Profile.java
2007-03-12 04:57:06 UTC (rev 1898)
@@ -113,7 +113,7 @@

/**
* Return the activation policy. If the element declares the activation
attribute
- * that value (resolved to the policy enum) is returne, otherwise the
class is checked for
+ * that value (resolved to the policy enum) is returned, otherwise the
class is checked for
* the declaration of an explicit activivation policy and if present the
value is returned,
* otherwise the default SYSTEM activation policy is returned.
*




  • r1898 - trunk/main/metro/part/src/main/net/dpml/runtime, mcconnell at BerliOS, 03/12/2007

Archive powered by MHonArc 2.6.24.

Top of Page