You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/12/17 21:01:47 UTC
svn commit: r891862 [1/2] - in /incubator/openwebbeans/trunk:
webbeans-impl/src/main/java/org/apache/webbeans/component/
webbeans-impl/src/main/java/org/apache/webbeans/component/xml/
webbeans-impl/src/main/java/org/apache/webbeans/config/ webbeans-imp...
Author: gerdogdu
Date: Thu Dec 17 20:01:45 2009
New Revision: 891862
URL: http://svn.apache.org/viewvc?rev=891862&view=rev
Log:
[OWB-191] Convert logging to use keyed, formatted strings from a ResourceBundle to allow for translation. Thanks to Paul J. Reder
Added:
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OWBLogConst.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/Messages_en.properties (with props)
Modified:
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLogger.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JNDIUtil.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansErrorHandler.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansResolver.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
incubator/openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/component/JmsBean.java
incubator/openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
incubator/openwebbeans/trunk/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/ResourceServiceImpl.java
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java Thu Dec 17 20:01:45 2009
@@ -30,6 +30,7 @@
import org.apache.webbeans.config.inheritance.BeanInheritedMetaData;
import org.apache.webbeans.config.inheritance.IBeanInheritedMetaData;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.creational.CreationalContextFactory;
import org.apache.webbeans.context.creational.CreationalContextImpl;
@@ -204,7 +205,7 @@
}catch(Exception e)
{
- logger.fatal("Exception is thrown while destroying bean instance : " + toString());
+ logger.fatal(OWBLogConst.FATAL_0001, new Object[]{toString()});
e.printStackTrace();
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java Thu Dec 17 20:01:45 2009
@@ -23,6 +23,7 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.context.creational.CreationalContextImpl;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.inject.InjectableField;
@@ -242,7 +243,7 @@
catch (Exception e)
{
- logger.error("Error is occured while executing @PostConstruct", e);
+ logger.error(OWBLogConst.ERROR_0008, new Object[]{"@PostConstruct."}, e);
throw new WebBeansException(e);
}
}
@@ -284,7 +285,7 @@
}
catch (Exception e)
{
- getLogger().error("Error is occıred while executing @PreDestroy method", e);
+ getLogger().error(OWBLogConst.ERROR_0008, new Object[]{"@PreDestroy."}, e);
throw new WebBeansException(e);
}
}
@@ -538,4 +539,4 @@
return super.getInjectionPoints();
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLManagedBean.java Thu Dec 17 20:01:45 2009
@@ -25,6 +25,7 @@
import javax.enterprise.context.spi.CreationalContext;
import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.inject.xml.XMLInjectableConstructor;
import org.apache.webbeans.inject.xml.XMLInjectableField;
@@ -130,13 +131,13 @@
}
catch (IllegalArgumentException e)
{
- logger.error("IllegalArgumentException is occured while calling the field : " + field.getName() + " on class " + instance.getClass().getName());
+ logger.error(OWBLogConst.ERROR_0016, new Object[]{field.getName(), instance.getClass().getName()});
throw new WebBeansException(e);
}
catch (IllegalAccessException e)
{
- logger.error("IllegalAccessException is occured while calling the field : " + field.getName() + " on class " + instance.getClass().getName());
+ logger.error(OWBLogConst.ERROR_0017, new Object[]{field.getName(), instance.getClass().getName()});
throw new WebBeansException(e);
}
}
@@ -230,4 +231,4 @@
{
return fieldValues;
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Thu Dec 17 20:01:45 2009
@@ -44,6 +44,7 @@
import org.apache.webbeans.component.WebBeansType;
import org.apache.webbeans.component.creation.ManagedBeanCreatorImpl;
import org.apache.webbeans.component.creation.BeanCreator.MetaDataProvider;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.decorator.DecoratorUtil;
import org.apache.webbeans.decorator.WebBeansDecorator;
@@ -233,7 +234,7 @@
*/
private void validateInjectionPoints()
{
- logger.info("Validation of injection points are started");
+ logger.info(OWBLogConst.INFO_0013);
BeanManagerImpl manager = BeanManagerImpl.getManager();
Set<Bean<?>> beans = new HashSet<Bean<?>>();
@@ -247,7 +248,7 @@
}
- logger.info("Validation of the decorator's injection points are started");
+ logger.info(OWBLogConst.INFO_0014);
//Validate Decorators
validate(beans);
@@ -262,7 +263,7 @@
beans.add(wbInt.getDelegate());
}
- logger.info("Validation of the interceptor's injection points are started");
+ logger.info(OWBLogConst.INFO_0015);
//Validate Interceptors
validate(beans);
@@ -273,7 +274,7 @@
validate(beans);
- logger.info("All injection points are validated succesfully");
+ logger.info(OWBLogConst.INFO_0016);
}
/**
@@ -309,7 +310,7 @@
*/
protected void deployFromClassPath(MetaDataDiscoveryService scanner) throws ClassNotFoundException
{
- logger.info("Deploying configurations from class files is started");
+ logger.info(OWBLogConst.INFO_0017);
// Start from the class
Map<String, Set<String>> classIndex = scanner.getClassIndex();
@@ -333,14 +334,14 @@
if (ManagedBeanConfigurator.isManagedBean(implClass))
{
- logger.info("Managed Bean with class name : " + componentClassName + " is found");
+ logger.info(OWBLogConst.INFO_0018, new Object[]{componentClassName});
defineManagedBean(implClass);
}
else if(this.discoverEjb)
{
if(EJBWebBeansConfigurator.isSessionBean(implClass))
{
- logger.info("Enterprise Bean with class name : " + componentClassName + " is found");
+ logger.info(OWBLogConst.INFO_0019, new Object[]{componentClassName});
defineEnterpriseWebBean(implClass);
}
@@ -348,7 +349,7 @@
}
}
- logger.info("Deploying configurations from class files is ended");
+ logger.info(OWBLogConst.INFO_0020);
}
@@ -362,7 +363,7 @@
*/
protected void deployFromXML(MetaDataDiscoveryService scanner) throws WebBeansDeploymentException
{
- logger.info("Deploying configurations from XML files is started");
+ logger.info(OWBLogConst.INFO_0021);
Set<URL> xmlLocations = scanner.getWebBeansXmlLocations();
Iterator<URL> it = xmlLocations.iterator();
@@ -397,7 +398,7 @@
}
}
- logger.info("Deploying configurations from XML is ended succesfully");
+ logger.info(OWBLogConst.INFO_0022);
}
/**
@@ -408,7 +409,7 @@
*/
protected void configureInterceptors(MetaDataDiscoveryService scanner) throws ClassNotFoundException
{
- logger.info("Configuring the Interceptors is started");
+ logger.info(OWBLogConst.INFO_0023);
// Interceptors Set
Map<String, Set<String>> annotIndex = scanner.getAnnotationIndex();
@@ -420,13 +421,13 @@
{
Class<?> implClass = ClassUtil.getClassFromName(interceptorClazz);
- logger.info("Managed Bean Interceptor with class name : " + interceptorClazz + " is found");
+ logger.info(OWBLogConst.INFO_0024, new Object[]{interceptorClazz});
defineInterceptor(implClass);
}
}
- logger.info("Configuring the Interceptors is ended");
+ logger.info(OWBLogConst.INFO_0025);
}
@@ -438,7 +439,7 @@
*/
protected void configureDecorators(MetaDataDiscoveryService scanner) throws ClassNotFoundException
{
- logger.info("Configuring the Decorators is started");
+ logger.info(OWBLogConst.INFO_0026);
Map<String, Set<String>> annotIndex = scanner.getAnnotationIndex();
Set<String> classes = annotIndex.get(javax.decorator.Decorator.class.getName());
@@ -448,19 +449,19 @@
for (String decoratorClazz : classes)
{
Class<?> implClass = ClassUtil.getClassFromName(decoratorClazz);
- logger.info("Managed Bean Decorator with class name : " + decoratorClazz + " is found");
+ logger.info(OWBLogConst.INFO_0027, new Object[]{decoratorClazz});
defineDecorator(implClass);
}
}
- logger.info("Configuring the Decorators is ended");
+ logger.info(OWBLogConst.INFO_0028);
}
protected void checkSpecializations(MetaDataDiscoveryService scanner)
{
- logger.info("Checking Specialization constraints is started");
+ logger.info(OWBLogConst.INFO_0029);
try
{
@@ -484,14 +485,15 @@
if(superClass.equals(Object.class))
{
- throw new WebBeansConfigurationException("Specalized class : " + specialClassName + " must extend another class");
+ throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.EXCEPT_0003) + specialClassName
+ + logger.getTokenString(OWBLogConst.EXCEPT_0004));
}
}
else
{
if (superClass.equals(specialClass.getSuperclass()))
{
- throw new InconsistentSpecializationException("More than one class that specialized the same super class : " + superClass.getName());
+ throw new InconsistentSpecializationException(logger.getTokenString(OWBLogConst.EXCEPT_0005) + superClass.getName());
}
}
@@ -509,7 +511,7 @@
}
- logger.info("Checking Specialization constraints is ended");
+ logger.info(OWBLogConst.INFO_0030);
}
private void checkXMLSpecializations()
@@ -531,7 +533,8 @@
{
if (superClass.equals(specialClass.getSuperclass()))
{
- throw new InconsistentSpecializationException("XML Specialization Error : More than one class that specialized the same super class : " + superClass.getName());
+ throw new InconsistentSpecializationException(logger.getTokenString(OWBLogConst.EXCEPT_XML) + logger.getTokenString(OWBLogConst.EXCEPT_0005)
+ + superClass.getName());
}
}
@@ -574,7 +577,7 @@
protected void checkStereoTypes(MetaDataDiscoveryService scanner)
{
- logger.info("Checking StereoTypes constraints is started");
+ logger.info(OWBLogConst.INFO_0031);
addDefaultStereoTypes();
@@ -601,7 +604,7 @@
}
}
- logger.info("Checking StereoTypes constraints is ended");
+ logger.info(OWBLogConst.INFO_0032);
}
protected void addDefaultStereoTypes()
@@ -653,7 +656,7 @@
managedBeanCreator.defineSerializable();
managedBeanCreator.defineStereoTypes();
managedBeanCreator.defineApiType();
- managedBeanCreator.defineScopeType("ManagedBean implementation class : " + clazz.getName() + " stereotypes must declare same @Scope annotations");
+ managedBeanCreator.defineScopeType(logger.getTokenString(OWBLogConst.TEXT_MB_IMPL) + clazz.getName() + logger.getTokenString(OWBLogConst.TEXT_SAME_SCOPE));
managedBeanCreator.defineQualifier();
managedBeanCreator.defineName(WebBeansUtil.getSimpleWebBeanDefaultName(clazz.getSimpleName()));
managedBeanCreator.defineConstructor();
@@ -766,4 +769,4 @@
{
EJBWebBeansConfigurator.defineEjbBean(clazz);
}
-}
\ No newline at end of file
+}
Added: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OWBLogConst.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OWBLogConst.java?rev=891862&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OWBLogConst.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OWBLogConst.java Thu Dec 17 20:01:45 2009
@@ -0,0 +1,137 @@
+/*
+ * 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.webbeans.config;
+
+/* Requires the following import where referenced:
+ * import org.apache.webbeans.config.OWBLogConst;
+ */
+
+public class OWBLogConst
+{
+ public final static String DEFAULT_MSGS_PROPERTIES_NAME = "javax.openwebbeans.Messages";
+
+ public final static String DEBUG_0001 = "DEBUG_0001"; // Application is configured as JSP. Adding EL Resolver.
+ public final static String DEBUG_0002 = "DEBUG_0002"; // Resolving systemId with :
+ public final static String DEBUG_0003 = "DEBUG_0003"; // Resolving is successful with systemId :
+ public final static String DEBUG_0004 = "DEBUG_0004"; // Resolving failed using default SAXResolver for systemId :
+ public final static String DEBUG_0005 = "DEBUG_0005"; // Starting a new request :
+ public final static String DEBUG_0006 = "DEBUG_0006"; // Destroying a request :
+ public final static String DEBUG_0007 = "DEBUG_0007"; // Starting a session with session id :
+ public final static String DEBUG_0008 = "DEBUG_0008"; // Destroying a session with session id :
+ public final static String DEBUG_0009 = "DEBUG_0009"; // PluginLoader startUp called.
+ public final static String DEBUG_0010 = "DEBUG_0010"; // PluginLoader is already started.
+ public final static String DEBUG_0011 = "DEBUG_0011"; // PluginLoader shutDown called.
+ public final static String DEBUG_0012 = "DEBUG_0012"; // PluginLoader is already shut down.
+
+ public final static String TRACE_0001 = "TRACE_0001"; // Notifying with event payload :
+
+ public final static String TEXT_INTERCEPT_CLASS = "TEXT_INTERCEPT_CLASS"; // Interceptor Class :
+ public final static String TEXT_ANNO_CLASS = "TEXT_ANNO_CLASS"; // Annotated Decorator Class :
+ public final static String TEXT_XML_CLASS = "TEXT_XML_CLASS"; // XML based Decorator Class :
+ public final static String TEXT_CONFIG_PROP = "TEXT_CONFIG_PROP"; // Config properties [
+ public final static String TEXT_CONFIG_NOT_FOUND = "TEXT_CONFIG_NOT_FOUND"; // ] not found. Using default settings.
+ public final static String TEXT_CONFIG_FOUND = "TEXT_CONFIG_FOUND"; // ] found at location :
+ public final static String TEXT_OVERRIDING = "TEXT_OVERRIDING"; // . Overriding default settings.
+ public final static String TEXT_MUSTSCOPE = "TEXT_MUSTSCOPE"; // Stereotypes must declare the same @Scope annotations for Managed Bean Implementation Class :
+ public final static String TEXT_MB_IMPL = "TEXT_MB_IMPL"; // Managed Bean implementation class :
+ public final static String TEXT_SAME_SCOPE = "TEXT_SAME_SCOPE"; // stereotypes must declare the same @Scope annotations.
+ public final static String TEXT_JAVA_TYPENAME = "TEXT_JAVA_TYPENAME"; // Java type with name :
+
+ public final static String INFO_0001 = "INFO_0001"; // Using discovery service implementation class : [{1}]
+ public final static String INFO_0002 = "INFO_0002"; // OpenWebBeans Container is starting.
+ public final static String INFO_0003 = "INFO_0003"; // Scanning classpaths for beans artifacts.
+ public final static String INFO_0004 = "INFO_0004"; // Deploying scanned beans.
+ public final static String INFO_0005 = "INFO_0005"; // OpenWebBeans Container is started, it took {1} ms.
+ public final static String INFO_0006 = "INFO_0006"; // OpenWebBeans Container is stopping.
+ public final static String INFO_0007 = "INFO_0007"; // OpenWebBeans Container has stopped.
+ public final static String INFO_0008 = "INFO_0008"; // OpenWebBeans Container is stopped for context path,
+ public final static String INFO_0009 = "INFO_0009"; // Session is passivated. Session id : [{1}]
+ public final static String INFO_0010 = "INFO_0010"; // Session is activated. Session id : [{1}]
+ public final static String INFO_0011 = "INFO_0011"; // Starting configuration of Web Beans {1}
+ public final static String INFO_0012 = "INFO_0012"; // Finished configuration of Web Beans {1}
+ public final static String INFO_0013 = "INFO_0013"; // Validation of injection points are started.
+ public final static String INFO_0014 = "INFO_0014"; // Validation of the decorator's injection points are started.
+ public final static String INFO_0015 = "INFO_0015"; // Validation of the interceptor's injection points are started.
+ public final static String INFO_0016 = "INFO_0016"; // All injection points are validated succesfully.
+ public final static String INFO_0017 = "INFO_0017"; // Deploying configurations from class files is started.
+ public final static String INFO_0018 = "INFO_0018"; // Found Managed Bean with class name : [{1}]
+ public final static String INFO_0019 = "INFO_0019"; // Found Enterprise Bean with class name : [{1}]
+ public final static String INFO_0020 = "INFO_0020"; // Deploying configurations from class files is ended.
+ public final static String INFO_0021 = "INFO_0021"; // Deploying configurations from XML files is started.
+ public final static String INFO_0022 = "INFO_0022"; // Deploying configurations from XML is ended succesfully.
+ public final static String INFO_0023 = "INFO_0023"; // Configuring the Interceptors is started.
+ public final static String INFO_0024 = "INFO_0024"; // Found Managed Bean Interceptor with class name : [{1}]
+ public final static String INFO_0025 = "INFO_0025"; // Configuring the Interceptors is ended.
+ public final static String INFO_0026 = "INFO_0026"; // Configuring the Decorators is started.
+ public final static String INFO_0027 = "INFO_0027"; // Found Managed Bean Decorator with class name : [{1}]
+ public final static String INFO_0028 = "INFO_0028"; // Configuring the Decorators is ended.
+ public final static String INFO_0029 = "INFO_0029"; // Checking Specialization constraints is started.
+ public final static String INFO_0030 = "INFO_0030"; // Checking Specialization constraints is ended.
+ public final static String INFO_0031 = "INFO_0031"; // Checking StereoTypes constraints is started.
+ public final static String INFO_0032 = "INFO_0032"; // Checking StereoTypes constraints is ended.
+ public final static String INFO_0033 = "INFO_0033"; // Adding OpenWebBeansPlugin :
+ public final static String INFO_0034 = "INFO_0034"; // Create new transitional conversation for non-faces request with view id : [{1}]
+ public final static String INFO_0035 = "INFO_0035"; // Propogation of the conversation for non-faces request with cid: [{1}] for view: [{2}]
+ public final static String INFO_0036 = "INFO_0036"; // Propogated conversation for non-faces request can not be restored for view id : [{1}]. Creates new transitional conversation.
+ public final static String INFO_0038 = "INFO_0038"; // Conversation is restored for non-faces request with cid: [{1}] for view id: [{2}]
+ public final static String INFO_0039 = "INFO_0039"; // Conversation is restored for JSF postback with cid: [{1}] for view id: [{2}]
+ public final static String INFO_0040 = "INFO_0040"; // Create new transient conversation for JSF postback view id : [{1}]
+ public final static String INFO_0041 = "INFO_0041"; // Destroying the conversation context with cid: [{1}] for view id: [{2}]
+ public final static String INFO_0042 = "INFO_0042"; // Saving conversation with cid: [{1}] for view id: [{2}]
+
+ public final static String WARN_0001 = "WARN_0001"; // No plugins to shutDown.
+ public final static String WARN_0002 = "WARN_0002"; // Alternative XML content is wrong. Child of <alternatives> must be <class>,<stereotype> but found :
+ public final static String WARN_0003 = "WARN_0003"; // Discovery service not found. Continue by using MetaDataDiscoveryStandard as a default.
+ public final static String WARN_0004 = "WARN_0004"; // OpenWebBeans Container is already started.
+ public final static String WARN_0005 = "WARN_0005"; // OpenWebBeans Container is already stopped.
+ public final static String WARN_0006 = "WARN_0006"; // Conversation already started with cid : [{1}]
+
+ public final static String ERROR_0001 = "ERROR_0001"; // Unable to inject resource for : [{1}]
+ public final static String ERROR_0002 = "ERROR_0002"; // Initialization of the WebBeans container has failed.
+ public final static String ERROR_0003 = "ERROR_0003"; // An exception has occured in the transactional observer.
+ public final static String ERROR_0004 = "ERROR_0004"; // Unable to initialize InitialContext object.
+ public final static String ERROR_0005 = "ERROR_0005"; // Unable to bind object with name : [{1}]
+ public final static String ERROR_0006 = "ERROR_0006"; // Security exception. Cannot access decorator class: [{1}] method : [{2}]
+ public final static String ERROR_0007 = "ERROR_0007"; // Delegate field is not found on the given decorator class : [{1}]
+ public final static String ERROR_0008 = "ERROR_0008"; // Error occured while executing {1}
+ public final static String ERROR_0009 = "ERROR_0009"; // Error while shutting down the plugin : [{1}]
+ public final static String ERROR_0010 = "ERROR_0010"; // An error occured while closing the JMS instance.
+ public final static String ERROR_0011 = "ERROR_0011"; // Method security access violation for method : [{1}] in decorator class : [{2}]
+ public final static String ERROR_0012 = "ERROR_0012"; // Exception in calling method : [{1}] in decorator class : [{2}]. Look in the log for target checked exception.
+ public final static String ERROR_0014 = "ERROR_0014"; // Method illegal access for method : [{1}] in decorator class : [{2}]
+ public final static String ERROR_0015 = "ERROR_0015"; // Illegal access exception for field : [{1}] in decorator class : [{2}]
+ public final static String ERROR_0016 = "ERROR_0016"; // IllegalArgumentException has occured while calling the field: [{1}] on the class: [{2}]
+ public final static String ERROR_0017 = "ERROR_0017"; // IllegalAccessException has occured while calling the field: [{1}] on the class: [{2}]
+
+ public final static String FATAL_0001 = "FATAL_0001"; // Exception thrown while destroying bean instance : {1}
+ public final static String FATAL_0002 = "FATAL_0002"; // Unable to read root element of the given input stream.
+
+ public final static String EDCONF_FAIL = "CRITICAL_DEFAULT_CONFIG_FAILURE"; // Problem while loading OpenWebBeans default configuration.
+ public final static String ESCONF_FAIL = "CRITICAL_SPECIAL_CONFIG_FAILURE"; // Problem while loading OpenWebBeans specialized configuration.
+ public final static String EXCEPT_0001 = "EXCEPT_0001"; // Wrong initialization object.
+ public final static String EXCEPT_0002 = "EXCEPT_0002"; // Wrong ended object.
+ public final static String EXCEPT_0003 = "EXCEPT_0003"; // Specialized class [
+ public final static String EXCEPT_0004 = "EXCEPT_0004"; // ] must extendanothre class.
+ public final static String EXCEPT_XML = "EXCEPT_XML"; // XML Specialization Error :
+ public final static String EXCEPT_0005 = "EXCEPT_0005"; // More than one class specialized the same super class :
+ public final static String EXCEPT_0006 = "EXCEPT_0006"; // Got Exceptions while sending shutdown to the following plugins :
+ public final static String EXCEPT_0007 = "EXCEPT_0007"; // TransactionPhase not supported:
+ public final static String EXCEPT_0008 = "EXCEPT_0008"; // Exception is thrown while handling event object with type :
+ public final static String EXCEPT_0009 = "EXCEPT_0009"; // Unable to unbind object with name :
+ public final static String EXCEPT_0010 = "EXCEPT_0010"; // Unable to lookup object with name :
+ public final static String EXCEPT_0011 = "EXCEPT_0011"; // Could not find Decorator delegate attribute for decorator class :
+ public final static String EXCEPT_0012 = "EXCEPT_0012"; // All elements in the beans.xml file have to declare name space.
+ public final static String EXCEPT_0013 = "EXCEPT_0013"; // Unable to read root element of the given input stream.
+ public final static String EXCEPT_0014 = "EXCEPT_0014"; // Multiple class with name :
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OWBLogConst.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java Thu Dec 17 20:01:45 2009
@@ -18,6 +18,7 @@
import java.net.URL;
import java.util.Properties;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -84,7 +85,7 @@
}
catch (IOException ioEx)
{
- throw new WebBeansConfigurationException("problem while loading OpenWebBeans default configuration", ioEx);
+ throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.EDCONF_FAIL), ioEx);
}
// and now overload those settings with the ones from the more specialized version (if available)
@@ -92,13 +93,13 @@
URL configUrl = loader.getResource(CONFIG_PROPERTIES_NAME);
if (configUrl == null)
{
- logger.info("No config properties " + CONFIG_PROPERTIES_NAME + " found. Using default settings.");
+ logger.info(logger.getTokenString(OWBLogConst.TEXT_CONFIG_PROP) + CONFIG_PROPERTIES_NAME + logger.getTokenString(OWBLogConst.TEXT_CONFIG_NOT_FOUND));
}
else
{
- logger.info("Config properties " + CONFIG_PROPERTIES_NAME + " found at location "
+ logger.info(logger.getTokenString(OWBLogConst.TEXT_CONFIG_PROP) + CONFIG_PROPERTIES_NAME + logger.getTokenString(OWBLogConst.TEXT_CONFIG_FOUND)
+ configUrl.toString()
- + ". Overriding default settings.");
+ + logger.getTokenString(OWBLogConst.TEXT_OVERRIDING));
is = loader.getResourceAsStream(CONFIG_PROPERTIES_NAME);
try
@@ -107,7 +108,7 @@
}
catch (IOException ioEx)
{
- throw new WebBeansConfigurationException("problem while loading OpenWebBeans specialized configuration", ioEx);
+ throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.ESCONF_FAIL), ioEx);
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java Thu Dec 17 20:01:45 2009
@@ -16,6 +16,7 @@
import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.ConversationContext;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -69,7 +70,7 @@
}
else
{
- logger.warn("Conversation with cid=" + id + " is already began!");
+ logger.warn(OWBLogConst.WARN_0006, new Object[]{id});
throw new IllegalStateException();
}
}
@@ -184,4 +185,4 @@
return true;
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java Thu Dec 17 20:01:45 2009
@@ -26,6 +26,7 @@
import javax.enterprise.inject.spi.Decorator;
import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.exception.WebBeansException;
@@ -67,7 +68,7 @@
if(!found)
{
- throw new WebBeansConfigurationException("Decorator delegate attribute for decorator class : " + decoratorClazz.getName() + " can not be found!");
+ throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.EXCEPT_0011) + decoratorClazz.getName());
}
}
}
@@ -169,7 +170,7 @@
}
catch (SecurityException e)
{
- logger.error("Security exception, can not access decorator class : " + decClazz.getName() + " method : " + method.getName(), e);
+ logger.error(OWBLogConst.ERROR_0006, new Object[]{decClazz.getName(),method.getName()}, e);
throw new WebBeansException(e);
}
@@ -184,4 +185,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java Thu Dec 17 20:01:45 2009
@@ -29,6 +29,7 @@
import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.component.ManagedBean;
import org.apache.webbeans.component.WebBeansType;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.inject.InjectableField;
import org.apache.webbeans.inject.InjectableMethods;
@@ -221,13 +222,13 @@
}
catch (IllegalArgumentException e)
{
- logger.error("Delegate field is not found on the given decorator class : " + instance.getClass().getName(), e);
+ logger.error(OWBLogConst.ERROR_0007, new Object[]{instance.getClass().getName()}, e);
throw new WebBeansException(e);
}
catch (IllegalAccessException e)
{
- logger.error("Illegal access exception for field " + field.getName() + " in decorator class : " + instance.getClass().getName(), e);
+ logger.error(OWBLogConst.ERROR_0015, new Object[]{field.getName(), instance.getClass().getName()}, e);
}
}
@@ -419,4 +420,4 @@
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java Thu Dec 17 20:01:45 2009
@@ -26,6 +26,7 @@
import org.apache.webbeans.annotation.DefaultLiteral;
import org.apache.webbeans.component.AbstractBean;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.decorator.xml.WebBeansXMLDecorator;
import org.apache.webbeans.inject.xml.XMLInjectionPointModel;
@@ -42,22 +43,22 @@
public static <T> void configureDecoratorClass(AbstractBean<T> delegate)
{
- logger.info("Configuring the Web Beans Annoatated Decorator Class : " + delegate.getReturnType().getName() + " started");
+ logger.info(OWBLogConst.INFO_0011, new Object[]{logger.getTokenString(OWBLogConst.TEXT_ANNO_CLASS), delegate.getReturnType().getName()});
WebBeansDecorator<T> decorator = new WebBeansDecorator<T>(delegate);
- logger.info("Configuring the Web Beans Annotated Decorator Class : " + delegate.getReturnType() + " ended");
+ logger.info(OWBLogConst.INFO_0012, new Object[]{logger.getTokenString(OWBLogConst.TEXT_ANNO_CLASS), delegate.getReturnType()});
BeanManagerImpl.getManager().addDecorator(decorator);
}
public static <T> void configureXMLDecoratorClass(AbstractBean<T> delegate, XMLInjectionPointModel model)
{
- logger.info("Configuring the Web Beans XML based Decorator Class : " + delegate.getReturnType().getName() + " started");
+ logger.info(OWBLogConst.INFO_0011, new Object[]{logger.getTokenString(OWBLogConst.TEXT_XML_CLASS), delegate.getReturnType().getName()});
WebBeansXMLDecorator<T> decorator = new WebBeansXMLDecorator<T>(delegate, model);
- logger.info("Configuring the Web Beans XML based Decorator Class : " + delegate.getReturnType() + " ended");
+ logger.info(OWBLogConst.INFO_0012, new Object[]{logger.getTokenString(OWBLogConst.TEXT_XML_CLASS), delegate.getReturnType()});
BeanManagerImpl.getManager().addDecorator(decorator);
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java Thu Dec 17 20:01:45 2009
@@ -41,6 +41,7 @@
import org.apache.webbeans.annotation.DefaultLiteral;
import org.apache.webbeans.component.InjectionTargetBean;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -231,7 +232,7 @@
}
else
{
- throw new IllegalStateException("TransactionPhase not supported: " + phase);
+ throw new IllegalStateException(logger.getTokenString(OWBLogConst.EXCEPT_0007) + phase);
}
}
else
@@ -243,7 +244,7 @@
{
if (!RuntimeException.class.isAssignableFrom(e.getCause().getClass()))
{
- throw new ObserverException("Exception is thrown while handling event object with type : " + event.getClass().getName(), e);
+ throw new ObserverException(logger.getTokenString(OWBLogConst.EXCEPT_0008) + event.getClass().getName(), e);
}
else
{
@@ -338,7 +339,7 @@
}
catch (Exception e)
{
- logger.error("Exception is occured in the transactional observer ", e);
+ logger.error(OWBLogConst.ERROR_0003, e);
}
}
}
@@ -404,4 +405,4 @@
}
}
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java Thu Dec 17 20:01:45 2009
@@ -39,6 +39,7 @@
import org.apache.webbeans.annotation.DefaultLiteral;
import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.component.InjectionTargetBean;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.container.InjectionResolver;
import org.apache.webbeans.exception.WebBeansException;
@@ -150,7 +151,7 @@
@SuppressWarnings("unchecked")
public void notify(T event)
{
- logger.trace("Notifiying with event payload : " + event.toString());
+ logger.trace(OWBLogConst.TRACE_0001, new Object[]{event.toString()});
AbstractBean<Object> baseComponent = (AbstractBean<Object>) bean;
AbstractBean<Object> specializedComponent = null;
@@ -328,4 +329,4 @@
return this.observerMethod;
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java Thu Dec 17 20:01:45 2009
@@ -31,6 +31,7 @@
import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.config.DefinitionUtil;
import org.apache.webbeans.config.BeansDeployer;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.decorator.WebBeansDecorator;
import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
@@ -268,7 +269,7 @@
}
catch (SecurityException e)
{
- logger.error("Method security access violation for method " + method.getName() + " for decorator class : " + decorator.getClass().getName());
+ logger.error(OWBLogConst.ERROR_0011, new Object[]{method.getName(), decorator.getClass().getName()});
throw new WebBeansException(e);
}
@@ -278,12 +279,13 @@
}
catch (InvocationTargetException e)
{
- logger.error("Exception in calling method " + method.getName() + " for decorator class : " + decorator.getClass().getName() + ". Look log for target checked exception.", e.getTargetException());
+ logger.error(OWBLogConst.ERROR_0012, new Object[]{method.getName(), decorator.getClass().getName()}, e.getTargetException());
+
throw new WebBeansException(e);
}
catch (IllegalAccessException e)
{
- logger.error("Method illegal access for method " + method.getName() + " for decorator class : " + decorator.getClass().getName());
+ logger.error(OWBLogConst.ERROR_0014, new Object[]{method.getName(), decorator.getClass().getName()});
throw new WebBeansException(e);
}
finally
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java Thu Dec 17 20:01:45 2009
@@ -30,6 +30,7 @@
import org.apache.webbeans.component.AbstractBean;
import org.apache.webbeans.component.BaseBean;
import org.apache.webbeans.config.inheritance.IBeanInheritedMetaData;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -63,7 +64,7 @@
*/
public static <T> void configureInterceptorClass(AbstractBean<T> delegate, Annotation[] interceptorBindingTypes)
{
- logger.info("Configuring the Web Beans Interceptor Class : " + delegate.getReturnType() + " started");
+ logger.info(OWBLogConst.INFO_0011, new Object[]{logger.getTokenString(OWBLogConst.TEXT_INTERCEPT_CLASS), delegate.getReturnType()});
WebBeansInterceptor<T> interceptor = new WebBeansInterceptor<T>(delegate);
@@ -72,7 +73,7 @@
interceptor.addInterceptorBinding(ann.annotationType(), ann);
}
- logger.info("Configuring the Web Beans Interceptor Class : " + delegate.getReturnType() + " ended");
+ logger.info(OWBLogConst.INFO_0012, new Object[]{logger.getTokenString(OWBLogConst.TEXT_INTERCEPT_CLASS), delegate.getReturnType()});
BeanManagerImpl.getManager().addInterceptor(interceptor);
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java Thu Dec 17 20:01:45 2009
@@ -32,6 +32,7 @@
import org.apache.webbeans.config.OpenWebBeansConfiguration;
import org.apache.webbeans.config.BeansDeployer;
import org.apache.webbeans.config.WebBeansFinder;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.ContextFactory;
import org.apache.webbeans.conversation.ConversationManager;
@@ -105,7 +106,7 @@
public void requestStarted(ServletRequestEvent event)
{
- logger.debug("Starting a new request : " + event.getServletRequest().getRemoteAddr());
+ logger.debug(OWBLogConst.DEBUG_0005, new Object[]{event.getServletRequest().getRemoteAddr()});
ContextFactory.initializeThreadLocals();
@@ -128,19 +129,19 @@
public void requestEnded(ServletRequestEvent event)
{
- logger.debug("Destroying a request : " + event.getServletRequest().getRemoteAddr());
+ logger.debug(OWBLogConst.DEBUG_0006, new Object[]{event.getServletRequest().getRemoteAddr()});
ContextFactory.destroyRequestContext((HttpServletRequest) event.getServletRequest());
}
public void sessionStarted(HttpSessionEvent event)
{
- logger.debug("Starting a session with session id : " + event.getSession().getId());
+ logger.debug(OWBLogConst.DEBUG_0007, new Object[]{event.getSession().getId()});
ContextFactory.initSessionContext(event.getSession());
}
public void sessionEnded(HttpSessionEvent event)
{
- logger.debug("Destroying a session with session id : " + event.getSession().getId());
+ logger.debug(OWBLogConst.DEBUG_0008, new Object[]{event.getSession().getId()});
ContextFactory.destroySessionContext(event.getSession());
ConversationManager conversationManager = ConversationManager.getInstance();
@@ -151,13 +152,13 @@
{
if(startupObject != null && !(ServletContextEvent.class.isAssignableFrom(startupObject.getClass())))
{
- throw new WebBeansException("Wrong initialization object");
+ throw new WebBeansException(logger.getTokenString(OWBLogConst.EXCEPT_0001));
}
ServletContextEvent event = (ServletContextEvent)startupObject;
// Initalize Application Context
- logger.info("OpenWebBeans Container is starting");
+ logger.info(OWBLogConst.INFO_0002);
long begin = System.currentTimeMillis();
@@ -179,18 +180,18 @@
service = Executors.newScheduledThreadPool(1);
service.scheduleWithFixedDelay(new ConversationCleaner(), delay, delay, TimeUnit.MILLISECONDS);
- logger.info("Scanning classpaths for beans artifacts");
+ logger.info(OWBLogConst.INFO_0003);
this.discovery.scan();
- logger.info("Deploying scanned beans");
+ logger.info(OWBLogConst.INFO_0004);
deployer.deploy(this.discovery);
//Application is configured as JSP
if(OpenWebBeansConfiguration.getInstance().isJspApplication())
{
- logger.debug("Application is configured as JSP. Adding EL Resolver");
+ logger.debug(OWBLogConst.DEBUG_0001);
ServletContext context = event.getServletContext();
@@ -200,16 +201,16 @@
long end = System.currentTimeMillis();
- logger.info("OpenWebBeans Container is started, it takes " + Long.toString(end - begin) + " ms.");
+ logger.info(OWBLogConst.INFO_0005, new Object[]{Long.toString(end - begin)});
}
public void applicationEnded(Object endObject)
{
- logger.info("OpenWebBeans Container is stopping");
+ logger.info(OWBLogConst.INFO_0006);
if(endObject != null && !(ServletContextEvent.class.isAssignableFrom(endObject.getClass())))
{
- throw new WebBeansException("Wrong ended object");
+ throw new WebBeansException(logger.getTokenString(OWBLogConst.EXCEPT_0002));
}
ServletContextEvent event = (ServletContextEvent)endObject;
@@ -234,17 +235,17 @@
//Clear singleton list
WebBeansFinder.clearInstances();
- logger.info("OpenWebBeans Container is stopped for context path, " + event.getServletContext().getContextPath());
+ logger.info(OWBLogConst.INFO_0008, new Object[]{event.getServletContext().getContextPath()});
}
public void sessionPassivated(HttpSessionEvent event)
{
- logger.info("Session is passivated. Session id : [ " + event.getSession().getId()+" ]");
+ logger.info(OWBLogConst.INFO_0009, new Object[]{event.getSession().getId()});
}
public void sessionActivated(HttpSessionEvent event)
{
- logger.info("Session is activated. Session id : [ " + event.getSession().getId()+" ]");
+ logger.info(OWBLogConst.INFO_0010, new Object[]{event.getSession().getId()});
}
private static class ConversationCleaner implements Runnable
@@ -267,4 +268,4 @@
return this.rootManager;
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java Thu Dec 17 20:01:45 2009
@@ -20,6 +20,7 @@
import org.apache.webbeans.WebBeansConstants;
import org.apache.webbeans.config.BeansDeployer;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.config.WebBeansFinder;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.ContextFactory;
@@ -73,14 +74,13 @@
if(discoveryService == null)
{
- String message = "Discovery service not found!. Continue with using MetaDataDiscoveryStandard as a default";
- logger.warn(message);
+ logger.warn(OWBLogConst.WARN_0003);
this.discoveryService = new MetaDataDiscoveryStandard();
}
else
{
- logger.info("Using discovery service implementation class : " + discoveryService.getClass());
+ logger.info(OWBLogConst.INFO_0001, new Object[]{discoveryService.getClass().toString()});
}
beanManager.setXMLConfigurator(this.xmlConfig);
@@ -92,7 +92,7 @@
{
if(this.started.compareAndSet(false, true))
{
- logger.info("OpenWebBeans Container is starting");
+ logger.info(OWBLogConst.INFO_0002);
long begin = System.currentTimeMillis();
//Singleton context
@@ -101,22 +101,22 @@
// load all optional plugins
PluginLoader.getInstance().startUp();
- logger.info("Scanning classpaths for beans artifacts");
+ logger.info(OWBLogConst.INFO_0003);
this.discoveryService.scan();
- logger.info("Deploying scanned beans");
+ logger.info(OWBLogConst.INFO_0004);
this.beansDeployer.deploy(this.discoveryService);
long end = System.currentTimeMillis();
- logger.info("OpenWebBeans Container is started, it takes " + Long.toString(end - begin) + " ms.");
+ logger.info(OWBLogConst.INFO_0005, new Object[]{Long.toString(end - begin)});
}
else
{
- logger.warn("OpenWebBeans Container is already started");
+ logger.warn(OWBLogConst.WARN_0004);
}
}
@@ -126,7 +126,7 @@
{
if(this.stopped.compareAndSet(false, true))
{
- logger.info("OpenWebBeans Container is stopping");
+ logger.info(OWBLogConst.INFO_0006);
//Fire shut down
@@ -147,12 +147,12 @@
//Clear singleton list
WebBeansFinder.clearInstances();
- logger.info("OpenWebBeans Container is stopped");
+ logger.info(OWBLogConst.INFO_0007);
}
else
{
- logger.warn("OpenWebBeans Container is already stopped");
+ logger.warn(OWBLogConst.WARN_0005);
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLogger.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLogger.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLogger.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLogger.java Thu Dec 17 20:01:45 2009
@@ -14,6 +14,12 @@
package org.apache.webbeans.logger;
import org.apache.log4j.Logger;
+import org.apache.webbeans.config.OWBLogConst;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
/**
* Wrapper class around the log4j logger class to include some checks before the
@@ -28,11 +34,12 @@
{
/** Inner logger object to log actual log messages */
private Logger logger = null;
+ private ResourceBundle wbBundle = null;
/** Private constructor */
private WebBeansLogger()
{
-
+ wbBundle = ResourceBundle.getBundle("META-INF.Messages");
}
/**
@@ -51,16 +58,22 @@
return wbLogger;
}
- public void fatal(String message)
+ public void fatal(String messageKey)
{
checkNullLogger();
- logger.fatal(message);
+ logger.fatal(getTokenString(messageKey));
}
- public void fatal(String message, Throwable e)
+ public void fatal(String messageKey, Object args[])
{
checkNullLogger();
- logger.fatal(message, e);
+ logger.fatal(constructMessage(messageKey, args));
+ }
+
+ public void fatal(String messageKey, Throwable e)
+ {
+ checkNullLogger();
+ logger.fatal(getTokenString(messageKey), e);
}
@@ -70,71 +83,166 @@
logger.error(e);
}
- public void error(String message)
+ public void error(String messageKey)
{
checkNullLogger();
- logger.error(message);
+ logger.error(getTokenString(messageKey));
}
- public void error(String message, Throwable e)
+ public void error(String messageKey, Object args[])
+ {
+ checkNullLogger();
+ logger.error(constructMessage(messageKey, args));
+ }
+
+ public void error(String messageKey, Throwable e)
{
checkNullLogger();
- logger.error(message, e);
+ logger.error(getTokenString(messageKey), e);
}
- public void warn(String message)
+ public void error(String messageKey, Object args[], Throwable e)
+ {
+ checkNullLogger();
+ logger.error(constructMessage(messageKey, args), e);
+
+ }
+
+ public void warn(String messageKey)
+ {
+ checkNullLogger();
+ logger.warn(getTokenString(messageKey));
+ }
+
+ public void warn(String messageKey, Object args[])
{
checkNullLogger();
- logger.warn(message);
+ logger.warn(constructMessage(messageKey, args));
}
- public void warn(String message, Throwable e)
+ public void warn(String messageKey, Throwable e)
{
checkNullLogger();
- logger.warn(message, e);
+ logger.warn(getTokenString(messageKey), e);
}
- public void info(String message)
+ public void info(String messageKey)
{
checkNullLogger();
if (logger.isInfoEnabled())
- logger.info(message);
+ {
+ logger.info(getTokenString(messageKey));
+ }
}
- public void info(String message, Throwable e)
+ public void info(String messageKey, Object args[])
+ {
+ checkNullLogger();
+ if (logger.isInfoEnabled())
+ {
+ logger.info(constructMessage(messageKey, args));
+ }
+ }
+
+ public void info(String messageKey, Throwable e)
{
checkNullLogger();
if (logger.isInfoEnabled())
- logger.info(message, e);
+ {
+ logger.info(getTokenString(messageKey), e);
+ }
+ }
+
+ public void debug(String messageKey)
+ {
+ checkNullLogger();
+ if (logger.isDebugEnabled())
+ {
+ logger.debug(getTokenString(messageKey));
+ }
}
- public void debug(String message)
+ public void debug(String messageKey, Object args[])
{
checkNullLogger();
if (logger.isDebugEnabled())
- logger.debug(message);
+ {
+ logger.debug(constructMessage(messageKey, args));
+ }
}
- public void debug(String message, Throwable e)
+ public void debug(String messageKey, Throwable e)
{
checkNullLogger();
if (logger.isDebugEnabled())
- logger.debug(message, e);
+ {
+ logger.debug(getTokenString(messageKey), e);
+ }
}
- public void trace(String message)
+ public void trace(String messageKey)
{
checkNullLogger();
if (logger.isTraceEnabled())
- logger.trace(message);
+ {
+ logger.trace(getTokenString(messageKey));
+ }
}
- public void trace(String message, Throwable e)
+ public void trace(String messageKey, Object args[])
{
checkNullLogger();
if (logger.isTraceEnabled())
- logger.trace(message, e);
+ {
+ logger.trace(constructMessage(messageKey, args));
+ }
+ }
+
+ public void trace(String messageKey, Throwable e)
+ {
+ checkNullLogger();
+ if (logger.isTraceEnabled())
+ {
+ logger.trace(getTokenString(messageKey), e);
+ }
+ }
+
+ private String constructMessage(String messageKey, Object args[])
+ {
+ MessageFormat msgFrmt;
+ String formattedString;
+
+ msgFrmt = new MessageFormat(getTokenString(messageKey), Locale.getDefault());
+ formattedString = msgFrmt.format(args);
+
+ return formattedString;
+ }
+
+ public String getTokenString(String messageKey)
+ {
+ String strVal = null;
+
+ if (this.wbBundle == null)
+ {
+ throw new NullPointerException("ResourceBundle can not be null");
+ }
+ try
+ {
+ strVal = wbBundle.getString(messageKey);
+ }
+ catch (MissingResourceException mre)
+ {
+ strVal = null;
+ }
+ if (strVal == null)
+ {
+ return messageKey;
+ }
+ else
+ {
+ return strVal;
+ }
}
/**
@@ -153,5 +261,5 @@
{
throw new NullPointerException("Logger can not be null");
}
- }
+ }
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java Thu Dec 17 20:01:45 2009
@@ -21,6 +21,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.webbeans.config.WebBeansFinder;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -69,7 +70,7 @@
{
if(this.started.compareAndSet(false, true))
{
- logger.debug("PluginLoader startUp called");
+ logger.debug(OWBLogConst.DEBUG_0009);
ArrayList<OpenWebBeansPlugin> ps = new ArrayList<OpenWebBeansPlugin>();
ServiceLoader<OpenWebBeansPlugin> owbPluginsLoader = ServiceLoader.load(OpenWebBeansPlugin.class);
@@ -77,7 +78,7 @@
while(pluginIter.hasNext())
{
OpenWebBeansPlugin plugin = pluginIter.next();
- logger.info("adding OpenWebBeansPlugin " + plugin.getClass().getSimpleName());
+ logger.info(OWBLogConst.INFO_0033, new Object[]{plugin.getClass().getSimpleName()});
plugin.startUp();
ps.add(plugin);
}
@@ -87,7 +88,7 @@
}
else
{
- logger.debug("PluginLoader is already started");
+ logger.debug(OWBLogConst.DEBUG_0010);
}
}
@@ -100,11 +101,11 @@
{
if(this.started.compareAndSet(true, false))
{
- logger.debug("PluginLoader shutDown called");
+ logger.debug(OWBLogConst.DEBUG_0011);
if (plugins == null)
{
- logger.warn("No plugins to shutDown!");
+ logger.warn(OWBLogConst.WARN_0001);
return;
}
@@ -120,20 +121,19 @@
{
// we catch ALL exceptions, since we like to continue shutting down all other plugins!
String pluginName = plugin.getClass().getSimpleName();
- logger.error("error while shutdown the pugin " + pluginName, e);
+ logger.error(OWBLogConst.ERROR_0009, new Object[]{pluginName}, e);
failedShutdown.add(pluginName);
}
}
if (!failedShutdown.isEmpty())
{
- throw new WebBeansConfigurationException("got Exceptions while sending shutdown to the following plugins: "
- + failedShutdown.toString());
+ throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.EXCEPT_0006) + failedShutdown.toString());
}
}
else
{
- logger.debug("PluginLoader is already shut down!");
+ logger.debug(OWBLogConst.DEBUG_0012);
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java Thu Dec 17 20:01:45 2009
@@ -19,6 +19,7 @@
import javax.servlet.ServletContext;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.logger.WebBeansLogger;
import org.apache.webbeans.spi.deployer.AbstractMetaDataDiscovery;
import org.apache.webbeans.util.WebBeansUtil;
@@ -64,7 +65,7 @@
}
catch (Exception e)
{
- logger.error("Initializing of the WebBeans container is failed.", e);
+ logger.error(OWBLogConst.ERROR_0002, e);
throw e;
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JNDIUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JNDIUtil.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JNDIUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JNDIUtil.java Thu Dec 17 20:01:45 2009
@@ -18,6 +18,7 @@
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -40,7 +41,7 @@
}
catch (Exception e)
{
- LOGGER.error("Unable to initialize InitialContext object", e);
+ LOGGER.error(OWBLogConst.ERROR_0004, e);
throw new ExceptionInInitializerError(e);
}
}
@@ -83,7 +84,7 @@
}
catch (NamingException e)
{
- LOGGER.error("Unable to bind object with name : " + name, e);
+ LOGGER.error(OWBLogConst.ERROR_0005, new Object[]{name}, e);
}
}
@@ -99,7 +100,7 @@
catch (NamingException e)
{
LOGGER.error(e);
- throw new WebBeansException("Unable to unbind object with name : " + name, e);
+ throw new WebBeansException(LOGGER.getTokenString(OWBLogConst.EXCEPT_0009) + name, e);
}
}
@@ -114,7 +115,7 @@
} catch (NamingException e)
{
LOGGER.error(e);
- throw new WebBeansException("Unable to lookup object with name : " + name, e);
+ throw new WebBeansException(LOGGER.getTokenString(OWBLogConst.EXCEPT_0010) + name, e);
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansErrorHandler.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansErrorHandler.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansErrorHandler.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansErrorHandler.java Thu Dec 17 20:01:45 2009
@@ -34,7 +34,7 @@
public void error(SAXParseException exception) throws SAXException
{
- logger.error(exception.getMessage(), exception.getCause());
+ logger.error(exception.getMessage(), new Object[]{exception.getCause()});
throw new WebBeansException(exception);
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansResolver.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansResolver.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansResolver.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansResolver.java Thu Dec 17 20:01:45 2009
@@ -19,6 +19,7 @@
import org.apache.webbeans.WebBeansConstants;
import org.apache.webbeans.logger.WebBeansLogger;
import org.apache.webbeans.util.WebBeansUtil;
+import org.apache.webbeans.config.OWBLogConst;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -36,7 +37,7 @@
*/
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
{
- logger.debug("Resolving systemId with : " + systemId);
+ logger.debug(OWBLogConst.DEBUG_0002, new Object[]{systemId});
if (systemId.equals(WebBeansConstants.WEB_BEANS_XML_SYSID))
{
@@ -44,7 +45,7 @@
if (stream != null)
{
- logger.debug("Resolving is success with systemId : " + systemId);
+ logger.debug(OWBLogConst.DEBUG_0003, new Object[]{systemId});
return createInputSource(stream, publicId, systemId);
}
}
@@ -56,12 +57,12 @@
if (stream != null)
{
- logger.debug("Resolving is success with systemId : " + systemId);
+ logger.debug(OWBLogConst.DEBUG_0003, new Object[]{systemId});
return createInputSource(stream, publicId, systemId);
}
}
- logger.debug("Resolving is failed with systemId : " + systemId + ", using default SAXResolver");
+ logger.debug(OWBLogConst.DEBUG_0004, new Object[]{systemId});
return null;
}
@@ -79,4 +80,4 @@
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java Thu Dec 17 20:01:45 2009
@@ -51,6 +51,7 @@
import org.apache.webbeans.config.DefinitionUtil;
import org.apache.webbeans.config.ManagedBeanConfigurator;
import org.apache.webbeans.config.OpenWebBeansConfiguration;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.decorator.DecoratorsManager;
import org.apache.webbeans.exception.WebBeansConfigurationException;
@@ -624,7 +625,7 @@
}
else
{
- logger.warn("Alternative XML content is wrong. Child of <alternatives> must be <class>,<stereotype> but found " + XMLUtil.getName(child));
+ logger.warn(OWBLogConst.WARN_0002, new Object[]{XMLUtil.getName(child)});
}
}
}
@@ -2027,4 +2028,4 @@
return "WebBeans XML configuration defined in " + CURRENT_SCAN_FILE_NAME + " is failed. Reason is : ";
}
-}
\ No newline at end of file
+}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java?rev=891862&r1=891861&r2=891862&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java Thu Dec 17 20:01:45 2009
@@ -31,11 +31,13 @@
import org.apache.webbeans.annotation.DefaultLiteral;
import org.apache.webbeans.annotation.WebBeansAnnotation;
import org.apache.webbeans.component.xml.XMLProducerBean;
+import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.exception.definition.NonexistentTypeException;
import org.apache.webbeans.exception.inject.DefinitionException;
import org.apache.webbeans.inject.xml.XMLInjectionPointModel;
+import org.apache.webbeans.logger.WebBeansLogger;
import org.apache.webbeans.proxy.JavassistProxyFactory;
import org.apache.webbeans.util.AnnotationUtil;
import org.apache.webbeans.util.Asserts;
@@ -63,7 +65,7 @@
{
}
- private static final Logger log = LogManager.getLogger(XMLUtil.class);
+ private static WebBeansLogger log = WebBeansLogger.getLogger(XMLUtil.class);
/**
* Gets new {@link SAXReader} instance.
@@ -104,7 +106,7 @@
Element element = path.getCurrent();
if (element.getNamespaceURI() == null || element.getNamespaceURI().equals(""))
{
- throw new WebBeansConfigurationException("All elements in the beans.xml file have to declare name space.");
+ throw new WebBeansConfigurationException(log.getTokenString(OWBLogConst.EXCEPT_0012));
}
else
{
@@ -133,8 +135,8 @@
}
catch (DocumentException e)
{
- log.fatal("Unable to read root element of the given input stream", e);
- throw new WebBeansException("Unable to read root element of the given input stream", e);
+ log.fatal(OWBLogConst.FATAL_0002, e);
+ throw new WebBeansException(log.getTokenString(OWBLogConst.EXCEPT_0013), e);
}
}
@@ -162,8 +164,8 @@
}
catch (DocumentException e)
{
- log.fatal("Unable to read root element of the given input stream", e);
- throw new WebBeansException("Unable to read root element of the given input stream", e);
+ log.fatal(OWBLogConst.FATAL_0002, e);
+ throw new WebBeansException(log.getTokenString(OWBLogConst.EXCEPT_0013), e);
}
}
@@ -489,7 +491,7 @@
{
if(found)
{
- throw new DefinitionException("Multiple class with name : " + clazz.getName());
+ throw new DefinitionException(log.getTokenString(OWBLogConst.EXCEPT_0014) + clazz.getName());
}
else
{
@@ -592,12 +594,12 @@
Class<?> clazz = getElementJavaType(typeElement);
if (clazz == null)
{
- throw new NonexistentTypeException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " is not found in the deployment");
+ throw new NonexistentTypeException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not found in the deployment");
}
else if (clazz.isAnnotation() || clazz.isArray() || clazz.isEnum())
{
- throw new WebBeansConfigurationException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " must be class or interface type");
+ throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " must be class or interface type");
}
else
@@ -614,18 +616,18 @@
Type actualType = getElementJavaType(childElement);
if (actualType == null)
{
- throw new NonexistentTypeException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " is not found in the deployment");
+ throw new NonexistentTypeException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not found in the deployment");
}
else if (((Class) actualType).isArray() || ((Class) actualType).isEnum())
{
- throw new WebBeansConfigurationException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " must be class or interface type");
+ throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " must be class or interface type");
}
else if (((Class) actualType).isAnnotation())
{
Class<? extends Annotation> annotClazz = (Class<? extends Annotation>) actualType;
if (!AnnotationUtil.isQualifierAnnotation(annotClazz))
{
- throw new WebBeansConfigurationException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " is not a @Qualifier");
+ throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not a @Qualifier");
}
if (definedBindingType == null)
@@ -636,7 +638,7 @@
{
if (definedBindingType.equals(annotClazz))
{
- throw new IllegalArgumentException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " is duplicated");
+ throw new IllegalArgumentException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is duplicated");
}
}
@@ -650,7 +652,7 @@
if (actualTypeArgument != typeArguments.size())
{
- throw new WebBeansConfigurationException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " actual type parameters size are not equals defined in the xml");
+ throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " actual type parameters size are not equals defined in the xml");
}
int i = 0;
@@ -663,7 +665,7 @@
if (!clazzBound.isAssignableFrom((Class<?>) type))
{
- throw new WebBeansConfigurationException(errorMessage + "Java type with name : " + getElementJavaClassName(typeElement) + " actual type parameter bounded exception");
+ throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " actual type parameter bounded exception");
}
}
@@ -961,4 +963,4 @@
}
-}
\ No newline at end of file
+}