You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by un...@apache.org on 2003/12/29 16:24:36 UTC
cvs commit: cocoon-2.2/src/java/org/apache/cocoon/generation StatusGenerator.java LinkStatusGenerator.java JXTemplateGenerator.java
unico 2003/12/29 07:24:36
Modified: src/java/org/apache/cocoon/matching ParameterMatcher.java
RegexpParameterMatcher.java
WildcardRequestParameterMatcher.java
RegexpURIMatcher.java RequestParameterMatcher.java
AbstractRegexpMatcher.java HeaderMatcher.java
CookieMatcher.java AbstractWildcardMatcher.java
WildcardURIMatcher.java
src/java/org/apache/cocoon/matching/modular
CachingWildcardMatcher.java
CachingRegexpMatcher.java WildcardMatcher.java
src/java/org/apache/cocoon/selection ExceptionSelector.java
ResourceExistsSelector.java SwitchSelector.java
Selector.java XPathExceptionSelector.java
NamedPatternsSelector.java BrowserSelector.java
ParameterSelector.java CookieSelector.java
RequestParameterSelector.java SimpleSelector.java
src/java/org/apache/cocoon/serialization TextSerializer.java
ZipArchiveSerializer.java
src/java/org/apache/cocoon/reading ImageReader.java
src/java/org/apache/cocoon/generation StatusGenerator.java
LinkStatusGenerator.java JXTemplateGenerator.java
Log:
a *lot* more fortressessisation
Revision Changes Path
1.2 +7 -3 cocoon-2.2/src/java/org/apache/cocoon/matching/ParameterMatcher.java
Index: ParameterMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/ParameterMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ParameterMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ ParameterMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -51,7 +51,6 @@
package org.apache.cocoon.matching;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
import java.util.HashMap;
import java.util.Map;
@@ -70,8 +69,13 @@
*
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
-public class ParameterMatcher implements Matcher, ThreadSafe
+public class ParameterMatcher implements Matcher
+
{
/**
* Match method to see if the sitemap parameter exists. If it does
1.2 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/matching/RegexpParameterMatcher.java
Index: RegexpParameterMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/RegexpParameterMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpParameterMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ RegexpParameterMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -68,6 +68,10 @@
*
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @avalon.lifestyle type=singleton
*/
public class RegexpParameterMatcher extends AbstractRegexpMatcher
implements Configurable
1.2 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/matching/WildcardRequestParameterMatcher.java
Index: WildcardRequestParameterMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/WildcardRequestParameterMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WildcardRequestParameterMatcher.java 9 Mar 2003 00:09:34 -0000 1.1
+++ WildcardRequestParameterMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -72,6 +72,10 @@
* @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
public class WildcardRequestParameterMatcher extends AbstractWildcardMatcher
implements Configurable
1.2 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/matching/RegexpURIMatcher.java
Index: RegexpURIMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/RegexpURIMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegexpURIMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ RegexpURIMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -60,6 +60,10 @@
*
* @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
public class RegexpURIMatcher extends AbstractRegexpMatcher
{
1.2 +6 -2 cocoon-2.2/src/java/org/apache/cocoon/matching/RequestParameterMatcher.java
Index: RequestParameterMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/RequestParameterMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RequestParameterMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ RequestParameterMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -73,8 +73,12 @@
* @author <a href="mailto:Marcus.Crafter@osa.de">Marcus Crafter</a>
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
-public class RequestParameterMatcher implements Matcher, ThreadSafe
+public class RequestParameterMatcher implements Matcher
{
/**
* Match method to see if the request parameter exists. If it does
1.2 +2 -2 cocoon-2.2/src/java/org/apache/cocoon/matching/AbstractRegexpMatcher.java
Index: AbstractRegexpMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/AbstractRegexpMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractRegexpMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ AbstractRegexpMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -70,7 +70,7 @@
* @version CVS $Id$
*/
-public abstract class AbstractRegexpMatcher extends AbstractPreparableMatcher implements ThreadSafe {
+public abstract class AbstractRegexpMatcher extends AbstractPreparableMatcher {
/**
* Compile the pattern in a <code>org.apache.regexp.REProgram</code>.
1.2 +6 -2 cocoon-2.2/src/java/org/apache/cocoon/matching/HeaderMatcher.java
Index: HeaderMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/HeaderMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HeaderMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ HeaderMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -72,8 +72,12 @@
*
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
-public class HeaderMatcher implements Matcher, ThreadSafe
+public class HeaderMatcher implements Matcher
{
/**
* Match method to see if the request header exists. If it does
1.5 +3 -4 cocoon-2.2/src/java/org/apache/cocoon/matching/CookieMatcher.java
Index: CookieMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/CookieMatcher.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CookieMatcher.java 25 Oct 2003 22:11:42 -0000 1.4
+++ CookieMatcher.java 29 Dec 2003 15:24:35 -0000 1.5
@@ -68,9 +68,8 @@
* @version CVS $Id$
*
* @avalon.component
- * @avalon.service type="Matcher"
- * @x-avalon.lifestyle type="singleton"
- * @x-avalon.info name="cookie-matcher"
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
public class CookieMatcher extends AbstractLogEnabled implements Matcher {
1.2 +2 -2 cocoon-2.2/src/java/org/apache/cocoon/matching/AbstractWildcardMatcher.java
Index: AbstractWildcardMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/AbstractWildcardMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractWildcardMatcher.java 9 Mar 2003 00:09:33 -0000 1.1
+++ AbstractWildcardMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -64,7 +64,7 @@
* @version CVS $Id$
*/
-public abstract class AbstractWildcardMatcher extends AbstractPreparableMatcher implements ThreadSafe {
+public abstract class AbstractWildcardMatcher extends AbstractPreparableMatcher {
/**
* Compile the pattern in an <code>int[]</code>.
1.3 +2 -3 cocoon-2.2/src/java/org/apache/cocoon/matching/WildcardURIMatcher.java
Index: WildcardURIMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/WildcardURIMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WildcardURIMatcher.java 27 Dec 2003 15:11:57 -0000 1.2
+++ WildcardURIMatcher.java 29 Dec 2003 15:24:35 -0000 1.3
@@ -63,8 +63,7 @@
*
* @avalon.component
* @avalon.service type=Matcher
- * @x-avalon.lifestyle type=pooled
- * @x-avalon.info name=wildcard-uri-matcher
+ * @x-avalon.lifestyle type=singleton
*/
public class WildcardURIMatcher extends AbstractWildcardMatcher
{
1.2 +47 -56 cocoon-2.2/src/java/org/apache/cocoon/matching/modular/CachingWildcardMatcher.java
Index: CachingWildcardMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/modular/CachingWildcardMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CachingWildcardMatcher.java 9 Mar 2003 00:09:35 -0000 1.1
+++ CachingWildcardMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -50,23 +50,21 @@
*/
package org.apache.cocoon.matching.modular;
+import java.util.Map;
+
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.component.ComponentSelector;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.avalon.framework.component.Composable;
-import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
-
import org.apache.cocoon.components.modules.input.InputModule;
-
import org.apache.cocoon.matching.AbstractWildcardMatcher;
-
-import java.util.Map;
+import org.apache.cocoon.matching.Matcher;
/**
* Matches against a wildcard expression. Needs an input module to
@@ -82,32 +80,34 @@
* @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
public class CachingWildcardMatcher extends AbstractWildcardMatcher
- implements Configurable, Initializable, Composable, Disposable
+ implements Matcher, Serviceable, Configurable, Initializable, Disposable
{
/** The component manager instance */
- protected ComponentManager manager;
+ protected ServiceManager manager;
private String defaultParam;
private String defaultInput = "request-param"; // default to request parameters
private Configuration inputConf = null; // will become an empty configuration object
// during configure() so why bother here...
- String INPUT_MODULE_ROLE = InputModule.ROLE;
- String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
+
private boolean initialized = false;
private InputModule input = null;
- private ComponentSelector inputSelector = null;
/**
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
- public void compose(ComponentManager manager) throws ComponentException {
+ public void service(ServiceManager manager) throws ServiceException {
- this.manager=manager;
+ this.manager = manager;
}
@@ -122,48 +122,44 @@
public void initialize() {
-
+
try {
// obtain input module
- this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
- if (this.defaultInput != null &&
- this.inputSelector != null &&
- this.inputSelector.hasComponent(this.defaultInput)
- ){
- this.input = (InputModule) this.inputSelector.select(this.defaultInput);
- if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
- this.inputSelector.release(this.input);
- this.manager.release(this.inputSelector);
+ if (this.defaultInput != null && this.manager.hasService(InputModule.ROLE + "/" + this.defaultInput)) {
+ this.input = (InputModule) this.manager.lookup(InputModule.ROLE + "/" + this.defaultInput);
+ if (!(this.input instanceof ThreadSafe)) {
+ this.manager.release(this.input);
this.input = null;
- this.inputSelector = null;
}
this.initialized = true;
} else {
- if (getLogger().isErrorEnabled())
- getLogger().error("A problem occurred setting up '" + this.defaultInput
- + "': Selector is "+(this.inputSelector!=null?"not ":"")
- +"null, Component is "
- +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
+ if (getLogger().isErrorEnabled()) {
+ getLogger().error("A problem occurred setting up '" +
+ this.defaultInput + "'. Component is unknown.");
+
+ }
}
} catch (Exception e) {
- if (getLogger().isWarnEnabled())
- getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
+ if (getLogger().isWarnEnabled()) {
+ getLogger().warn("A problem occurred setting up '" +
+ this.defaultInput + "': " + e.getMessage());
+ }
}
}
public void dispose() {
-
- if (!this.initialized)
- if (getLogger().isErrorEnabled())
+ if (!this.initialized) {
+ if (getLogger().isErrorEnabled()) {
getLogger().error("Uninitialized Component! FAILING");
- else
- if (this.inputSelector != null) {
- if (this.input != null)
- this.inputSelector.release(this.input);
- this.manager.release(this.inputSelector);
}
+ }
+ else {
+ if (this.input != null) {
+ this.manager.release(this.input);
+ }
+ }
}
@@ -205,27 +201,22 @@
} else {
// input was not thread safe
// so acquire it again
- ComponentSelector iputSelector = null;
- InputModule iput = null;
+ InputModule module = null;
try {
// obtain input module
- iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
- if (inputName != null && iputSelector != null && iputSelector.hasComponent(inputName)){
- iput = (InputModule) iputSelector.select(inputName);
+ if (inputName != null && this.manager.hasService(InputModule.ROLE + "/" + inputName)){
+ module = (InputModule) this.manager.lookup(InputModule.ROLE + "/" + inputName);
}
- if (iput != null) {
- result = iput.getAttribute(paramName, this.inputConf, objectModel);
+ if (module != null) {
+ result = module.getAttribute(paramName, this.inputConf, objectModel);
}
} catch (Exception e) {
if (getLogger().isWarnEnabled())
getLogger().warn("A problem occurred acquiring Parameter '" + paramName
+ "' from '" + inputName + "': " + e.getMessage());
} finally {
- // release components
- if (iputSelector != null) {
- if (iput != null)
- iputSelector.release(iput);
- this.manager.release(iputSelector);
+ if (module != null) {
+ this.manager.release(module);
}
}
}
1.2 +39 -43 cocoon-2.2/src/java/org/apache/cocoon/matching/modular/CachingRegexpMatcher.java
Index: CachingRegexpMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/modular/CachingRegexpMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CachingRegexpMatcher.java 9 Mar 2003 00:09:35 -0000 1.1
+++ CachingRegexpMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -60,11 +60,15 @@
import org.apache.avalon.framework.component.Composable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.cocoon.components.modules.input.InputModule;
import org.apache.cocoon.matching.AbstractRegexpMatcher;
+import org.apache.cocoon.matching.Matcher;
import java.util.Map;
@@ -82,30 +86,31 @@
* @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Matcher
+ * @x-avalon.lifestyle type=singleton
*/
public class CachingRegexpMatcher extends AbstractRegexpMatcher
- implements Configurable, Initializable, Composable, Disposable
+ implements Matcher, Serviceable, Configurable, Initializable, Disposable
{
/** The component manager instance */
- protected ComponentManager manager;
+ protected ServiceManager manager;
private String defaultParam;
private String defaultInput = "request-param"; // default to request parameters
private Configuration inputConf = null; // will become an empty configuration object
// during configure() so why bother here...
- String INPUT_MODULE_ROLE = InputModule.ROLE;
- String INPUT_MODULE_SELECTOR = INPUT_MODULE_ROLE+"Selector";
private boolean initialized = false;
private InputModule input = null;
- private ComponentSelector inputSelector = null;
/**
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
- public void compose(ComponentManager manager) throws ComponentException {
+ public void service(ServiceManager manager) throws ServiceException {
this.manager=manager;
}
@@ -125,45 +130,41 @@
try {
// obtain input module
- this.inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
- if (this.defaultInput != null &&
- this.inputSelector != null &&
- this.inputSelector.hasComponent(this.defaultInput)
+ if (this.defaultInput != null && this.manager.hasService(InputModule.ROLE + "/" + this.defaultInput)
){
- this.input = (InputModule) this.inputSelector.select(this.defaultInput);
- if (!(this.input instanceof ThreadSafe && this.inputSelector instanceof ThreadSafe) ) {
- this.inputSelector.release(this.input);
- this.manager.release(this.inputSelector);
+ this.input = (InputModule) this.manager.lookup(InputModule.ROLE + "/" + this.defaultInput);
+ if (!(this.input instanceof ThreadSafe) ) {
+ this.manager.release(this.input);
this.input = null;
- this.inputSelector = null;
}
this.initialized = true;
} else {
- if (getLogger().isErrorEnabled())
- getLogger().error("A problem occurred setting up '" + this.defaultInput
- + "': Selector is "+(this.inputSelector!=null?"not ":"")
- +"null, Component is "
- +(this.inputSelector!=null&&this.inputSelector.hasComponent(this.defaultInput)?"known":"unknown"));
+ if (getLogger().isErrorEnabled()) {
+ getLogger().error("A problem occurred setting up '" +
+ this.defaultInput + "'. Component is unknown.");
+ }
}
} catch (Exception e) {
- if (getLogger().isWarnEnabled())
- getLogger().warn("A problem occurred setting up '" + this.defaultInput + "': " + e.getMessage());
+ if (getLogger().isWarnEnabled()) {
+ getLogger().warn("A problem occurred setting up '" +
+ this.defaultInput + "': " + e.getMessage());
+ }
}
}
public void dispose() {
-
- if (!this.initialized)
- if (getLogger().isErrorEnabled())
+ if (!this.initialized) {
+ if (getLogger().isErrorEnabled()) {
getLogger().error("Uninitialized Component! FAILING");
- else
- if (this.inputSelector != null) {
- if (this.input != null)
- this.inputSelector.release(this.input);
- this.manager.release(this.inputSelector);
}
+ }
+ else {
+ if (this.input != null) {
+ this.manager.release(this.input);
+ }
+ }
}
@@ -205,16 +206,13 @@
} else {
// input was not thread safe
// so acquire it again
- ComponentSelector iputSelector = null;
- InputModule iput = null;
+ InputModule module = null;
try {
- // obtain input module
- iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
- if (inputName != null && iputSelector != null && iputSelector.hasComponent(inputName)){
- iput = (InputModule) iputSelector.select(inputName);
+ if (inputName != null && this.manager.hasService(InputModule.ROLE + "/" + inputName)){
+ module = (InputModule) this.manager.lookup(InputModule.ROLE + "/" + inputName);
}
- if (iput != null) {
- result = iput.getAttribute(paramName, this.inputConf, objectModel);
+ if (module != null) {
+ result = module.getAttribute(paramName, this.inputConf, objectModel);
}
} catch (Exception e) {
if (getLogger().isWarnEnabled())
@@ -222,10 +220,8 @@
+ "' from '" + inputName + "': " + e.getMessage());
} finally {
// release components
- if (iputSelector != null) {
- if (iput != null)
- iputSelector.release(iput);
- this.manager.release(iputSelector);
+ if (module != null) {
+ this.manager.release(module);
}
}
}
1.2 +7 -4 cocoon-2.2/src/java/org/apache/cocoon/matching/modular/WildcardMatcher.java
Index: WildcardMatcher.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/matching/modular/WildcardMatcher.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WildcardMatcher.java 9 Mar 2003 00:09:35 -0000 1.1
+++ WildcardMatcher.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -54,6 +54,9 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.component.ComponentSelector;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
@@ -81,11 +84,11 @@
* @version CVS $Id$
*/
public class WildcardMatcher extends AbstractWildcardMatcher
- implements Configurable, Composable
+ implements Serviceable, Configurable
{
/** The component manager instance */
- protected ComponentManager manager;
+ protected ServiceManager manager;
private String defaultParam;
private String defaultInput = "request-param"; // default to request parameters
@@ -98,7 +101,7 @@
* Set the current <code>ComponentManager</code> instance used by this
* <code>Composable</code>.
*/
- public void compose(ComponentManager manager) throws ComponentException {
+ public void service(ServiceManager manager) throws ServiceException {
this.manager=manager;
}
1.8 +2 -2 cocoon-2.2/src/java/org/apache/cocoon/selection/ExceptionSelector.java
Index: ExceptionSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/ExceptionSelector.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ExceptionSelector.java 28 Dec 2003 20:59:12 -0000 1.7
+++ ExceptionSelector.java 29 Dec 2003 15:24:35 -0000 1.8
@@ -91,7 +91,7 @@
*
* @avalon.component
* @avalon.service type=Selector
- * @x-avalon.lifestyle type=pooled
+ * @x-avalon.lifestyle type=singleton
*/
public class ExceptionSelector extends AbstractSwitchSelector implements Configurable {
1.4 +6 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/ResourceExistsSelector.java
Index: ResourceExistsSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/ResourceExistsSelector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ResourceExistsSelector.java 12 Dec 2003 15:17:12 -0000 1.3
+++ ResourceExistsSelector.java 29 Dec 2003 15:24:35 -0000 1.4
@@ -58,7 +58,6 @@
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceNotFoundException;
import org.apache.excalibur.source.SourceResolver;
@@ -111,9 +110,13 @@
* @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Selector
+ * @x-avalon.lifestyle type=singleton
*/
public class ResourceExistsSelector extends AbstractLogEnabled
- implements ThreadSafe, Serviceable, Disposable, Selector {
+ implements Serviceable, Disposable, Selector {
private ServiceManager manager;
private SourceResolver resolver;
1.2 +2 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/SwitchSelector.java
Index: SwitchSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/SwitchSelector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SwitchSelector.java 9 Mar 2003 00:09:36 -0000 1.1
+++ SwitchSelector.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -51,7 +51,6 @@
package org.apache.cocoon.selection;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
import java.util.Map;
@@ -117,7 +116,7 @@
* @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
* @version CVS $Id$
*/
-public interface SwitchSelector extends Selector, ThreadSafe {
+public interface SwitchSelector extends Selector {
String ROLE = SwitchSelector.class.getName();
1.2 +2 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/Selector.java
Index: Selector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/Selector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Selector.java 9 Mar 2003 00:09:35 -0000 1.1
+++ Selector.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -50,7 +50,6 @@
*/
package org.apache.cocoon.selection;
-import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.parameters.Parameters;
import java.util.Map;
@@ -61,7 +60,7 @@
* @author <a href="mailto:leo.sutic">Leo Sutic</a>
* @version CVS $Id$
*/
-public interface Selector extends Component {
+public interface Selector {
String ROLE = Selector.class.getName();
/**
1.7 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/selection/XPathExceptionSelector.java
Index: XPathExceptionSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/XPathExceptionSelector.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XPathExceptionSelector.java 12 Aug 2003 06:01:40 -0000 1.6
+++ XPathExceptionSelector.java 29 Dec 2003 15:24:35 -0000 1.7
@@ -87,6 +87,10 @@
* @author <a href="mailto:bluetkemeier@s-und-n.de">Björn Lütkemeier</a>
* @since 2.1
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Selector
+ * @x-avalon.lifestyle type=singleton
*/
public class XPathExceptionSelector extends ExceptionSelector
implements Configurable {
1.2 +2 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/NamedPatternsSelector.java
Index: NamedPatternsSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/NamedPatternsSelector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NamedPatternsSelector.java 9 Mar 2003 00:09:35 -0000 1.1
+++ NamedPatternsSelector.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -54,7 +54,6 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.thread.ThreadSafe;
import java.util.ArrayList;
import java.util.HashMap;
@@ -73,7 +72,7 @@
*/
public abstract class NamedPatternsSelector extends AbstractLogEnabled
- implements Configurable, ThreadSafe, Selector {
+ implements Configurable, Selector {
/**
* Association of names to String[] of values.
1.3 +2 -2 cocoon-2.2/src/java/org/apache/cocoon/selection/BrowserSelector.java
Index: BrowserSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/BrowserSelector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BrowserSelector.java 28 Dec 2003 20:59:12 -0000 1.2
+++ BrowserSelector.java 29 Dec 2003 15:24:35 -0000 1.3
@@ -68,7 +68,7 @@
*
* @avalon.component
* @avalon.service type=Selector
- * @x-avalon.lifestyle type=pooled
+ * @x-avalon.lifestyle type=singleton
*/
public class BrowserSelector extends NamedPatternsSelector {
1.2 +6 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/ParameterSelector.java
Index: ParameterSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/ParameterSelector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ParameterSelector.java 9 Mar 2003 00:09:35 -0000 1.1
+++ ParameterSelector.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -51,7 +51,6 @@
package org.apache.cocoon.selection;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
import java.util.Map;
@@ -81,8 +80,12 @@
* @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
* @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Selector
+ * @x-avalon.lifestyle type=singleton
*/
-public class ParameterSelector implements ThreadSafe, Selector {
+public class ParameterSelector implements Selector {
public boolean select(String expression, Map objectModel, Parameters parameters) {
String compareToString = parameters.getParameter("parameter-selector-test", null);
1.3 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/selection/CookieSelector.java
Index: CookieSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/CookieSelector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CookieSelector.java 16 Mar 2003 17:49:15 -0000 1.2
+++ CookieSelector.java 29 Dec 2003 15:24:35 -0000 1.3
@@ -75,6 +75,10 @@
*
* @author <a href="mailto:matteodg@infinito.it">Matteo Di Giovinazzo</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Selector
+ * @x-avalon.lifestyle type=singleton
*/
public class CookieSelector extends AbstractLogEnabled
implements Configurable, Selector, ThreadSafe {
1.2 +6 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/RequestParameterSelector.java
Index: RequestParameterSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/RequestParameterSelector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RequestParameterSelector.java 9 Mar 2003 00:09:35 -0000 1.1
+++ RequestParameterSelector.java 29 Dec 2003 15:24:35 -0000 1.2
@@ -54,7 +54,6 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.cocoon.environment.ObjectModelHelper;
import java.util.Map;
@@ -73,9 +72,13 @@
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
* @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Selector
+ * @x-avalon.lifestyle type=singleton
*/
public class RequestParameterSelector extends AbstractSwitchSelector
- implements Configurable, ThreadSafe {
+ implements Configurable {
protected String defaultName;
1.3 +6 -3 cocoon-2.2/src/java/org/apache/cocoon/selection/SimpleSelector.java
Index: SimpleSelector.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/selection/SimpleSelector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SimpleSelector.java 1 Jul 2003 18:23:19 -0000 1.2
+++ SimpleSelector.java 29 Dec 2003 15:24:35 -0000 1.3
@@ -53,7 +53,6 @@
import java.util.Map;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
/**
* A very simple selector that operates on string literals, useful especially
@@ -81,8 +80,12 @@
* @author <a href="mailto:haul@apache.org">Christian Haul</a>
* @version CVS $Id$
* @since 2.1
+ *
+ * @avalon.component
+ * @avalon.service type=Selector
+ * @x-avalon.lifestyle type=singleton
*/
-public class SimpleSelector extends AbstractSwitchSelector implements ThreadSafe {
+public class SimpleSelector extends AbstractSwitchSelector {
public Object getSelectorContext(Map objectModel, Parameters parameters) {
return parameters.getParameter("value", "");
1.5 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/serialization/TextSerializer.java
Index: TextSerializer.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/serialization/TextSerializer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TextSerializer.java 6 Dec 2003 21:22:09 -0000 1.4
+++ TextSerializer.java 29 Dec 2003 15:24:35 -0000 1.5
@@ -74,6 +74,10 @@
*
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Serializer
+ * @x-avalon.lifestyle type=pooled
*/
public class TextSerializer extends AbstractTextSerializer {
1.8 +17 -24 cocoon-2.2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java
Index: ZipArchiveSerializer.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/serialization/ZipArchiveSerializer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ZipArchiveSerializer.java 6 Dec 2003 21:22:09 -0000 1.7
+++ ZipArchiveSerializer.java 29 Dec 2003 15:24:35 -0000 1.8
@@ -59,10 +59,9 @@
import java.util.zip.ZipOutputStream;
import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.avalon.framework.component.ComponentSelector;
-import org.apache.avalon.framework.component.Composable;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceResolver;
import org.xml.sax.Attributes;
@@ -103,6 +102,10 @@
*
* @author <a href="http://www.apache.org/~sylvain">Sylvain Wallez</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Serializer
+ * @x-avalon.lifestyle type=pooled
*/
// TODO (1) : handle more attributes on <archive> for properties of ZipOutputStream
@@ -113,7 +116,7 @@
public class ZipArchiveSerializer
extends AbstractSerializer
- implements Composable, Disposable {
+ implements Serviceable, Disposable {
/**
* The namespace for elements handled by this serializer,
@@ -126,10 +129,7 @@
private static final int IN_CONTENT_STATE = 2;
/** The component manager */
- protected ComponentManager manager;
-
- /** The serializer component selector */
- protected ComponentSelector selector;
+ protected ServiceManager manager;
/** The Zip stream where entries will be written */
protected ZipOutputStream zipOutput;
@@ -160,10 +160,12 @@
/**
* @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
+ *
+ * @avalon.dependency type=SourceResolver
*/
- public void compose(ComponentManager manager) throws ComponentException {
+ public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
- this.resolver = (SourceResolver)this.manager.lookup( SourceResolver.ROLE);
+ this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
}
/**
@@ -309,14 +311,8 @@
this.zipOutput.closeEntry();
} else {
- // Serialize content
- if (this.selector == null) {
- this.selector =
- (ComponentSelector) this.manager.lookup(Serializer.ROLE + "Selector");
- }
-
// Get the serializer
- this.serializer = (Serializer) this.selector.select(serializerType);
+ this.serializer = (Serializer) this.manager.lookup(Serializer.ROLE + "/" + serializerType);
// Direct its output to the zip file, filtering calls to close()
// (we don't want the archive to be closed by the serializer)
@@ -387,7 +383,7 @@
}
super.setConsumer(null);
- this.selector.release(this.serializer);
+ this.manager.release(this.serializer);
this.serializer = null;
// Go back to listening for entries
@@ -416,10 +412,7 @@
public void recycle() {
this.exception = null;
if (this.serializer != null) {
- this.selector.release(this.serializer);
- }
- if (this.selector != null) {
- this.manager.release(this.selector);
+ this.manager.release(this.serializer);
}
this.nsSupport.reset();
1.4 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/reading/ImageReader.java
Index: ImageReader.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/reading/ImageReader.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ImageReader.java 24 Sep 2003 21:41:11 -0000 1.3
+++ ImageReader.java 29 Dec 2003 15:24:35 -0000 1.4
@@ -93,6 +93,10 @@
* @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
* @author <a href="mailto:tcurdt@apache.org">Torsten Curdt</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Reader
+ * @x-avalon.lifestyle type=pooled
*/
final public class ImageReader extends ResourceReader {
1.4 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/generation/StatusGenerator.java
Index: StatusGenerator.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/generation/StatusGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StatusGenerator.java 27 Oct 2003 07:29:31 -0000 1.3
+++ StatusGenerator.java 29 Dec 2003 15:24:35 -0000 1.4
@@ -99,6 +99,10 @@
* @author <a href="mailto:skoechlin@ivision.fr">Sébastien Kœchlin</a> (iVision)
* @author <a href="mailto:g-froehlich@gmx.de">Gerhard Froehlich</a>
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Generator
+ * @x-avalon.lifestyle type=pooled
*/
public class StatusGenerator extends ServiceableGenerator {
1.8 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java
Index: LinkStatusGenerator.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LinkStatusGenerator.java 6 Dec 2003 21:22:08 -0000 1.7
+++ LinkStatusGenerator.java 29 Dec 2003 15:24:35 -0000 1.8
@@ -85,6 +85,10 @@
* @author Nicola Ken Barozzi (nicolaken@apache.org)
* @author Bernhard Huber (huber@apache.org)
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Generator
+ * @x-avalon.lifestyle type=pooled
*/
public class LinkStatusGenerator extends ServiceableGenerator implements Recyclable, Configurable {
/** The URI of the namespace of this generator. */
1.24 +5 -1 cocoon-2.2/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
Index: JXTemplateGenerator.java
===================================================================
RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- JXTemplateGenerator.java 10 Dec 2003 16:46:26 -0000 1.23
+++ JXTemplateGenerator.java 29 Dec 2003 15:24:35 -0000 1.24
@@ -357,6 +357,10 @@
* </pre></p>
*
* @version CVS $Id$
+ *
+ * @avalon.component
+ * @avalon.service type=Generator
+ * @x-avalon.lifestyle type=pooled
*/
public class JXTemplateGenerator extends ServiceableGenerator {