notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2689 - in development/main: metro/composition/content/src/main/net/dpml/composition/content transit/core/handler/src/main/net/dpml/transit/manager
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2689 - in development/main: metro/composition/content/src/main/net/dpml/composition/content transit/core/handler/src/main/net/dpml/transit/manager
- Date: Wed, 01 Jun 2005 19:37:26 -0400
Author: mcconnell AT dpml.net
Date: Wed Jun 1 19:37:26 2005
New Revision: 2689
Modified:
development/main/metro/composition/content/src/main/net/dpml/composition/content/CompositionContentHandlerRegistry.java
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
Log:
Fix synchronization issue where the content handler registry was being
updated in a unexpected moment. Resolved by synchronizing the content
handler accesosr on the content registry model.
Modified:
development/main/metro/composition/content/src/main/net/dpml/composition/content/CompositionContentHandlerRegistry.java
==============================================================================
---
development/main/metro/composition/content/src/main/net/dpml/composition/content/CompositionContentHandlerRegistry.java
(original)
+++
development/main/metro/composition/content/src/main/net/dpml/composition/content/CompositionContentHandlerRegistry.java
Wed Jun 1 19:37:26 2005
@@ -40,8 +40,8 @@
// state
//
------------------------------------------------------------------------
- private Logger m_logger;
- private RegistryModel m_model;
+ private final Logger m_logger;
+ private final RegistryModel m_model;
//
------------------------------------------------------------------------
// constructor
@@ -58,6 +58,7 @@
{
super( model );
m_logger = model.getLogger();
+ m_model = model;
}
//
------------------------------------------------------------------------
@@ -66,33 +67,37 @@
public ContentHandler getContentHandler( final String type ) throws
IOException
{
- ContentHandler handler = super.getContentHandler( type );
- if( null != handler )
+ synchronized( m_model )
{
- return handler;
- }
- else if( "part".equals( type ) )
- {
- try
+ ContentHandler handler = super.getContentHandler( type );
+ if( null != handler )
{
- URI uri = new URI( PART_HANDLER_PLUGIN_PATH );
- String title = "Part Content Handler";
- ContentModel model = m_model.addContentModel( PART, title,
uri );
- return getContentHandler( model );
+ return handler;
}
- catch( Throwable e )
+ else if( "part".equals( type ) )
{
- final String error =
- "Unexpected error while attempting to establish part
handler."
- + "\nPlugin URI: " + PART_HANDLER_PLUGIN_PATH;
- IOException ioe = new IOException( error );
- ioe.initCause( e );
- throw ioe;
+ try
+ {
+ URI uri = new URI( PART_HANDLER_PLUGIN_PATH );
+ String title = "Part Content Handler";
+ ContentModel model = m_model.addContentModel( PART,
title, uri );
+ return getContentHandler( model );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to establish part
handler."
+ + "\nPlugin URI: " + PART_HANDLER_PLUGIN_PATH
+ + "\nContent Type: " + type;
+ IOException ioe = new IOException( error );
+ ioe.initCause( e );
+ throw ioe;
+ }
+ }
+ else
+ {
+ return null;
}
- }
- else
- {
- return null;
}
}
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
Wed Jun 1 19:37:26 2005
@@ -100,6 +100,34 @@
//
------------------------------------------------------------------------
/**
+ * Return the plugin uri.
+ * @return the plugin uri
+ */
+ public URI getPluginURI()
+ {
+ String spec = System.getProperty( "dpml.transit.content.plugin" );
+ if( null != spec )
+ {
+ try
+ {
+ return new URI( spec );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Cannot resolve registry plugin uri from system property."
+ + "\nProperty name: dpml.transit.content.plugin"
+ + "\nProperty Value: " + spec;
+ throw new IllegalStateException( error );
+ }
+ }
+ else
+ {
+ return super.getPluginURI();
+ }
+ }
+
+ /**
* Return an array of content managers currently assigned to the registry.
* @return the content manager array
*/
- svn commit: r2689 - in development/main: metro/composition/content/src/main/net/dpml/composition/content transit/core/handler/src/main/net/dpml/transit/manager, mcconnell, 06/01/2005
Archive powered by MHonArc 2.6.24.