Author: cziegeler Date: Thu Jan 13 11:01:27 2005 New Revision: 125090 URL: http://svn.apache.org/viewcvs?view=rev&rev=125090 Log: Rename ServiceInfo to ComponentInfo - everything else is using the term "component" Update/fix license headers Added: cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java - copied, changed from r125086, cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java Removed: cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java
Copied: cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java (from r125086, cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java) Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java&r1=125086&p2=cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,9 @@ * * @version CVS $Id$ */ -public class ServiceInfo { +public final class ComponentInfo { + public static final int MODEL_UNKNOWN = -1; public static final int MODEL_PRIMITIVE = 0; public static final int MODEL_SINGLETON = 1; public static final int MODEL_POOLED = 2; @@ -36,7 +37,7 @@ private String serviceClassName; private Configuration configuration; - public ServiceInfo() { + public ComponentInfo() { this.model = MODEL_PRIMITIVE; } @@ -152,11 +153,11 @@ // test model final String model = attr.getAttribute("model", null); if ( "pooled".equals(model) ) { - this.setModel(ServiceInfo.MODEL_POOLED); + this.setModel(ComponentInfo.MODEL_POOLED); this.setPoolInMethodName(attr.getAttribute("pool-in", null)); this.setPoolOutMethodName(attr.getAttribute("pool-out", null)); } else if ( "singleton".equals(model) ) { - this.setModel(ServiceInfo.MODEL_SINGLETON); + this.setModel(ComponentInfo.MODEL_SINGLETON); } this.setInitMethodName(attr.getAttribute("init", null)); this.setDestroyMethodName(attr.getAttribute("destroy", null)); Deleted: /cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/components/ServiceInfo.java?view=auto&rev=125089 ============================================================================== Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,13 +19,12 @@ import org.apache.avalon.excalibur.pool.Poolable; import org.apache.avalon.framework.component.Composable; import org.apache.avalon.framework.configuration.Configuration; -import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.context.Context; import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.thread.SingleThreaded; import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * This class acts like a Factory to instantiate the correct version @@ -47,23 +46,21 @@ /** State management boolean stating whether the Handler is initialized or not */ private boolean initialized = false; - private ServiceInfo info; + /** Information about the component */ + private ComponentInfo info; /** * Looks up and returns a component handler for a given component class. * * @param role the component's role. Can be <code>null</code> if the role isn't known. - * @param className Class of the component for which the handle is - * being requested. - * @param configuration The configuration for this component. * @param componentEnv The component's creation environment. + * @param info The description of the component (configuration, lifecycle etc.) * * @throws Exception If there were any problems obtaining a ComponentHandler */ - public static ComponentHandler getComponentHandler( - String role, - ComponentEnvironment componentEnv, - ServiceInfo info) + public static ComponentHandler getComponentHandler(String role, + ComponentEnvironment componentEnv, + ComponentInfo info) throws Exception { // Load the class @@ -71,8 +68,8 @@ try { componentClass = componentEnv.loadClass(info.getServiceClassName()); - } catch(ClassNotFoundException cnfe) { - throw new ConfigurationException("Cannot find class " + info.getServiceClassName() + " for component at " + + } catch (ClassNotFoundException cnfe) { + throw new Exception("Cannot find class " + info.getServiceClassName() + " for component at " + info.getConfiguration().getLocation(), cnfe); } @@ -86,17 +83,17 @@ if( SingleThreaded.class.isAssignableFrom( componentClass ) ) { numInterfaces++; - info.setModel(ServiceInfo.MODEL_PRIMITIVE); + info.setModel(ComponentInfo.MODEL_PRIMITIVE); } if( ThreadSafe.class.isAssignableFrom( componentClass ) ) { numInterfaces++; - info.setModel(ServiceInfo.MODEL_SINGLETON); + info.setModel(ComponentInfo.MODEL_SINGLETON); } if( Poolable.class.isAssignableFrom( componentClass ) ) { numInterfaces++; - info.setModel(ServiceInfo.MODEL_POOLED); + info.setModel(ComponentInfo.MODEL_POOLED); } if( numInterfaces > 1 ) { @@ -129,9 +126,9 @@ factory = new ComponentFactory(componentEnv, info); } - if( info.getModel() == ServiceInfo.MODEL_POOLED ) { + if( info.getModel() == ComponentInfo.MODEL_POOLED ) { handler = new PoolableComponentHandler( info, componentEnv.logger, factory, info.getConfiguration() ); - } else if( info.getModel() == ServiceInfo.MODEL_SINGLETON ) { + } else if( info.getModel() == ComponentInfo.MODEL_SINGLETON ) { handler = new ThreadSafeComponentHandler( info, componentEnv.logger, factory ); } else { // This is a SingleThreaded component @@ -144,12 +141,12 @@ /** * Creates a new ComponentHandler. */ - public AbstractComponentHandler(ServiceInfo info, Logger logger) { + public AbstractComponentHandler(ComponentInfo info, Logger logger) { this.logger = logger; this.info = info; } - public ServiceInfo getInfo() { + public ComponentInfo getInfo() { return this.info; } @@ -270,10 +267,11 @@ /** * Create a component handler (version used by XSP) + * TODO - perhaps we can remove this later? */ public static ComponentHandler getComponentHandler(Class clazz, Logger logger, Context context, ServiceManager manager, Configuration config) throws Exception { ComponentEnvironment env = new ComponentEnvironment(clazz.getClassLoader(), logger, null, null, context, manager); - ServiceInfo info = new ServiceInfo(); + ComponentInfo info = new ComponentInfo(); info.setServiceClassName(clazz.getName()); info.setConfiguration(config); return getComponentHandler(null, env, info); Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractFactoryHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ package org.apache.cocoon.core.container; import org.apache.avalon.framework.logger.Logger; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * This class acts like a Factory to instantiate the correct version @@ -33,7 +33,7 @@ /** * Creates a new ComponentHandler. */ - public AbstractFactoryHandler(ServiceInfo info, Logger logger, ComponentFactory factory) { + public AbstractFactoryHandler(ComponentInfo info, Logger logger, ComponentFactory factory) { super(info, logger); this.factory = factory; } Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,7 +31,7 @@ import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * Base class for all service managers: ServiceManager and ServiceSelector @@ -105,7 +105,7 @@ this.loggerManager, this.context, serviceManager); } - ServiceInfo info = new ServiceInfo(); + ComponentInfo info = new ComponentInfo(); info.setConfiguration(configuration); info.setServiceClassName(componentClass.getName()); Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AliasComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ package org.apache.cocoon.core.container; import org.apache.avalon.framework.logger.Logger; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * A component handler used to alias roles: it delegates all its calls to another @@ -30,7 +30,7 @@ ComponentHandler aliasedHandler; public AliasComponentHandler(Logger logger, ComponentHandler aliasedHandler) { - super(new ServiceInfo(), logger); + super(new ComponentInfo(), logger); getInfo().setConfiguration(CoreServiceManager.EMPTY_CONFIGURATION); this.aliasedHandler = aliasedHandler; } Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CocoonServiceSelector.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentEnvironment.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentFactory.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,7 @@ import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.parameters.Parameterizable; import org.apache.avalon.framework.parameters.Parameters; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * Factory for Avalon based components. @@ -32,7 +32,7 @@ */ public class ComponentFactory { - protected final ServiceInfo serviceInfo; + protected final ComponentInfo serviceInfo; protected final ComponentEnvironment environment; @@ -61,7 +61,7 @@ * */ public ComponentFactory( final ComponentEnvironment environment, - final ServiceInfo info) + final ComponentInfo info) throws Exception { this.environment = environment; this.serviceInfo = info; @@ -70,7 +70,7 @@ // If the handler is created "manually" (e.g. XSP engine), loggerManager can be null if( this.environment.loggerManager != null && this.serviceInfo.getConfiguration() != null) { final String category = this.serviceInfo.getConfiguration().getAttribute("logger", null); - if(category != null) { + if (category != null) { actualLogger = this.environment.loggerManager.getLoggerForCategory(category); } } Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,7 +16,7 @@ */ package org.apache.cocoon.core.container; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * This class acts like a Factory to instantiate the correct version @@ -74,6 +74,6 @@ /** * Get the service metadata for this handler */ - ServiceInfo getInfo(); + ComponentInfo getInfo(); } Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ConfigurationBuilder.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2004 The Apache Software Foundation + * Copyright 2004-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -42,7 +42,7 @@ import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; import org.apache.cocoon.core.source.SimpleSourceResolver; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceResolver; @@ -322,7 +322,7 @@ } if( this.roleManager != null ) { - final ServiceInfo info = this.roleManager.getDefaultServiceInfoForRole( role ); + final ComponentInfo info = this.roleManager.getDefaultServiceInfoForRole( role ); if( info != null ) { if( this.getLogger().isDebugEnabled() ) { @@ -513,7 +513,7 @@ ComponentHandler handler = (ComponentHandler)this.componentHandlers.get(role); if (handler != null) { - ServiceInfo info = handler.getInfo(); + ComponentInfo info = handler.getInfo(); throw new ServiceException(role, "Component already defined at " + info.getLocation()); } @@ -577,7 +577,7 @@ final String className, final Configuration configuration) throws Exception { - ServiceInfo info = new ServiceInfo(); + ComponentInfo info = new ComponentInfo(); info.setConfiguration(configuration); info.setServiceClassName(className); @@ -619,7 +619,7 @@ String className = componentConfig.getAttribute("class", null); if (className == null) { // Get the default class name for this role - final ServiceInfo info = roleManager.getDefaultServiceInfoForRole(role); + final ComponentInfo info = roleManager.getDefaultServiceInfoForRole(role); if (info == null) { throw new ConfigurationException("Cannot find a class for role " + role + " at " + componentConfig.getLocation()); } @@ -772,7 +772,7 @@ ComponentHandler existingHandler) throws ConfigurationException { // We only allow selectors to be overloaded - ServiceInfo info = existingHandler.getInfo(); + ComponentInfo info = existingHandler.getInfo(); if (!className.equals(info.getServiceClassName())) { throw new ConfigurationException("Role " + role + " redefined with a different class name, at " + config.getLocation()); Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -26,7 +26,7 @@ import org.apache.avalon.framework.service.ServiceSelector; import org.apache.avalon.framework.service.Serviceable; import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * Default component selector for Cocoon's components. This selector "flattens" its declaration @@ -93,7 +93,7 @@ if (compInstanceName == null) { // component-instance implicitly defined by the presence of the 'class' attribute if (classAttr == null) { - final ServiceInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); + final ComponentInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); className = info.getServiceClassName(); } else { className = classAttr; @@ -104,7 +104,7 @@ if (compInstanceName.equals(instance.getName())) { className = (classAttr == null) ? null : classAttr; } else { - final ServiceInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); + final ComponentInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); className = info.getServiceClassName(); } } @@ -192,7 +192,7 @@ public static class Factory extends ComponentFactory { private final String role; - public Factory(ComponentEnvironment env, ServiceInfo info, String role) + public Factory(ComponentEnvironment env, ComponentInfo info, String role) throws Exception { super(env, info); this.role = role; Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/InstanceComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -18,7 +18,7 @@ import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.logger.Logger; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * A component handler for instances created outside the container. @@ -33,7 +33,7 @@ * Creates a new ComponentHandler. */ public InstanceComponentHandler(Logger logger, Object obj) { - super(new ServiceInfo(), logger); + super(new ComponentInfo(), logger); // For info.getLocation() to work properly this.getInfo().setConfiguration(CoreServiceManager.EMPTY_CONFIGURATION); this.obj = obj; Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/LazyHandler.java Thu Jan 13 11:01:27 2005 @@ -1,20 +1,28 @@ -/* - * Created on Jan 3, 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates +/* + * Copyright 2002-2005 The Apache Software Foundation + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.cocoon.core.container; import org.apache.avalon.framework.CascadingRuntimeException; import org.apache.avalon.framework.configuration.Configuration; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** - * @author sylvain - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + * + * @version SVN $Id$ */ public class LazyHandler implements ComponentHandler { @@ -35,7 +43,7 @@ private ComponentHandler getDelegate() throws Exception { if (this.delegate == null) { // System.err.println("######## " + System.identityHashCode(compEnv.serviceManager) + " creating handler for " + this.role); - ServiceInfo info = new ServiceInfo(); + ComponentInfo info = new ComponentInfo(); info.setConfiguration(config); info.setServiceClassName(className); @@ -106,9 +114,9 @@ /* (non-Javadoc) * @see org.apache.cocoon.core.container.ComponentHandler#getInfo() */ - public ServiceInfo getInfo() { + public ComponentInfo getInfo() { if (this.delegate == null) { - final ServiceInfo info = new ServiceInfo(); + final ComponentInfo info = new ComponentInfo(); info.setServiceClassName(className); info.setConfiguration(config); return info; Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/PoolableComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,7 +21,7 @@ import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.logger.Logger; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * The PoolableComponentHandler to make sure that poolable components are initialized @@ -91,7 +91,7 @@ * managed by the ComponentHandler. * @param config The configuration to use to configure the pool. */ - public PoolableComponentHandler( final ServiceInfo info, + public PoolableComponentHandler( final ComponentInfo info, final Logger logger, final ComponentFactory factory, final Configuration config ) Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/RoleManager.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,7 @@ import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.logger.AbstractLogEnabled; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * Default RoleManager implementation. It populates the RoleManager @@ -98,8 +98,8 @@ * @param role The role that has a default implementation. * @return the Fully Qualified Class Name (FQCN) for the role. */ - public final ServiceInfo getDefaultServiceInfoForRole( final String role ) { - final ServiceInfo info = (ServiceInfo)this.classNames.get( role ); + public final ComponentInfo getDefaultServiceInfoForRole( final String role ) { + final ComponentInfo info = (ComponentInfo)this.classNames.get( role ); if( info == null && this.parent != null ) { return this.parent.getDefaultServiceInfoForRole( role ); @@ -120,7 +120,7 @@ * @param shorthand The shorthand name for the type of component * @return the FQCN for the role/key combination. */ - public final ServiceInfo getDefaultServiceInfoForKey( final String role, + public final ComponentInfo getDefaultServiceInfoForKey( final String role, final String shorthand ) { if( this.getLogger().isDebugEnabled() ) { this.getLogger().debug( "looking up keymap for role " + role ); @@ -139,7 +139,7 @@ this.getLogger().debug( "looking up classname for key " + shorthand ); } - final ServiceInfo s = ( ServiceInfo ) keyMap.get( shorthand ); + final ComponentInfo s = ( ComponentInfo ) keyMap.get( shorthand ); if( s == null && this.parent != null ) { return this.parent.getDefaultServiceInfoForKey( role, shorthand ); @@ -187,10 +187,10 @@ } if( defaultClassName != null ) { - ServiceInfo info = (ServiceInfo)this.classNames.get(roleName); + ComponentInfo info = (ComponentInfo)this.classNames.get(roleName); if (info == null) { // Create a new info and store it - info = new ServiceInfo(); + info = new ComponentInfo(); info.setServiceClassName(defaultClassName); info.fill(role); this.classNames.put(roleName, info); @@ -218,9 +218,9 @@ final String shortHand = key.getAttribute( "shorthand" ).trim(); final String className = key.getAttribute( "class" ).trim(); - ServiceInfo info = (ServiceInfo)keyMap.get(shortHand); + ComponentInfo info = (ComponentInfo)keyMap.get(shortHand); if (info == null) { - info = new ServiceInfo(); + info = new ComponentInfo(); info.setServiceClassName(className); info.fill(key); Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/SingleThreadedComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ package org.apache.cocoon.core.container; import org.apache.avalon.framework.logger.Logger; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * The DefaultComponentHandler to make sure components are initialized @@ -36,7 +36,7 @@ * @param factory The factory object which is responsible for creating the components * managed by the handler. */ - public SingleThreadedComponentHandler( final ServiceInfo info, + public SingleThreadedComponentHandler( final ComponentInfo info, final Logger logger, final ComponentFactory factory ) { super(info, logger, factory); Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -28,7 +28,7 @@ import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.service.ServiceSelector; import org.apache.avalon.framework.service.Serviceable; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * Default component selector for Cocoon's components. @@ -240,7 +240,7 @@ if (compInstanceName == null) { // component-instance implicitly defined by the presence of the 'class' attribute if (classAttr == null) { - final ServiceInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); + final ComponentInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); className = info.getServiceClassName(); } else { className = classAttr.trim(); @@ -251,7 +251,7 @@ if (compInstanceName.equals(instance.getName())) { className = (classAttr == null) ? null : classAttr.trim(); } else { - final ServiceInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); + final ComponentInfo info = this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName()); className = info.getServiceClassName(); } } @@ -460,7 +460,7 @@ private final String role; - public Factory(ComponentEnvironment env, ServiceInfo info, String role) + public Factory(ComponentEnvironment env, ComponentInfo info, String role) throws Exception { super(env, info); this.role = role; Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/ThreadSafeComponentHandler.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ package org.apache.cocoon.core.container; import org.apache.avalon.framework.logger.Logger; -import org.apache.cocoon.components.ServiceInfo; +import org.apache.cocoon.components.ComponentInfo; /** * The ThreadSafeComponentHandler to make sure components are initialized @@ -37,7 +37,7 @@ * @param factory The factory object which is responsible for creating the components * managed by the handler. */ - public ThreadSafeComponentHandler( final ServiceInfo info, + public ThreadSafeComponentHandler( final ComponentInfo info, final Logger logger, final ComponentFactory factory ) { super(info, logger, factory); Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/util/PropertyHelper.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java?view=diff&rev=125090&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java&r1=125089&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java&r2=125090 ============================================================================== --- cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java (original) +++ cocoon/trunk/src/core/java/org/apache/cocoon/core/source/SimpleSourceResolver.java Thu Jan 13 11:01:27 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 The Apache Software Foundation + * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at