Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2690 - in development/main: test/unit/plus/src/test/net/dpml/test/acme/plus transit/core/handler/src/main/net/dpml/transit/manager

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: r2690 - in development/main: test/unit/plus/src/test/net/dpml/test/acme/plus transit/core/handler/src/main/net/dpml/transit/manager
  • Date: Wed, 01 Jun 2005 22:11:23 -0400

Author: mcconnell AT dpml.net
Date: Wed Jun 1 22:11:21 2005
New Revision: 2690

Modified:

development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java

development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
Log:
fix issue related to duplicate attempt to construct the same content handler
plugin

Modified:
development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
==============================================================================
---
development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
(original)
+++
development/main/test/unit/plus/src/test/net/dpml/test/acme/plus/URLTestCase.java
Wed Jun 1 22:11:21 2005
@@ -116,6 +116,4 @@
System.setProperty( "dpml.transit.preferences.enabled", "true" );
System.setProperty( "dpml.transit.content.plugin",
CONTENT_MANAGER_PLUGIN );
}
-
-
}

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 22:11:21 2005
@@ -18,6 +18,7 @@

package net.dpml.transit.manager;

+import java.util.Collections;
import java.util.List;
import java.util.LinkedList;
import java.util.Iterator;
@@ -52,7 +53,7 @@
// state
//
------------------------------------------------------------------------

- private final List m_list = new LinkedList();
+ private final List m_list = Collections.synchronizedList( new
LinkedList() );

//
------------------------------------------------------------------------
// constructor
@@ -357,22 +358,34 @@
String type = model.getContentType();
synchronized( m_list )
{
- ContentModel m = getContentModel( type );
+ ContentManager m = getContentManager( type );
if( null != m )
{
- final String error =
- "Content type already registered."
- + "\nType: " + type;
- throw new ModelException( error );
- }
- m_list.add( model );
- model.addPluginListener( this );
- if( notify )
+ URI uri = m.getPluginURI();
+ if( false == uri.equals( model.getPluginURI() ) )
+ {
+ final String error =
+ "Content type handler already registered."
+ + "\nContent Type: " + type
+ + "\nPlugin URI: " + uri;
+ throw new ModelException( error );
+ }
+ else
+ {
+ return m;
+ }
+ }
+ else
{
- ContentAddedEvent event = new ContentAddedEvent( this, model
);
- super.enqueueEvent( event );
+ m_list.add( model );
+ model.addPluginListener( this );
+ if( notify )
+ {
+ ContentAddedEvent event = new ContentAddedEvent( this,
model );
+ super.enqueueEvent( event );
+ }
+ return model;
}
- return model;
}
}




  • svn commit: r2690 - in development/main: test/unit/plus/src/test/net/dpml/test/acme/plus transit/core/handler/src/main/net/dpml/transit/manager, mcconnell, 06/01/2005

Archive powered by MHonArc 2.6.24.

Top of Page