[jboss-svn-commits] JBL Code SVN: r34706 - in labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf: protocols and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Aug 13 07:37:58 EDT 2010


Author: adinn
Date: 2010-08-13 07:37:57 -0400 (Fri, 13 Aug 2010)
New Revision: 34706

Modified:
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLogger.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLoggerImpl.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols/ProtocolManager.java
Log:
added missing logging messages - fixes for JBTM-678

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLogger.java	2010-08-13 11:28:58 UTC (rev 34705)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLogger.java	2010-08-13 11:37:57 UTC (rev 34706)
@@ -265,6 +265,26 @@
 	@Message(id = 44061, value = "Failed to create:", format = MESSAGE_FORMAT)
 	public String get_utils_ProtocolLocator_2();
 
+    @Message(id = 44062, value = "No protocol implementations configured", format = MESSAGE_FORMAT)
+    @LogMessage(level = INFO)
+    public void info_protocols_ProtocolManager_1();
+
+    @Message(id = 44063, value = "Unable to identify protocol type for class {0}", format = MESSAGE_FORMAT)
+    @LogMessage(level = ERROR)
+    public void error_protocols_ProtocolManager_2(String arg0);
+
+    @Message(id = 44064, value = "Unable to load protocol implementation class {0} caught exception", format = MESSAGE_FORMAT)
+    @LogMessage(level = ERROR)
+    public void error_protocols_ProtocolManager_3(String arg0, Throwable arg1);
+
+    @Message(id = 44065, value = "Installed implementation class {0} for protocol type {1}", format = MESSAGE_FORMAT)
+    @LogMessage(level = INFO)
+    public void info_protocols_ProtocolManager_4(String arg0, String arg1);
+
+    @Message(id = 44066, value = "Unable to instantiate protocol implementation class {0} caught exception", format = MESSAGE_FORMAT)
+    @LogMessage(level = ERROR)
+    public void error_protocols_ProtocolManager_5(String arg0, Throwable arg1);
+
     /*
         Allocate new messages directly above this notice.
           - id: use the next id number in numeric sequence. Don't reuse ids.

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLoggerImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLoggerImpl.java	2010-08-13 11:28:58 UTC (rev 34705)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfI18NLoggerImpl.java	2010-08-13 11:37:57 UTC (rev 34706)
@@ -281,4 +281,30 @@
 	public String get_utils_ProtocolLocator_2() {
 		return "ARJUNA-44061 Failed to create:";
 	}
+
+    public void info_protocols_ProtocolManager_1()
+    {
+         logger.logv(INFO, "ARJUNA-44062 No protocol implementations configured");
+    }
+
+    public void error_protocols_ProtocolManager_2(String arg0)
+    {
+         logger.logv(ERROR, "ARJUNA-44063 Unable to identify protocol type for class {0}", arg0);
+    }
+
+    public void error_protocols_ProtocolManager_3(String arg0, Throwable arg1)
+    {
+         logger.logv(ERROR, arg1, "ARJUNA-44064 Unable to load protocol implementation class {0} caught exception", arg0);
+    }
+
+    public void info_protocols_ProtocolManager_4(String arg0, String arg1)
+    {
+        logger.logv(INFO, "ARJUNA-44065 Installed implementation class {0} for protocol type {1}", arg0, arg1);
+    }
+
+    public void error_protocols_ProtocolManager_5(String arg0, Throwable arg1)
+    {
+         logger.logv(ERROR, arg1, "ARJUNA-44066 Unable to instantiate protocol implementation class {0} caught exception", arg0);
+    }
+
 }

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols/ProtocolManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols/ProtocolManager.java	2010-08-13 11:28:58 UTC (rev 34705)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols/ProtocolManager.java	2010-08-13 11:37:57 UTC (rev 34706)
@@ -31,9 +31,7 @@
 
 package com.arjuna.mw.wscf.protocols;
 
-import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
 import org.jboss.jbossts.xts.environment.WSCFEnvironmentBean;
-import com.arjuna.mw.wscf.exceptions.ProtocolAlreadyRegisteredException;
 import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
 import com.arjuna.mw.wscf.logging.wscfLogger;
 import com.arjuna.mwlabs.wscf.utils.ContextProvider;
@@ -55,68 +53,6 @@
 {
 
 	/**
-	 * Add a specific protocol implementation to the factory.
-	 *
-	 * @param     protocolName The name of the protocol.
-	 * @param     protocolImplementor The class that implements the protocol.
-	 *
-	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolAlreadyRegisteredException
-	 *                Thrown if the exact same protocol definition has already
-	 *                been registered.
-	 * @exception IllegalArgumentException
-	 *                Thrown if either of the parameters is invalid.
-	 */
-
-	public void addProtocol (String protocolName, Object protocolImplementor)
-			throws ProtocolAlreadyRegisteredException,
-			IllegalArgumentException
-	{
-        synchronized(this) {
-            if ((protocolName == null) || (protocolImplementor == null))
-            {
-                throw new IllegalArgumentException();
-            }
-
-            if (_protocols.get(protocolName) != null) {
-                throw new ProtocolAlreadyRegisteredException();
-            } else {
-                _protocols.put(protocolName, protocolImplementor);
-            }
-        }
-	}
-
-	/**
-	 * Replace a specific protocol implementation in the factory.
-	 *
-	 * @param     protocolName The name of the protocol.
-	 * @param     protocolImplementor The class that implements the protocol.
-	 *
-	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException
-	 *                Thrown if the protocol to be removed has not been
-	 *                registered.
-	 * @exception IllegalArgumentException
-	 *                Thrown if either of the parameters is invalid.
-	 */
-
-	public void replaceProtocol (String protocolName, Object protocolImplementor)
-			throws ProtocolNotRegisteredException, IllegalArgumentException
-	{
-		synchronized (this)
-		{
-            if ((protocolName == null) || (protocolImplementor == null))
-            {
-                throw new IllegalArgumentException();
-            }
-
-            if (_protocols.get(protocolName) == null) {
-                throw new ProtocolNotRegisteredException();
-            } else {
-                _protocols.put(protocolName, protocolImplementor);
-            }
-		}
-	}
-
-	/**
      * @param     protocolName The name of the protocol.
 	 *
 	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException
@@ -149,41 +85,6 @@
         }
 	}
 
-	/**
-	 * Remove the specified protocol definition from the factory.
-	 *
-     * @param     protocolName The name of the protocol.
-	 *
-	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException
-	 *                Thrown if the protocol to be removed has not been
-	 *                registered.
-	 * @exception IllegalArgumentException
-	 *                Thrown if the paramater is invalid (e.g., null).
-	 *
-	 * @return the protocol implementation removed.
-	 */
-
-	public Object removeProtocol (String protocolName)
-			throws ProtocolNotRegisteredException, IllegalArgumentException
-	{
-        synchronized (this)
-        {
-            if (protocolName == null)
-            {
-                throw new IllegalArgumentException();
-            }
-
-            Object object = _protocols.remove(protocolName);
-
-            if (object == null) {
-                throw new ProtocolNotRegisteredException(wscfLogger.i18NLogger.get_mw_wscf11_protocols_ProtocolManager_1()
-                        + protocolName);
-            }
-
-            return object;
-        }
-	}
-
 	/*
 	 * install all registered protocol implementations which should be either context factories
 	 * or high level services
@@ -199,8 +100,7 @@
         WSCFEnvironmentBean wscfEnvironmentBean = XTSPropertyManager.getWSCFEnvironmentBean();
         List<String> protocolImplementations = wscfEnvironmentBean.getProtocolImplementations();
         if (protocolImplementations == null) {
-            // TODO log info message
-            System.out.println("ProtocolManager : no service or context or high level; service protocol implementations configured");
+            wscfLogger.i18NLogger.info_protocols_ProtocolManager_1();
             return;
         }
         ListIterator<String> iterator = protocolImplementations.listIterator();
@@ -224,13 +124,11 @@
                     if (hlsProvider !=  null) {
                         hlsProviderClasses.add(clazz);
                     } else {
-                        System.out.println("ProtocolManager : Unknown protocol implementation : " + className);
+                        wscfLogger.i18NLogger.error_protocols_ProtocolManager_2(className);
                     }
                 }
             } catch (ClassNotFoundException cnfe) {
-                // TODO -- proper log message
-                System.out.println("ProtocolManager : Unable to load protocol implementation class : " + className);
-                cnfe.printStackTrace();
+                wscfLogger.i18NLogger.error_protocols_ProtocolManager_3(className, cnfe);
             }
         }
 
@@ -243,17 +141,13 @@
             {
                 HLSProvider hlsProvider = clazz.getAnnotation(HLSProvider.class);
                 String serviceType = hlsProvider.serviceType();
-                System.out.println("ProtocolManager : Installing implementation class : " + className + " for service type " + serviceType);
+                wscfLogger.i18NLogger.info_protocols_ProtocolManager_4(className, serviceType);
                 Object object = clazz.newInstance();
                 _protocols.put(serviceType, object);
             } catch (InstantiationException ie) {
-                // TODO -- proper log message
-                System.out.println("ProtocolManager : Unable to instantiate protocol implementation class : " + className);
-                ie.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                wscfLogger.i18NLogger.error_protocols_ProtocolManager_5(className, ie);
             } catch (IllegalAccessException iae) {
-                // TODO -- proper log message
-                System.out.println("ProtocolManager : Unable to instantiate protocol implementation class : " + className);
-                iae.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                wscfLogger.i18NLogger.error_protocols_ProtocolManager_5(className, iae);
             }
 		}
 
@@ -264,17 +158,15 @@
                 ContextProvider contextProvider = clazz.getAnnotation(ContextProvider.class);
                 if (contextProvider !=  null) {
                     String coordinationType = contextProvider.coordinationType();
-                    System.out.println("ProtocolManager : Installing implementation class : " + className + " for coordination type " + coordinationType);
+                    wscfLogger.i18NLogger.info_protocols_ProtocolManager_4(className, coordinationType);
                     Object object = clazz.newInstance();
                     _protocols.put(coordinationType, object);
                 }
             } catch (InstantiationException ie) {
-                // TODO -- proper log message
-                System.out.println("ProtocolManager : Unable to instantiate protocol implementation class : " + className);
+                wscfLogger.i18NLogger.error_protocols_ProtocolManager_5(className, ie);
                 ie.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
             } catch (IllegalAccessException iae) {
-                // TODO -- proper log message
-                System.out.println("ProtocolManager : Unable to instantiate protocol implementation class : " + className);
+                wscfLogger.i18NLogger.error_protocols_ProtocolManager_5(className, iae);
                 iae.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
             }
 		}



More information about the jboss-svn-commits mailing list