jvanzyl 01/06/24 22:40:22
Modified: src/java/org/apache/turbine/services BaseService.java
BaseServiceBroker.java
BaseUnicastRemoteService.java
InitializationException.java
InstantiationException.java Service.java
ServiceBroker.java TurbineServices.java
Log:
- fixing problems that i made
Revision Changes Path
1.14 +6 -29
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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- BaseService.java 2001/06/25 05:09:02 1.13
+++ BaseService.java 2001/06/25 05:40:21 1.14
@@ -56,9 +56,6 @@
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
@@ -71,9 +68,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin Burton</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Leonard Richardson</a>
- * @version $Id: BaseService.java,v 1.13 2001/06/25 05:09:02 jvanzyl Exp $
+ * @version $Id: BaseService.java,v 1.14 2001/06/25 05:40:21 jvanzyl Exp $
*/
public class BaseService implements Service
{
@@ -104,15 +99,12 @@
*/
protected String name;
-<<<<<<< BaseService.java
-=======
/**
- * Performs early initialization. Used in a manner similar to a
- * ctor.
+ * Performs early initialization. Used in a manner similar to a ctor.
*
- * Since this base implementation doesn't need early
- * initialization, it ignores all objects passed to it and
- * performs no initialization activities.
+ * BaseInitable doesn't need early initialization, therefore 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
@@ -123,9 +115,8 @@
{
}
->>>>>>> 1.12
/**
- * 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).
*
@@ -163,15 +154,6 @@
}
/**
- * @see org.apache.turbine.services.Service#getStatus()
- */
- public String getStatus()
- throws TurbineException
- {
- return (getInit() ? "Initialized" : "Uninitialized");
- }
-
- /**
* Returns initialization status.
*
* @return True if the service is initialized.
@@ -286,10 +268,5 @@
public Category getCategory()
{
return getServiceBroker().getCategory();
- }
-
- public Category getCategory(String name)
- {
- return getServiceBroker().getCategory(name);
}
}
1.37 +0 -11
jakarta-turbine/src/java/org/apache/turbine/services/BaseServiceBroker.java
Index: BaseServiceBroker.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseServiceBroker.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- BaseServiceBroker.java 2001/06/25 05:09:02 1.36
+++ BaseServiceBroker.java 2001/06/25 05:40:21 1.37
@@ -96,7 +96,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: BaseServiceBroker.java,v 1.36 2001/06/25 05:09:02 jvanzyl Exp $
+ * @version $Id: BaseServiceBroker.java,v 1.37 2001/06/25 05:40:21 jvanzyl Exp $
*/
public abstract class BaseServiceBroker implements ServiceBroker
{
@@ -213,17 +213,6 @@
public Category getCategory()
{
return category;
- }
-
- /**
- * Get a log4j Category by name.
- *
- * @param name log4j category to return
- * @return Category log4j category
- */
- public Category getCategory(String name)
- {
- return Category.getInstance(name);
}
/**
1.9 +24 -6
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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- BaseUnicastRemoteService.java 2001/06/25 05:09:02 1.8
+++ BaseUnicastRemoteService.java 2001/06/25 05:40:21 1.9
@@ -55,12 +55,35 @@
}
}
- public void init()
+ public void init(ServletConfig config)
throws InitializationException
{
setInit(true);
}
+ /*
+ public void setInitableBroker(InitableBroker broker)
+ {
+ this.initableBroker = broker;
+ }
+
+ public InitableBroker getInitableBroker()
+ {
+ return initableBroker;
+ }
+ */
+
+ public void init(Object data)
+ throws InitializationException
+ {
+ init((ServletConfig) data);
+ }
+
+ public void init() throws InitializationException
+ {
+ setInit(true);
+ }
+
protected void setInit(boolean value)
{
isInitialized = value;
@@ -119,11 +142,6 @@
}
public Category getCategory()
- {
- return null;
- }
-
- public Category getCategory(String name)
{
return null;
}
1.9 +0 -0
jakarta-turbine/src/java/org/apache/turbine/services/InitializationException.java
Index: InitializationException.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/InitializationException.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- InitializationException.java 2001/06/25 05:09:02 1.8
+++ InitializationException.java 2001/06/25 05:40:21 1.9
@@ -62,7 +62,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin Burton</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
- * @version $Id: InitializationException.java,v 1.8 2001/06/25 05:09:02 jvanzyl Exp
$
+ * @version $Id: InitializationException.java,v 1.9 2001/06/25 05:40:21 jvanzyl Exp
$
* @see org.apache.turbine.services.Initable
*/
public class InitializationException
1.10 +0 -0
jakarta-turbine/src/java/org/apache/turbine/services/InstantiationException.java
Index: InstantiationException.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/InstantiationException.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- InstantiationException.java 2001/06/25 05:09:03 1.9
+++ InstantiationException.java 2001/06/25 05:40:21 1.10
@@ -63,7 +63,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin Burton</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
- * @version $Id: InstantiationException.java,v 1.9 2001/06/25 05:09:03 jvanzyl Exp $
+ * @version $Id: InstantiationException.java,v 1.10 2001/06/25 05:40:21 jvanzyl Exp
$
* @see org.apache.turbine.services.Initable
*/
public class InstantiationException
1.15 +23 -4
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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Service.java 2001/06/25 05:09:03 1.14
+++ Service.java 2001/06/25 05:40:21 1.15
@@ -68,7 +68,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Service.java,v 1.14 2001/06/25 05:09:03 jvanzyl Exp $
+ * @version $Id: Service.java,v 1.15 2001/06/25 05:40:21 jvanzyl Exp $
*/
public interface Service
{
@@ -78,6 +78,28 @@
public static final String SERVICE_NAME = "Service";
/**
+ * Performs early initailization of an Initable
+ *
+ * During the startup of the system, different objects may be
+ * passed to your class using this method. It should ignore any
+ * objects that it doesn't need or understand.
+ *
+ * After the class changes its internal state so that getInit()
+ * returns true, this method will be called no more, and late
+ * initialization will not be performed.
+ *
+ * If your class relies on early initialization, and the object it
+ * expects was not received, you can use late initialization to
+ * throw an exception and complain.
+ *
+ * @param data An Object to use for initialization activities.
+ * @exception InitializationException, if initilaization of this
+ * class was not successful.
+ */
+ public void init( Object data )
+ throws InitializationException;
+
+ /**
* Performs late initialization of an Initable.
*
* When your class is being requested from an InitableBroker, it
@@ -87,8 +109,7 @@
* @exception InitializationException, if initialization of this
* class was not successful.
*/
- public void init( )
- throws InitializationException;
+ public void init( ) throws InitializationException;
/**
* Returns an <code>Initable</code> to an uninitialized state.
@@ -151,6 +172,4 @@
public String getRealPath(String path);
public Category getCategory();
-
- public Category getCategory(String name);
}
1.11 +0 -1
jakarta-turbine/src/java/org/apache/turbine/services/ServiceBroker.java
Index: ServiceBroker.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/ServiceBroker.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ServiceBroker.java 2001/06/25 05:09:03 1.10
+++ ServiceBroker.java 2001/06/25 05:40:21 1.11
@@ -80,7 +80,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: ServiceBroker.java,v 1.10 2001/06/25 05:09:03 jvanzyl Exp $
+ * @version $Id: ServiceBroker.java,v 1.11 2001/06/25 05:40:21 jvanzyl Exp $
*/
public interface ServiceBroker
{
@@ -192,5 +192,4 @@
public String getRealPath(String path);
public String getApplicationRoot();
public Category getCategory();
- public Category getCategory(String name);
}
1.32 +0 -0
jakarta-turbine/src/java/org/apache/turbine/services/TurbineServices.java
Index: TurbineServices.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/TurbineServices.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- TurbineServices.java 2001/06/25 05:09:03 1.31
+++ TurbineServices.java 2001/06/25 05:40:21 1.32
@@ -70,7 +70,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: TurbineServices.java,v 1.31 2001/06/25 05:09:03 jvanzyl Exp $
+ * @version $Id: TurbineServices.java,v 1.32 2001/06/25 05:40:21 jvanzyl Exp $
*/
public class TurbineServices
extends BaseServiceBroker
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]