You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by be...@apache.org on 2006/10/27 19:21:55 UTC
svn commit: r468459 [3/3] - in /james/server/sandbox/spring-integration:
lib/ src/ src/main/ src/main/config/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/james/
src/main/java/org/apache/james/container/ src/main...
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/LoggerAdaptor.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/LoggerAdaptor.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/LoggerAdaptor.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/LoggerAdaptor.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,104 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.adaptor;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.james.container.spring.logging.LoggerToComponentMapper;
+
+public class LoggerAdaptor implements Logger, LoggerToComponentMapper {
+ private boolean m_debugEnabled = true;
+
+ public Logger getComponentLogger(String beanName) {
+ return this; // every bean gets the same logger
+ }
+
+ public void debug(java.lang.String string) {
+ System.out.println(string);
+ }
+
+ public void debug(java.lang.String string, java.lang.Throwable throwable) {
+ System.out.println(string + throwable.toString());
+ throwable.printStackTrace();
+ }
+
+ public boolean isDebugEnabled() {
+ return m_debugEnabled;
+ }
+
+ public void disableDebug() {
+ m_debugEnabled = false;
+ }
+
+ public void info(java.lang.String string) {
+ System.out.println(string);
+ }
+
+ public void info(java.lang.String string, java.lang.Throwable throwable) {
+ System.out.println(string + throwable.toString());
+ throwable.printStackTrace();
+ }
+
+ public boolean isInfoEnabled() {
+ return true;
+ }
+
+ public void warn(java.lang.String string) {
+ System.out.println(string);
+ }
+
+ public void warn(java.lang.String string, java.lang.Throwable throwable) {
+ System.out.println(string + throwable.toString());
+ throwable.printStackTrace();
+ }
+
+ public boolean isWarnEnabled() {
+ return true;
+ }
+
+ public void error(java.lang.String string) {
+ System.out.println(string);
+ }
+
+ public void error(java.lang.String string, java.lang.Throwable throwable) {
+ System.out.println(string + throwable.toString());
+ throwable.printStackTrace();
+ }
+
+ public boolean isErrorEnabled() {
+ return true;
+ }
+
+ public void fatalError(java.lang.String string) {
+ System.out.println(string);
+ }
+
+ public void fatalError(java.lang.String string, java.lang.Throwable throwable) {
+ System.out.println(string + throwable.toString());
+ throwable.printStackTrace();
+ }
+
+ public boolean isFatalErrorEnabled() {
+ return true;
+ }
+
+ public org.apache.avalon.framework.logger.Logger getChildLogger(java.lang.String string) {
+ return this;
+ }
+
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/ServiceManagerBridge.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/ServiceManagerBridge.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/ServiceManagerBridge.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/adaptor/ServiceManagerBridge.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,77 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.adaptor;
+
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceException;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationContext;
+import org.springframework.beans.BeansException;
+
+import java.util.Map;
+
+/**
+ * provides a Avalon-style service manager to all James components
+ */
+public class ServiceManagerBridge implements ServiceManager, ApplicationContextAware {
+
+ private ApplicationContext applicationContext;
+
+ public Object lookup(String componentIdentifier) throws ServiceException {
+ Object component = lookupByClassname(componentIdentifier);
+ if (component == null) component = lookupByBeanname(componentIdentifier);
+
+ if (component == null) throw new ServiceException("could not resolve dependency " + componentIdentifier); // adhere to avalon service manager contract
+ return component;
+ }
+
+ private Object lookupByClassname(String componentIdentifier) {
+ Class lookupClass = null;
+ try {
+ lookupClass = Class.forName(componentIdentifier);
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ Map beansOfType = applicationContext.getBeansOfType(lookupClass);
+ if (beansOfType.size() > 1) throw new RuntimeException("not yet supported");
+ if (beansOfType.size() == 0) return null; // try other method
+ Object bean = beansOfType.values().iterator().next();
+ return bean;
+ }
+
+ private Object lookupByBeanname(String componentIdentifier) {
+ return applicationContext.getBean(componentIdentifier);
+ }
+
+ public boolean hasService(String componentIdentifier) {
+ try {
+ return null != lookup(componentIdentifier);
+ } catch (ServiceException e) {
+ return false;
+ }
+ }
+
+ public void release(Object object) {
+ throw new IllegalStateException("not yet implemented");
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ this.applicationContext = applicationContext;
+ }
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/AbstractPropagator.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/AbstractPropagator.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/AbstractPropagator.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/AbstractPropagator.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,45 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.lifecycle;
+
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.BeanFactoryUtils;
+import org.springframework.beans.BeansException;
+
+/**
+ * basis for iterating over all spring beans having some specific implementation
+ */
+public abstract class AbstractPropagator {
+
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
+
+ Class lifecycleInterface = getLifecycleInterface();
+ String[] beanNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(configurableListableBeanFactory, lifecycleInterface);
+ for (int i = 0; i < beanNames.length; i++) {
+ String beanName = beanNames[i];
+
+ Object bean = configurableListableBeanFactory.getBean(beanName);
+ invokeLifecycleWorker(beanName, bean);
+ }
+ }
+
+ protected abstract Class getLifecycleInterface();
+
+ protected abstract void invokeLifecycleWorker(String beanName, Object bean);
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ConfigurationPropagator.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ConfigurationPropagator.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ConfigurationPropagator.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ConfigurationPropagator.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,76 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.lifecycle;
+
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.james.container.spring.adaptor.ConfigurationProvider;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.core.Ordered;
+
+/**
+ * calls configure() for all avalon components
+ */
+public class ConfigurationPropagator extends AbstractPropagator implements BeanFactoryPostProcessor, Ordered {
+ private Configuration configuration;
+
+ private boolean isConfigurationEmpty(Configuration componentConfiguration) {
+ return (componentConfiguration.getChildren() == null || componentConfiguration.getChildren().length == 0)
+ && (componentConfiguration.getAttributeNames() == null || componentConfiguration.getAttributeNames().length == 0);
+ }
+
+ public int getOrder() {
+ return 3;
+ }
+
+ protected Class getLifecycleInterface() {
+ return Configurable.class;
+ }
+
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
+
+ // prepare load data
+ ConfigurationProvider configurationProvider = (ConfigurationProvider) configurableListableBeanFactory.getBean("configurationProvider");
+ configuration = configurationProvider.getConfiguration();
+
+ super.postProcessBeanFactory(configurableListableBeanFactory);
+ }
+
+ protected void invokeLifecycleWorker(String beanName, Object bean) {
+ Configurable configurable = (Configurable)bean;
+ try {
+ Configuration componentConfiguration = configuration.getChild(beanName);
+ if (isConfigurationEmpty(componentConfiguration)) {
+ // heuristic: try lowercase
+ componentConfiguration = configuration.getChild(beanName.toLowerCase());
+ }
+ if (isConfigurationEmpty(componentConfiguration)) {
+ System.out.println("configuraton empty for bean " + beanName);
+ }
+ configurable.configure(componentConfiguration);
+ } catch (ConfigurationException e) {
+ //throw new RuntimeException("could not configure component of type " + configurable.getClass(), e);
+ } catch (Exception e) {
+ //throw new RuntimeException("could not configure component of type " + serviceable.getClass(), e);
+ }
+ }
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ContextPropagator.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ContextPropagator.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ContextPropagator.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ContextPropagator.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,58 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.lifecycle;
+
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.core.Ordered;
+
+/**
+ * calls contextualize() for all avalon components
+ */
+public class ContextPropagator extends AbstractPropagator implements BeanFactoryPostProcessor, Ordered {
+ private Context context;
+
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
+
+ context = (Context) configurableListableBeanFactory.getBean("avalonContext");
+
+ super.postProcessBeanFactory(configurableListableBeanFactory);
+ }
+
+ protected Class getLifecycleInterface() {
+ return Contextualizable.class;
+ }
+
+ protected void invokeLifecycleWorker(String beanName, Object bean) {
+ Contextualizable contextualizable = (Contextualizable) bean;
+ try {
+ contextualizable.contextualize(context);
+ } catch (ContextException e) {
+ throw new RuntimeException("could not successfully run contextualize method on component of type " + contextualizable.getClass(), e);
+ }
+ }
+
+ public int getOrder() {
+ return 1;
+ }
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/InitializationPropagator.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/InitializationPropagator.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/InitializationPropagator.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/InitializationPropagator.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,47 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.lifecycle;
+
+import org.apache.avalon.framework.activity.Initializable;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.core.Ordered;
+
+/**
+ * calls initialize() for all avalon components
+ */
+public class InitializationPropagator extends AbstractPropagator implements BeanFactoryPostProcessor, Ordered {
+
+ protected Class getLifecycleInterface() {
+ return Initializable.class;
+ }
+
+ protected void invokeLifecycleWorker(String beanName, Object bean) {
+ Initializable initializable = (Initializable) bean;
+ try {
+ initializable.initialize();
+ } catch (Exception e) {
+ throw new RuntimeException("could not initialize component of type " + initializable.getClass(), e);
+ }
+ }
+
+ public int getOrder() {
+ return 4;
+ }
+
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/LoggerPropagator.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/LoggerPropagator.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/LoggerPropagator.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/LoggerPropagator.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,54 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.lifecycle;
+
+import org.apache.avalon.framework.logger.LogEnabled;
+import org.apache.james.container.spring.logging.LoggerToComponentMapper;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.core.Ordered;
+
+/**
+ * propagates Loggers for all avalon components
+ */
+public class LoggerPropagator extends AbstractPropagator implements BeanFactoryPostProcessor, Ordered {
+ private LoggerToComponentMapper loggerToComponentMapper;
+
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
+
+ loggerToComponentMapper = (LoggerToComponentMapper) configurableListableBeanFactory.getBean("loggerMap");
+
+ super.postProcessBeanFactory(configurableListableBeanFactory);
+ }
+
+ protected Class getLifecycleInterface() {
+ return LogEnabled.class;
+ }
+
+ protected void invokeLifecycleWorker(String beanName, Object bean) {
+ LogEnabled logEnabled = (LogEnabled) bean;
+ logEnabled.enableLogging(loggerToComponentMapper.getComponentLogger(beanName));
+ }
+
+ public int getOrder() {
+ return 0;
+ }
+
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ServicePropagator.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ServicePropagator.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ServicePropagator.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/lifecycle/ServicePropagator.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,41 @@
+package org.apache.james.container.spring.lifecycle;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.james.container.spring.adaptor.ServiceManagerBridge;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.core.Ordered;
+
+/**
+ * calls service() for all avalon components
+ */
+public class ServicePropagator extends AbstractPropagator implements BeanFactoryPostProcessor, Ordered {
+
+ private ServiceManagerBridge serviceManager;
+
+ public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
+
+ serviceManager = (ServiceManagerBridge) configurableListableBeanFactory.getBean("serviceManager");
+
+ super.postProcessBeanFactory(configurableListableBeanFactory);
+ }
+
+ protected Class getLifecycleInterface() {
+ return Serviceable.class;
+ }
+
+ protected void invokeLifecycleWorker(String beanName, Object bean) {
+ Serviceable serviceable = (Serviceable) bean;
+ try {
+ serviceable.service(serviceManager);
+ } catch (ServiceException e) {
+ throw new RuntimeException("could not successfully run service method on component of type " + serviceable.getClass(), e);
+ }
+ }
+
+ public int getOrder() {
+ return 2;
+ }
+}
Added: james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/logging/LoggerToComponentMapper.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/logging/LoggerToComponentMapper.java?view=auto&rev=468459
==============================================================================
--- james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/logging/LoggerToComponentMapper.java (added)
+++ james/server/sandbox/spring-integration/src/main/java/org/apache/james/container/spring/logging/LoggerToComponentMapper.java Fri Oct 27 10:21:53 2006
@@ -0,0 +1,28 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.james.container.spring.logging;
+
+import org.apache.avalon.framework.logger.Logger;
+
+/**
+ * retrieves the right Logger for each component
+ */
+public interface LoggerToComponentMapper {
+ Logger getComponentLogger(String beanName);
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org