notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2676 - development/main/metro/composition/content/src/main/net/dpml/composition/content
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2676 - development/main/metro/composition/content/src/main/net/dpml/composition/content
- Date: Mon, 30 May 2005 10:01:12 -0400
Author: mcconnell AT dpml.net
Date: Mon May 30 10:01:12 2005
New Revision: 2676
Removed:
development/main/metro/composition/content/src/main/net/dpml/composition/content/CompositionContentHandlerDescriptor.java
Modified:
development/main/metro/composition/content/src/main/net/dpml/composition/content/CompositionContentHandlerRegistry.java
Log:
renaming
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
Mon May 30 10:01:12 2005
@@ -19,25 +19,29 @@
package net.dpml.composition.content;
import java.io.IOException;
+import java.net.URI;
import java.net.ContentHandler;
-import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
-import net.dpml.transit.content.ContentHandlerDescriptor;
-import net.dpml.transit.content.DefaultContentHandlerRegistry;
+import net.dpml.transit.TransitException;
+import net.dpml.transit.model.Logger;
+import net.dpml.transit.model.RegistryModel;
+import net.dpml.transit.model.ContentModel;
+import net.dpml.transit.content.DefaultContentRegistry;
/**
* A registry of descriptions of plugable content handlers. This
implementation
* maps user defined preferences to instance of ContentHandlerDescriptor.
*/
-public class CompositionContentHandlerRegistry extends
DefaultContentHandlerRegistry
+public class CompositionContentHandlerRegistry extends DefaultContentRegistry
{
//
------------------------------------------------------------------------
// state
//
------------------------------------------------------------------------
private Logger m_logger;
+ private RegistryModel m_model;
//
------------------------------------------------------------------------
// constructor
@@ -48,13 +52,12 @@
* artifact types, and values that correspond to the description of a
* content type handler plugins.
*
- * @param logger the assigned logging channel
- * @param prefs the root preferences node for content handler plugin
settings
+ * @param model the registry model
*/
- public CompositionContentHandlerRegistry( Logger logger, Preferences
prefs ) throws BackingStoreException
+ public CompositionContentHandlerRegistry( RegistryModel model ) throws
BackingStoreException
{
- super( logger, prefs );
- m_logger = logger;
+ super( model );
+ m_logger = model.getLogger();
}
//
------------------------------------------------------------------------
@@ -70,12 +73,22 @@
}
else if( "part".equals( type ) )
{
- Preferences prefs = Preferences.systemNodeForPackage( getClass()
);
- Preferences p = prefs.node( "part" );
- p.put( "title", "Part Content Handler" );
- p.put( "uri", "@COMPOSITION-CONTENT-PART-HANDLER-PLUGIN-URI@" );
- ContentHandlerDescriptor descriptor = new
CompositionContentHandlerDescriptor( m_logger, p );
- return getContentHandler( descriptor );
+ 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;
+ IOException ioe = new IOException( error );
+ ioe.initCause( e );
+ throw ioe;
+ }
}
else
{
@@ -83,41 +96,7 @@
}
}
- //
------------------------------------------------------------------------
- // internals
- //
------------------------------------------------------------------------
-
- /**
- * Add a description of a content handler based on a supplied
- * prefernces object. The name of the preferences object
- * corresponds to an artifact type. Request for the resolution
- * of URL content may be resolved by locating a content handler
- * plugin for the type exposed by the URL.
- */
- protected void addContentHandlerDescriptor( ContentHandlerDescriptor
descriptor )
- {
- super.addContentHandlerDescriptor( descriptor );
- }
-
- /**
- * Add a description of a content handler based on a supplied
- * prefernces object. The name of the preferences object
- * corresponds to an artifact type. Request for the resolution
- * of URL content may be resolved by locating a content handler
- * plugin for the type exposed by the URL.
- */
- protected void addContentHandlerDescriptor( Preferences prefs )
- {
- ContentHandlerDescriptor descriptor = new
CompositionContentHandlerDescriptor( m_logger, prefs );
- addContentHandlerDescriptor( descriptor );
- }
+ private static final String PART = "part";
- /**
- * Remove a content handler descriptor.
- * @param prefs the preferences node
- */
- protected ContentHandlerDescriptor removeContentHandlerDescriptor(
Preferences prefs )
- {
- return super.removeContentHandlerDescriptor( prefs );
- }
+ private static final String PART_HANDLER_PLUGIN_PATH =
"@COMPOSITION-CONTENT-PART-HANDLER-PLUGIN-URI@";
}
- svn commit: r2676 - development/main/metro/composition/content/src/main/net/dpml/composition/content, mcconnell, 05/29/2005
Archive powered by MHonArc 2.6.24.