portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/plugin/src/java/org/apache/jetspeed/services/plugin AbstractPluginFactory.java
Date Wed, 04 Feb 2004 21:05:46 GMT
weaver      2004/02/04 13:05:46

  Modified:    plugin/src/java/org/apache/jetspeed/services/plugin
                        AbstractPluginFactory.java
  Log:
  no longer using the CauseExtractor on exceptions
  
  Revision  Changes    Path
  1.6       +23 -12    jakarta-jetspeed-2/plugin/src/java/org/apache/jetspeed/services/plugin/AbstractPluginFactory.java
  
  Index: AbstractPluginFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/plugin/src/java/org/apache/jetspeed/services/plugin/AbstractPluginFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractPluginFactory.java	18 Oct 2003 20:44:03 -0000	1.5
  +++ AbstractPluginFactory.java	4 Feb 2004 21:05:46 -0000	1.6
  @@ -137,15 +137,16 @@
           }
           catch (Exception e)
           {
  -            String message = "Unable to initialize PersistenceService. "+CauseExtractor.getCompositeMessage(e);
  +            String message = "Unable to initialize PersistenceService. ";
               log.fatal(message, e);
  -            if (!(e instanceof InitializationException))
  +            if (e instanceof InitializationException)
               {
  -                throw new InitializationException(message, e);
  +				throw (InitializationException) e;
               }
               else
               {
  -                throw (InitializationException) e;
  +                
  +				throw new InitializationException(message, e);
               }
           }
       }
  @@ -198,16 +199,16 @@
           }
           catch (Exception e)
           {
  -            String message = "Unable to create Plugin.Cause: " + e.getMessage();
  +            String message = "Unable to create Plugin.Cause: " + e.toString();
               log.fatal(message, e);
  -            log.fatal(CauseExtractor.getCompositeMessage(e));
  -            if (!(e instanceof PluginInitializationException))
  +            
  +            if (e instanceof PluginInitializationException)
               {
  -                throw new PluginInitializationException(message, e);
  +				throw (PluginInitializationException) e;
               }
               else
               {
  -                throw (PluginInitializationException) e;
  +				throw new PluginInitializationException(message, e);                
               }
           }
       }
  @@ -217,7 +218,15 @@
        */
       public Plugin getPlugin(String type, String name)
       {
  -        return (Plugin) plugins.get(type + "." + name);
  +		Plugin plugin =(Plugin) plugins.get(type + "." + name);
  +		if (plugin == null)
  +		{
  +			String msg = "No plugin has been defined for type:name " + type+":"+name;
  +			log.error(msg);
  +			throw new PluginRuntimeException(msg);
  +		}		
  +		
  +        return plugin;
       }
   
       public Plugin getDefaultPlugin(String type)
  @@ -225,7 +234,9 @@
           Plugin plugin = (Plugin) defaultPlugins.get(type);
           if (plugin == null)
           {
  -            log.warn("No default plugin has been defined for type " + type);
  +            String msg = "No default plugin has been defined for type " + type;
  +            log.error(msg);
  +            throw new PluginRuntimeException(msg);
           }
           return plugin;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message