Thomas Vandahl
2017-12-24 11:21:42 UTC
Author: gk
Date: Sat Dec 23 09:32:08 2017
New Revision: 1819127
URL: http://svn.apache.org/viewvc?rev=1819127&view=rev
- updates due to fulcrum security version 1.1.2-SNAPSHOT
- allow annotations in turbine services (TODO test)
[...]Date: Sat Dec 23 09:32:08 2017
New Revision: 1819127
URL: http://svn.apache.org/viewvc?rev=1819127&view=rev
- updates due to fulcrum security version 1.1.2-SNAPSHOT
- allow annotations in turbine services (TODO test)
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java?rev=1819127&r1=1819126&r2=1819127&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java Sat Dec 23 09:32:08 2017
@@ -33,6 +33,8 @@ import org.apache.commons.configuration.
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.turbine.annotation.AnnotationProcessor;
+import org.apache.turbine.util.TurbineException;
/**
* A generic implementation of a <code>ServiceBroker</code> which
@@ -373,6 +375,16 @@ public abstract class BaseServiceBroker
if (!instance.getInit())
{
+
+ try
+ {
+ // convenience annotation in Turbine services
+ AnnotationProcessor.process(instance);
+ }
+ catch ( TurbineException e )
+ {
+ throw new InstantiationException( e.getMessage(), e );
+ }
// this call might result in an indirect recursion
instance.init();
}
I'm afraid this will cause a stack overflow if you happen to hit aURL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java?rev=1819127&r1=1819126&r2=1819127&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/BaseServiceBroker.java Sat Dec 23 09:32:08 2017
@@ -33,6 +33,8 @@ import org.apache.commons.configuration.
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.turbine.annotation.AnnotationProcessor;
+import org.apache.turbine.util.TurbineException;
/**
* A generic implementation of a <code>ServiceBroker</code> which
@@ -373,6 +375,16 @@ public abstract class BaseServiceBroker
if (!instance.getInit())
{
+
+ try
+ {
+ // convenience annotation in Turbine services
+ AnnotationProcessor.process(instance);
+ }
+ catch ( TurbineException e )
+ {
+ throw new InstantiationException( e.getMessage(), e );
+ }
// this call might result in an indirect recursion
instance.init();
}
cyclic dependency. The AnnotationProcessor expects services to be
initialized so I left this out intentionally.
Bye, Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@turbine.apache.org
For additional commands, e-mail: dev-***@turbine.apache.org