dlr 01/05/25 17:57:37
Modified: src/java/org/apache/turbine/services/pull TurbinePull.java
src/java/org/apache/turbine/services/velocity
TurbineVelocityService.java
Log:
When initializing the Velocity service, we want to know if the Pull service is
registered, not whether it's initialized. The initialization handling happens
automatically if the service is configured.
Revision Changes Path
1.9 +15 -19
jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePull.java
Index: TurbinePull.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePull.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TurbinePull.java 2001/03/22 08:50:15 1.8
+++ TurbinePull.java 2001/05/26 00:57:37 1.9
@@ -67,7 +67,8 @@
* the settings in TurbineResources.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: TurbinePull.java,v 1.8 2001/03/22 08:50:15 jon Exp $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
+ * @version $Id: TurbinePull.java,v 1.9 2001/05/26 00:57:37 dlr Exp $
*/
public abstract class TurbinePull
{
@@ -96,28 +97,23 @@
}
/**
- * This is used to check and make sure that the
- * Pull Service was correctly initialized. This
- * is required by the TurbineVelocityService so
- * it can determine whether to attempt to place
- * the ToolBox in the context.
+ * This is used to check and make sure that the Pull Service has
+ * been registered. This is required by the TurbineVelocityService
+ * so it can determine whether to attempt to place the ToolBox in
+ * the context.
* <p>
- * The Service Broker will throw an
- * InstantiationException if the Pull Service
- * is not listed in the TR.props, but this is
- * dealt with in the TurbineVelocityService.
- * <p>
- * So users can use Turbine with templates
- * in the traditional manner. If the Pull Service
- * is not listed in TR.props, or no tools are
- * specified the TurbineVelocityService will
- * behave in its traditional manner.
+ * So users can use Turbine with templates in the traditional
+ * manner. If the Pull Service is not listed in
+ * <code>TurbineResources.props</code>, or no tools are specified
+ * the TurbineVelocityService will behave in its traditional
+ * manner.
*/
- public static final boolean getInit()
+ public static final boolean isRegistered()
{
- return getService().getInit();
+ return TurbineServices.getInstance()
+ .isRegistered(PullService.SERVICE_NAME);
}
-
+
/**
* Return the absolute path of resources directory
* where tools store resource information.
1.46 +3 -9
jakarta-turbine/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java
Index: TurbineVelocityService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- TurbineVelocityService.java 2001/05/23 22:24:32 1.45
+++ TurbineVelocityService.java 2001/05/26 00:57:37 1.46
@@ -101,7 +101,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sean Legassick</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: TurbineVelocityService.java,v 1.45 2001/05/23 22:24:32 dlr Exp $
+ * @version $Id: TurbineVelocityService.java,v 1.46 2001/05/26 00:57:37 dlr Exp $
*/
public class TurbineVelocityService extends BaseTemplateEngineService
implements VelocityService
@@ -143,20 +143,14 @@
* We can only load the Pull Model ToolBox
* if the Pull service has been listed in the TR.props
* and the service has successfully been initialized.
- *
- * Make sure the Pull service was properly
- * initialized before we attempt to grab
- * the ToolBox the Pull service produced
- * for use in templates.
*/
- if (TurbinePull.getInit())
+ if (TurbinePull.isRegistered())
{
globalContext = TurbinePull.getGlobalContext();
pullModelActive = true;
- refreshToolsPerRequest =
- TurbinePull.refreshToolsPerRequest();
+ refreshToolsPerRequest = TurbinePull.refreshToolsPerRequest();
}
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]