CVS: Tapestry/framework/src/net/sf/tapestry/engine BSFManagerPoolableAdaptor.java,NONE,1.1.2.1 AbstractEngine.java,1.34.2.7,1.34.2.8
Howard Lewis Ship <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv2336/framework/src/net/sf/tapestry/engine
Modified Files:
Tag: hship-2-3
AbstractEngine.java
Added Files:
Tag: hship-2-3
BSFManagerPoolableAdaptor.java
Log Message:
Add support for <listener-binding>.
Use a ResourceBundle for "factory default" configuration properties.
--- NEW FILE: BSFManagerPoolableAdaptor.java ---
package net.sf.tapestry.engine;
import org.apache.bsf.BSFManager;
import net.sf.tapestry.util.pool.IPoolableAdaptor;
/**
* Allows a {@link net.sf.tapestry.util.pool.Pool} to
* properly terminate a {@link org.apache.bsf.BSFManager}
* when it is discarded.
*
* @author Howard Lewis Ship
* @version $Id: BSFManagerPoolableAdaptor.java,v 1.1.2.1 2003/01/04 02:46:47 hship Exp $
* @since 2.4
*
**/
public class BSFManagerPoolableAdaptor implements IPoolableAdaptor
{
/**
* Does nothing.
*
**/
public void resetForPool(Object object)
{
}
/**
* Invokes {@link org.apache.bsf.BSFManager#terminate()}.
*
**/
public void discardFromPool(Object object)
{
BSFManager manager = (BSFManager)object;
manager.terminate();
}
}
Index: AbstractEngine.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/engine/AbstractEngine.java,v
retrieving revision 1.34.2.7
retrieving revision 1.34.2.8
diff -C2 -d -r1.34.2.7 -r1.34.2.8
*** AbstractEngine.java 30 Dec 2002 03:04:56 -0000 1.34.2.7
--- AbstractEngine.java 4 Jan 2003 02:46:47 -0000 1.34.2.8
***************
*** 11,14 ****
--- 11,15 ----
import java.util.Locale;
import java.util.Map;
+ import java.util.ResourceBundle;
import javax.servlet.RequestDispatcher;
***************
*** 22,25 ****
--- 23,27 ----
import javax.servlet.http.HttpSessionBindingListener;
+ import org.apache.bsf.BSFManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
***************
*** 59,62 ****
--- 61,65 ----
import net.sf.tapestry.util.DelegatingPropertySource;
import net.sf.tapestry.util.PropertyHolderPropertySource;
+ import net.sf.tapestry.util.ResourceBundlePropertySource;
import net.sf.tapestry.util.ServletContextPropertySource;
import net.sf.tapestry.util.ServletPropertySource;
***************
*** 1871,1874 ****
--- 1874,1883 ----
result.addSource(SystemPropertiesPropertySource.getInstance());
+
+ // Lastly, add a final source to handle "factory defaults".
+
+ ResourceBundle bundle = ResourceBundle.getBundle("net.sf.tapestry.ConfigurationDefaults");
+
+ result.addSource(new ResourceBundlePropertySource(bundle));
return result;
***************
*** 1887,1891 ****
/**
! * Returns an new instance of {@link Pool}. Subclasses may override this
* method to configure the Pool differently.
*
--- 1896,1904 ----
/**
! * Returns an new instance of {@link Pool}, with the standard
! * set of adaptors, plus {@link BSFManagerPoolableAdaptor} for
! * {@link BSFManager}.
! *
! * <p>Subclasses may override this
* method to configure the Pool differently.
*
***************
*** 1896,1900 ****
protected Pool createPool(RequestContext context)
{
! return new Pool();
}
--- 1909,1917 ----
protected Pool createPool(RequestContext context)
{
! Pool result = new Pool();
!
! result.registerAdaptor(BSFManager.class, new BSFManagerPoolableAdaptor());
!
! return result;
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf