You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by mp...@marmot.at on 2001/08/02 01:52:45 UTC
big commit for 2.2
mpoeschl 01/08/01 17:26:25
Modified: src/java/org/apache/turbine/modules/actions Tag:
T_2_1_BRANCH AccessController.java LoginUser.java
LogoutUser.java
src/java/org/apache/turbine/modules/actions/sessionvalidator
Tag: T_2_1_BRANCH DefaultSessionValidator.java
TemplateSecureSessionValidator.java
TemplateSessionValidator.java
src/java/org/apache/turbine/modules/layouts Tag:
T_2_1_BRANCH DefaultLayout.java
VelocityECSLayout.java
src/java/org/apache/turbine/services Tag: T_2_1_BRANCH
BaseUnicastRemoteService.java Service.java
src/java/org/apache/turbine/services/freemarker Tag:
T_2_1_BRANCH DynamicURIModel.java
NavigationModel.java
src/java/org/apache/turbine/services/intake Tag:
T_2_1_BRANCH IntakeService.java IntakeTool.java
TurbineIntake.java TurbineIntakeService.java
src/java/org/apache/turbine/services/intake/model Tag:
T_2_1_BRANCH BigDecimalField.java BooleanField.java
ComboKeyField.java Field.java FieldFactory.java
Group.java IntegerField.java NumberKeyField.java
StringField.java
src/java/org/apache/turbine/services/intake/transform Tag:
T_2_1_BRANCH DTDResolver.java XmlToAppData.java
src/java/org/apache/turbine/services/intake/validator Tag:
T_2_1_BRANCH Constraint.java DefaultValidator.java
IntegerValidator.java NumberKeyValidator.java
NumberValidator.java ValidationException.java
Validator.java
src/java/org/apache/turbine/services/intake/xmlmodel Tag:
T_2_1_BRANCH AppData.java Rule.java XmlField.java
XmlGroup.java
src/java/org/apache/turbine/services/velocity Tag:
T_2_1_BRANCH TurbineVelocityService.java
src/java/org/apache/turbine/torque/engine/database/model
Tag: T_2_1_BRANCH Column.java
IdMethodParameter.java Table.java
src/java/org/apache/turbine/util Tag: T_2_1_BRANCH
SequencedHashtable.java
src/java/org/apache/turbine/util/db/adapter Tag:
T_2_1_BRANCH DBFactory.java
conf/torque/templates/sql/base/db2 Tag: T_2_1_BRANCH
sequence.vm
conf/torque/templates/sql/base/oracle Tag: T_2_1_BRANCH
drop.vm sequence.vm
conf/torque/templates/sql/base/postgresql Tag: T_2_1_BRANCH
db.props drop.vm index.vm
conf/torque/templates/sql/base/sapdb Tag: T_2_1_BRANCH
drop.vm sequence.vm
Log:
more bug-fixes for 2.2
Revision Changes Path
No revision
No revision
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: big commit for 2.2
Posted by John McNally <jm...@collab.net>.
This diff shows a number of lines with no apparent changes (is this tabs
vs. spaces?), but the more critical thing is that a try/catch block was
removed that allows intake to work in situations where write access to
the WEB-INF directory does not exist.
john mcnally
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/intake/TurbineIntakeService.java,v
retrieving revision 1.9.4.7
retrieving revision 1.9.4.8
diff -u -r1.9.4.7 -r1.9.4.8
---
jakarta-turbine/src/java/org/apache/turbine/services/intake/TurbineIntakeService.java
2001/07/27 23:39:32 1.9.4.7
+++
jakarta-turbine/src/java/org/apache/turbine/services/intake/TurbineIntakeService.java
2001/08/02 00:26:22 1.9.4.8
@@ -25,13 +25,13 @@
* Alternately, this acknowledgment may appear in the software
itself,
* if and wherever such third-party acknowledgments normally appear.
*
- * 4. The names "Apache" and "Apache Software Foundation" and
- * "Apache Turbine" must not be used to endorse or promote products
- * derived from this software without prior written permission. For
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Turbine" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
- * "Apache Turbine", nor may "Apache" appear in their name, without
+ * "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
@@ -73,10 +73,6 @@
import java.util.Properties;
import javax.servlet.ServletConfig;
import org.apache.turbine.om.OMTool;
-import org.apache.turbine.services.BaseInitable;
-import org.apache.turbine.services.BaseService;
-import org.apache.turbine.services.InitializationException;
-import org.apache.turbine.services.TurbineBaseService;
import org.apache.turbine.services.intake.model.Group;
import org.apache.turbine.services.intake.transform.XmlToAppData;
import org.apache.turbine.services.intake.xmlmodel.AppData;
@@ -87,17 +83,18 @@
import org.apache.turbine.util.TurbineException;
import org.apache.turbine.util.pool.BoundedBuffer;
import org.apache.turbine.util.pool.Recyclable;
-
+import org.apache.turbine.services.BaseService;
+import org.apache.turbine.services.InitializationException;
/**
* This service provides access to input processing objects based
* on an XML specification.
- *
+ *
* @author <a href="mailto:jmcnally@collab.net">John McNally</a>
- * @version $Id: TurbineIntakeService.java,v 1.9.4.7 2001/07/27
23:39:32 jmcnally Exp $
+ * @version $Id: TurbineIntakeService.java,v 1.9.4.8 2001/08/02
00:26:22 mpoeschl Exp $
*/
public class TurbineIntakeService
- extends TurbineBaseService
+ extends BaseService
implements IntakeService
{
/** Array of group names. */
@@ -127,8 +124,8 @@
private HashMap poolRepository = new HashMap();
// a couple integers for a switch statement
- private static final int GETTER = 0;
- private static final int SETTER = 1;
+ private static final int GETTER = 0;
+ private static final int SETTER = 1;
/**
* Constructor.
@@ -155,6 +152,7 @@
Log.error(pathError);
throw new InitializationException(pathError);
}
+ //!! need a constant
String appDataPath = "WEB-INF/appData.ser";
try
{
@@ -163,8 +161,8 @@
appDataPath = ServletUtils.expandRelative(config,
appDataPath);
File serialAppData = new File(appDataPath);
File xmlFile = new File(xmlPath);
- if ( serialAppData.exists()
- && serialAppData.lastModified() >
xmlFile.lastModified() )
+ if ( serialAppData.exists()
+ && serialAppData.lastModified() >
xmlFile.lastModified() )
{
InputStream in = new FileInputStream(serialAppData);
ObjectInputStream p = new ObjectInputStream(in);
@@ -176,22 +174,11 @@
XmlToAppData xmlApp = new XmlToAppData();
appData = xmlApp.parseFile(xmlPath);
- try
- {
- OutputStream out = new
FileOutputStream(serialAppData);
- ObjectOutputStream p = new ObjectOutputStream(out);
- p.writeObject(appData);
- p.flush();
- out.close();
- }
- catch (Exception e)
- {
- Log.info(
- "Intake initialization could not be serialized
" +
- "because writing to " + appDataPath + " was not
" +
- "allowed. This will require that the xml
filebe " +
- "parsed when restarting the application.");
- }
+ OutputStream out = new FileOutputStream(serialAppData);
+ ObjectOutputStream p = new ObjectOutputStream(out);
+ p.writeObject(appData);
+ p.flush();
+ out.close();
}
groupNames = new String[appData.getGroups().size()];
@@ -213,17 +200,17 @@
List classNames = g.getMapToObjects();
Iterator iter2 = classNames.iterator();
- while (iter2.hasNext())
+ while (iter2.hasNext())
{
String className = (String)iter2.next();
- if ( !getterMap.containsKey(className) )
+ if ( !getterMap.containsKey(className) )
{
getterMap.put(className, new HashMap());
setterMap.put(className, new HashMap());
}
}
}
-
+
setInit(true);
}
catch (Exception e)
@@ -233,36 +220,36 @@
}
}
- private Method initializeBeanProp(String className, String
propName,
+ private Method initializeBeanProp(String className, String
propName,
int getOrSet)
throws Exception
{
// getter or setter method
Method method = null;
- if ( className != null && propName != null )
- {
- // Uses bean introspection to set writable properties
- // of bean from the parameters, where a
+ if ( className != null && propName != null )
+ {
+ // Uses bean introspection to set writable properties
+ // of bean from the parameters, where a
// (case-insensitive) name match between the bean
// property and the parameter is looked for.
PropertyDescriptor[] beanProps = Introspector
.getBeanInfo(Class.forName(className))
.getPropertyDescriptors();
-
+
boolean noMatch = true;
for (int j=beanProps.length-1; j>=0; j--)
{
- if (propName.equalsIgnoreCase(beanProps[j].getName()))
+ if (propName.equalsIgnoreCase(beanProps[j].getName()))
{
- switch ( getOrSet )
+ switch ( getOrSet )
{
case GETTER:
- method = beanProps[j].getReadMethod();
+ method = beanProps[j].getReadMethod();
((HashMap)getterMap.get(className))
.put(propName, method);
break;
case SETTER:
- method = beanProps[j].getWriteMethod();
+ method = beanProps[j].getWriteMethod();
((HashMap)setterMap.get(className))
.put(propName, method);
}
@@ -270,9 +257,9 @@
break;
}
}
- if ( noMatch )
+ if ( noMatch )
{
- Log.error("Property, " + propName + " for class, " +
+ Log.error("Property, " + propName + " for class, " +
className + " could not be found.");
}
}
@@ -322,7 +309,7 @@
}
catch (Exception x)
{
- throw new TurbineException("Recycling failed for "
+
+ throw new TurbineException("Recycling failed for "
+
instance.getClass().getName(),x);
}
}
@@ -380,7 +367,7 @@
throws TurbineException
{
Group instance = (Group)pollInstance(groupName);
- if ( instance == null )
+ if ( instance == null )
{
try
{
@@ -432,8 +419,8 @@
{
int capacity = DEFAULT_POOL_CAPACITY;
PoolBuffer pool = (PoolBuffer) poolRepository.get(name);
- if ( pool == null )
- {
+ if ( pool == null )
+ {
try
{
capacity = Integer
@@ -441,11 +428,11 @@
}
catch (NumberFormatException nfe) {}
}
- else
+ else
{
capacity = pool.capacity();
}
-
+
return capacity;
}
@@ -565,8 +552,8 @@
{
Map settersForClassName = (Map)setterMap.get(className);
Method method = (Method)settersForClassName.get(propName);
-
- if ( method == null )
+
+ if ( method == null )
{
synchronized(setterMap)
{
@@ -595,8 +582,8 @@
{
Map gettersForClassName = (Map)getterMap.get(className);
Method method = (Method)gettersForClassName.get(propName);
-
- if ( method == null )
+
+ if ( method == null )
{
synchronized(getterMap)
{
mpoeschl@marmot.at wrote:
>
> mpoeschl 01/08/01 17:26:25
>
> Modified: src/java/org/apache/turbine/modules/actions Tag:
> T_2_1_BRANCH AccessController.java LoginUser.java
> LogoutUser.java
> src/java/org/apache/turbine/modules/actions/sessionvalidator
> Tag: T_2_1_BRANCH DefaultSessionValidator.java
> TemplateSecureSessionValidator.java
> TemplateSessionValidator.java
> src/java/org/apache/turbine/modules/layouts Tag:
> T_2_1_BRANCH DefaultLayout.java
> VelocityECSLayout.java
> src/java/org/apache/turbine/services Tag: T_2_1_BRANCH
> BaseUnicastRemoteService.java Service.java
> src/java/org/apache/turbine/services/freemarker Tag:
> T_2_1_BRANCH DynamicURIModel.java
> NavigationModel.java
> src/java/org/apache/turbine/services/intake Tag:
> T_2_1_BRANCH IntakeService.java IntakeTool.java
> TurbineIntake.java TurbineIntakeService.java
> src/java/org/apache/turbine/services/intake/model Tag:
> T_2_1_BRANCH BigDecimalField.java BooleanField.java
> ComboKeyField.java Field.java FieldFactory.java
> Group.java IntegerField.java NumberKeyField.java
> StringField.java
> src/java/org/apache/turbine/services/intake/transform Tag:
> T_2_1_BRANCH DTDResolver.java XmlToAppData.java
> src/java/org/apache/turbine/services/intake/validator Tag:
> T_2_1_BRANCH Constraint.java DefaultValidator.java
> IntegerValidator.java NumberKeyValidator.java
> NumberValidator.java ValidationException.java
> Validator.java
> src/java/org/apache/turbine/services/intake/xmlmodel Tag:
> T_2_1_BRANCH AppData.java Rule.java XmlField.java
> XmlGroup.java
> src/java/org/apache/turbine/services/velocity Tag:
> T_2_1_BRANCH TurbineVelocityService.java
> src/java/org/apache/turbine/torque/engine/database/model
> Tag: T_2_1_BRANCH Column.java
> IdMethodParameter.java Table.java
> src/java/org/apache/turbine/util Tag: T_2_1_BRANCH
> SequencedHashtable.java
> src/java/org/apache/turbine/util/db/adapter Tag:
> T_2_1_BRANCH DBFactory.java
> conf/torque/templates/sql/base/db2 Tag: T_2_1_BRANCH
> sequence.vm
> conf/torque/templates/sql/base/oracle Tag: T_2_1_BRANCH
> drop.vm sequence.vm
> conf/torque/templates/sql/base/postgresql Tag: T_2_1_BRANCH
> db.props drop.vm index.vm
> conf/torque/templates/sql/base/sapdb Tag: T_2_1_BRANCH
> drop.vm sequence.vm
> Log:
> more bug-fixes for 2.2
>
> Revision Changes Path
> No revision
>
>
> No revision
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org