Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1896 - development/main/transit/core/handler/src/main/net/dpml/transit/artifact

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1896 - development/main/transit/core/handler/src/main/net/dpml/transit/artifact
  • Date: Thu, 24 Feb 2005 21:00:46 +0100

Author: mcconnell
Date: Thu Feb 24 21:00:44 2005
New Revision: 1896

Modified:

development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java

development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Log:
Remove the exposure of the ResourceHost[] from SecureTransitContext by
pushing the ResourceHost[] creation down into the CacheHandlerFactory as host
creation should be a concern private to the CacheHandler implementation
Still need to review this some more as the creation of hosts using properties
and xml can be pushed down into the CacheHandler implementation. This
suggests that the CacheHandler implementation class should be declared in
transit.properties, and that cache.properites is simply a property file used
by the FileCacheHandler implementation.


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/CacheHandlerFactory.java
Thu Feb 24 21:00:44 2005
@@ -28,6 +28,7 @@

import net.dpml.transit.TransitException;
import net.dpml.transit.monitors.Monitor;
+import net.dpml.transit.monitors.SystemMonitor;

/**
* Internal cache handler factory.
@@ -67,7 +68,7 @@
/**
* Monitor
*/
- private Monitor m_monitor;
+ private SystemMonitor m_monitor;

//
------------------------------------------------------------------------
// constructor
@@ -77,7 +78,7 @@
* Creation of a new cache handler factory.
* @param authorative the authorative base url
*/
- CacheHandlerFactory( URL authorative, Monitor monitor )
+ CacheHandlerFactory( URL authorative, SystemMonitor monitor )
{
m_authorative = authorative;
m_monitor = monitor;
@@ -87,20 +88,31 @@
// implementation
//
------------------------------------------------------------------------

- /** Creates a cache handler from the definition in the properties.
+ /**
+ * Creates a cache handler from the definition in the properties.
*
* The CacheHandler constructor MUST have the signature of;
* <code><pre>
* MyCacheHandler( SecuredTransitContext context, Properties props )
* </pre></code>
- * @param hosts the set of hosts assigned to the handler
* @return the cache handler
* @exception IOException if an io error occurs
* @exception TransitException if a transit system error occurs
*/
- CacheHandler createCacheHandler( ResourceHost[] hosts )
+ CacheHandler createCacheHandler()
throws TransitException, IOException
{
+ //
+ // SJM: this should me modified such that the implemetation class is
+ // responsible for the reading of properties, establishment of
hosts,
+ // and creation of the resolver (all cache handler implementation
+ // concerns). I.e. arguments to the CacheHandler constructor should
+ // be changed to [URL authorative, Monitor monitor )].
+ //
+
+ ResourceHostFactory rhFactory = new ResourceHostFactory(
m_authorative, m_monitor );
+ ResourceHost[] hosts = rhFactory.createResourceHosts();
+
Properties props = getCacheProperties();
LocationResolver resolver = createResolver( props );


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Thu Feb 24 21:00:44 2005
@@ -196,12 +196,10 @@
{
URL authorative = establishAuthority( monitor );
monitor.notifyAuthority( authorative );
- ResourceHostFactory rhFactory = new ResourceHostFactory(
authorative, monitor );
- ResourceHost[] hosts = rhFactory.createResourceHosts();
CacheHandlerFactory chFactory = new CacheHandlerFactory(
authorative, monitor );
- CacheHandler ch = chFactory.createCacheHandler( hosts );
+ CacheHandler ch = chFactory.createCacheHandler();
monitor.notifyCacheHandlerCreation( ch );
- m_CONTEXT = new SecuredTransitContext( authorative, hosts, ch );
+ m_CONTEXT = new SecuredTransitContext( authorative, ch );
return m_CONTEXT;
}
catch( IOException e )
@@ -217,11 +215,10 @@
* @param handler the cache handler
* @exception TransitException if a context creation error occurs
*/
- private SecuredTransitContext( URL authorative, ResourceHost[] hosts,
CacheHandler handler )
+ private SecuredTransitContext( URL authorative, CacheHandler handler )
throws TransitException
{
m_authorativeHost = authorative;
- m_resourceHosts = hosts;
m_cacheHandler = handler;
try
{
@@ -269,15 +266,6 @@
return m_authorativeHost;
}

- /**
- * Return the resource host sequence.
- * @return the host sequence
- */
- ResourceHost[] getResourceHosts()
- {
- return m_resourceHosts;
- }
-
/**
* Resolve the authorative url. The implementation will check for a
* system property named "dpml.transit.authority.file". If the value



  • svn commit: r1896 - development/main/transit/core/handler/src/main/net/dpml/transit/artifact, mcconnell, 02/24/2005

Archive powered by MHonArc 2.6.24.

Top of Page