You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2001/06/20 10:35:29 UTC
cvs commit: jakarta-turbine/src/java/org/apache/turbine/services Service.java BaseService.java BaseUnicastRemoteService.java
dlr 01/06/20 01:35:29
Modified: src/java/org/apache/turbine/services Service.java
BaseService.java BaseUnicastRemoteService.java
Log:
* Re-added getStatus().
* Added JavaDoc for a bunch of methods.
* Implemented getRealPath() in BaseUnicastRemoteService.
Revision Changes Path
1.12 +27 -1 jakarta-turbine/src/java/org/apache/turbine/services/Service.java
Index: Service.java
===================================================================
RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/Service.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Service.java 2001/06/14 15:06:08 1.11
+++ Service.java 2001/06/20 08:35:22 1.12
@@ -55,7 +55,11 @@
*/
import java.util.Properties;
+
+import org.apache.turbine.util.TurbineException;
+
import org.apache.log4j.Category;
+
import org.apache.velocity.runtime.configuration.Configuration;
/**
@@ -68,7 +72,8 @@
* @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
* @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: Service.java,v 1.11 2001/06/14 15:06:08 jvanzyl Exp $
+ * @author <a href="mailto:leonardr@segfault.org">Leonard Richardson</a>
+ * @version $Id: Service.java,v 1.12 2001/06/20 08:35:22 dlr Exp $
*/
public interface Service
{
@@ -130,6 +135,15 @@
public boolean getInit( );
/**
+ * Returns the current status of this service.
+ *
+ * @return The current status of this service.
+ * @throws TurbineException Error determining service status.
+ */
+ public String getStatus()
+ throws TurbineException;
+
+ /**
* Provides a Service with a reference to the ServiceBroker that
* instantiated this object, so that it can ask for its properties
* and access other Services.
@@ -169,7 +183,19 @@
*/
public Configuration getConfiguration();
+ /**
+ * Gets the version of the supplied path as relative to appliation
+ * root. Does not demand strict adherence to the Servlet API's
+ * definition of <code>getRealPath()</code>.
+ *
+ * @return The path, relative to application root.
+ */
public String getRealPath(String path);
+ /**
+ * Returns the logger for this service.
+ *
+ * @return The service's logger.
+ */
public Category getCategory();
}
1.12 +21 -6 jakarta-turbine/src/java/org/apache/turbine/services/BaseService.java
Index: BaseService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseService.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- BaseService.java 2001/06/14 15:06:08 1.11
+++ BaseService.java 2001/06/20 08:35:23 1.12
@@ -56,6 +56,9 @@
import java.util.Properties;
import java.util.List;
+
+import org.apache.turbine.util.TurbineException;
+
import org.apache.log4j.Category;
//!! this must go away we want to use a configuration
@@ -68,7 +71,9 @@
* @author <a href="mailto:burton@apache.org">Kevin Burton</a>
* @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: BaseService.java,v 1.11 2001/06/14 15:06:08 jvanzyl Exp $
+ * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
+ * @author <a href="mailto:leonardr@segfault.org">Leonard Richardson</a>
+ * @version $Id: BaseService.java,v 1.12 2001/06/20 08:35:23 dlr Exp $
*/
public class BaseService implements Service
{
@@ -100,11 +105,12 @@
protected String name;
/**
- * Performs early initialization. Used in a manner similar to a ctor.
+ * Performs early initialization. Used in a manner similar to a
+ * ctor.
*
- * BaseInitable doesn't need early initialization, therefore it
- * ignores all objects passed to it and performs no initialization
- * activities.
+ * Since this base implementation doesn't need early
+ * initialization, it ignores all objects passed to it and
+ * performs no initialization activities.
*
* @param data An Object to use for initialization activities.
* @exception InitializationException Initialization of this
@@ -116,7 +122,7 @@
}
/**
- * Performs late initializtion. Called when the Service is requested
+ * Performs late initializtion. Called when the service is requested
* for the first time (if not already completely initialized by the
* early initializer).
*
@@ -151,6 +157,15 @@
public boolean getInit()
{
return isInitialized;
+ }
+
+ /**
+ * @see org.apache.turbine.services.Service#getStatus()
+ */
+ public String getStatus()
+ throws TurbineException
+ {
+ return (getInit() ? "Initialized" : "Uninitialized");
}
/**
1.6 +11 -15 jakarta-turbine/src/java/org/apache/turbine/services/BaseUnicastRemoteService.java
Index: BaseUnicastRemoteService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseUnicastRemoteService.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BaseUnicastRemoteService.java 2001/06/14 15:02:33 1.5
+++ BaseUnicastRemoteService.java 2001/06/20 08:35:25 1.6
@@ -5,6 +5,7 @@
import java.rmi.server.UnicastRemoteObject;
import javax.servlet.ServletConfig;
+import org.apache.turbine.util.TurbineException;
import org.apache.log4j.Category;
import org.apache.velocity.runtime.configuration.Configuration;
@@ -19,7 +20,6 @@
{
protected Configuration configuration;
private boolean isInitialized;
- //private InitableBroker initableBroker;
private String name;
private Properties properties;
private ServiceBroker serviceBroker;
@@ -28,7 +28,6 @@
throws RemoteException
{
isInitialized = false;
- //initableBroker = null;
properties = null;
name = null;
serviceBroker = null;
@@ -61,18 +60,6 @@
setInit(true);
}
- /*
- public void setInitableBroker(InitableBroker broker)
- {
- this.initableBroker = broker;
- }
-
- public InitableBroker getInitableBroker()
- {
- return initableBroker;
- }
- */
-
public void init(Object data)
throws InitializationException
{
@@ -95,6 +82,15 @@
}
/**
+ * @see org.apache.turbine.services.Service#getStatus()
+ */
+ public String getStatus()
+ throws TurbineException
+ {
+ return (getInit() ? "Initialized" : "Uninitialized");
+ }
+
+ /**
* Shuts down this service.
*/
public void shutdown()
@@ -138,7 +134,7 @@
public String getRealPath(String path)
{
- return null;
+ return getServiceBroker().getRealPath(path);
}
public Category getCategory()
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org