From: <ikr...@us...> - 2012-02-18 07:07:13
|
Revision: 3614 http://archive-access.svn.sourceforge.net/archive-access/?rev=3614&view=rev Author: ikreymer Date: 2012-02-18 07:07:06 +0000 (Sat, 18 Feb 2012) Log Message: ----------- FEATURE: Provide ability to set access point path seperate from the Spring bean name. This is really useful for interpolation, as Spring bean names are not interpolated as properties. Allows for following setup: <bean name="webAccessPoint" class="org.archive.wayback.webapp.AccessPoint"> <property name="accessPointPath" value="${wayback.host}:${wayback.port}:wayback"/> ... </bean> Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/webapp/BeanNameRegistrar.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/webapp/BeanNameRegistrar.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/webapp/BeanNameRegistrar.java 2012-02-16 19:07:40 UTC (rev 3613) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/webapp/BeanNameRegistrar.java 2012-02-18 07:07:06 UTC (rev 3614) @@ -23,6 +23,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.archive.wayback.webapp.AccessPoint; + /** * Helper static methods to implement registration of a RequestHandler with a * RequestMapper, based on the beanName() method. @@ -128,7 +130,17 @@ */ public static void registerHandler(RequestHandler handler, RequestMapper mapper) { - String name = handler.getBeanName(); + + String name = null; + + if (handler instanceof AccessPoint) { + name = ((AccessPoint)handler).getAccessPointName(); + } + + if (name == null) { + name = handler.getBeanName(); + } + if(name != null) { if(name.equals(RequestMapper.GLOBAL_PRE_REQUEST_HANDLER)) { LOGGER.info("Registering Global-pre request handler:" + Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2012-02-16 19:07:40 UTC (rev 3613) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2012-02-18 07:07:06 UTC (rev 3614) @@ -132,6 +132,8 @@ private BooleanOperator<WaybackRequest> authentication = null; private long embargoMS = 0; private CustomResultFilterFactory filterFactory = null; + + private String accessPointPath = null; public void init() { checkAccessPointAware(collection,exception,query,parser,replay, @@ -958,4 +960,12 @@ public CustomResultFilterFactory getFilterFactory() { return filterFactory; } + + public String getAccessPointPath() { + return accessPointPath; + } + + public void setAccessPointPath(String accessPointPath) { + this.accessPointPath = accessPointPath; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |