Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2617 - development/main/transit/core/handler/src/main/net/dpml/transit/content

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2617 - development/main/transit/core/handler/src/main/net/dpml/transit/content
  • Date: Thu, 19 May 2005 03:35:24 +0000

Author: mcconnell AT dpml.net
Date: Thu May 19 03:35:15 2005
New Revision: 2617

Modified:

development/main/transit/core/handler/src/main/net/dpml/transit/content/DefaultContentHandlerRegistry.java
Log:
Fiox an issue concerning the lookup of content handlers.

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/content/DefaultContentHandlerRegistry.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/content/DefaultContentHandlerRegistry.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/content/DefaultContentHandlerRegistry.java
Thu May 19 03:35:15 2005
@@ -95,16 +95,7 @@
}
else
{
- URI uri = descriptor.getPluginURI();
- ContentHandler handler = (ContentHandler) m_links.get( uri );
- if( null != handler )
- {
- return handler;
- }
- else
- {
- return getContentHandler( descriptor );
- }
+ return getContentHandler( descriptor );
}
}

@@ -112,33 +103,41 @@
{
String type = descriptor.getContentType();
URI uri = descriptor.getPluginURI();
- try
+ ContentHandler handler = (ContentHandler) m_links.get( uri );
+ if( null != handler )
{
- m_logger.info( "loading content handler for: " + type );
- Repository loader = Transit.getInstance().getRepository();
- ClassLoader classloader =
Thread.currentThread().getContextClassLoader();
- Object plugin = loader.getPlugin( classloader, uri, new
Object[0] );
- if( plugin instanceof ContentHandler )
- {
- ContentHandler handler = (ContentHandler) plugin;
- m_links.put( uri, handler );
- return handler;
+ return handler;
+ }
+ else
+ {
+ try
+ {
+ m_logger.info( "loading content handler for: " + type );
+ Repository loader = Transit.getInstance().getRepository();
+ ClassLoader classloader =
Thread.currentThread().getContextClassLoader();
+ Object plugin = loader.getPlugin( classloader, uri, new
Object[0] );
+ if( plugin instanceof ContentHandler )
+ {
+ handler = (ContentHandler) plugin;
+ m_links.put( uri, handler );
+ return handler;
+ }
+ else
+ {
+ final String error =
+ "Content handler plugin uri does not resolve to a
java.net.ContentHandler."
+ + "\nHandler URI: " + uri
+ + "\nHandler Class: " + plugin.getClass().getName();
+ throw new TransitException( error );
+ }
}
- else
+ catch( Exception e )
{
final String error =
- "Content handler plugin uri does not resolve to a
java.net.ContentHandler."
- + "\nHandler URI: " + uri
- + "\nHandler Class: " + plugin.getClass().getName();
- throw new TransitException( error );
+ "Unable to load a content handler plugin.";
+ throw new CascadingIOException( error, e );
}
}
- catch( Exception e )
- {
- final String error =
- "Unable to load a content handler plugin.";
- throw new CascadingIOException( error, e );
- }
}

//
------------------------------------------------------------------------



  • svn commit: r2617 - development/main/transit/core/handler/src/main/net/dpml/transit/content, mcconnell, 05/18/2005

Archive powered by MHonArc 2.6.24.

Top of Page