Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2623 - in development/main: . transit/core/handler/src/main/net/dpml/transit/configuration transit/core/handler/src/main/net/dpml/transit/manager transit/core/handler/src/test/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: r2623 - in development/main: . transit/core/handler/src/main/net/dpml/transit/configuration transit/core/handler/src/main/net/dpml/transit/manager transit/core/handler/src/test/net/dpml/transit/manager
  • Date: Thu, 19 May 2005 12:11:31 +0000

Author: mcconnell AT dpml.net
Date: Thu May 19 12:11:28 2005
New Revision: 2623

Added:

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginListener.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RepositoryDirector.java
development/main/transit/core/handler/src/main/net/dpml/transit/manager/

development/main/transit/core/handler/src/main/net/dpml/transit/manager/AbstractPluginManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/manager/CacheManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/manager/HostManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/manager/RepositoryManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/manager/TransitManager.java
development/main/transit/core/handler/src/test/net/dpml/transit/manager/

development/main/transit/core/handler/src/test/net/dpml/transit/manager/RepositoryManagerTestCase.java

development/main/transit/core/handler/src/test/net/dpml/transit/manager/TransitManagerTestCase.java
Removed:

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/ContentPluginChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostAddedEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangedEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostPluginChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostRemovedEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitListener.java
Modified:
development/main/build.sh

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/ContentDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryDirector.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryEvent.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryListener.java

development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java
Log:
Update to the management model and addition of a skeleton implementation.

Modified: development/main/build.sh
==============================================================================
--- development/main/build.sh (original)
+++ development/main/build.sh Thu May 19 12:11:28 2005
@@ -13,6 +13,7 @@
# magic build magic
# depot build depot
# metro build metro
+# test build test

build()
{
@@ -62,6 +63,13 @@
cd -
}

+test()
+{
+ cd test
+ build clean install
+ cd -
+}
+
ID=$2
TARGET=$1

@@ -73,7 +81,8 @@
echo " magic -- build the magic distribution"
echo " depot -- build the depot distribution"
echo " metro -- build the metro distribution"
- echo " all -- builds transit, magic, metro distributions"
+ echo " test -- build the integration tests"
+ echo " all -- builds transit, magic, metro distributions and
integration tests"
echo " [revision] optional build revision identified used when"
echo " building number releases."
exit 1
@@ -99,6 +108,10 @@
metro
fi

+if [ "$TARGET" == "test" ] ; then
+ test
+fi
+
if [ "$TARGET" == "central" ] ; then
central
fi
@@ -108,4 +121,5 @@
magic
depot
metro
+ test
fi

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheDirector.java
Thu May 19 12:11:28 2005
@@ -26,7 +26,7 @@
* cache subsystem. Instances of CacheDirector shall be supplied to cache
handler
* implementations as constructor arguments.
*/
-public interface CacheDirector
+public interface CacheDirector extends PluginDirector
{
/**
* Return the directory to be used by the cache handler as the cache
directory.
@@ -35,13 +35,6 @@
File getCacheDirectory();

/**
- * Return the uri of the host implementation plugin.
- * @param id the immutable host id
- * @return the plugin uri
- */
- URI getPluginForHost( String id );
-
- /**
* Return the array of hosts configured for the cache.
* @return the host director array
*/

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/CacheListener.java
Thu May 19 12:11:28 2005
@@ -22,17 +22,22 @@

public interface CacheListener extends EventListener
{
+ /**
+ * Notify the listener of a change to the cache directory.
+ * @param event the cache directory change event
+ */
void cacheDirectoryChanged( FileChangeEvent event );

- void hostAdded( HostAddedEvent event );
-
- void hostRemoved( HostRemovedEvent event );
+ /**
+ * Notify the listener of the addition of a new host.
+ * @param event the host added event
+ */
+ void hostAdded( HostEvent event );

/**
- * Notify a regstry listener of the change to the plugin assigned
- * to be the host handler.
- * @param event the host plugin change event
+ * Notify the listener of the removal of a host.
+ * @param event the host removed event
*/
- void hostPluginChanged( HostPluginChangeEvent event );
+ void hostRemoved( HostEvent event );

}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/ContentDirector.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/ContentDirector.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/ContentDirector.java
Thu May 19 12:11:28 2005
@@ -21,11 +21,11 @@
import java.net.URI;

/**
- * A ContentDirector maintains information about the configuration of the
Transit
- * content registry subsystem. Instances of ContentDirector shall be
supplied to
- * registry implementations as constructor arguments.
+ * A ContentDirector maintains information about the contiguration
+ * of a content handler. Instances of ContentDirector are used as
+ * constructor arguments to content handler plugins.
*/
-public interface ContentDirector
+public interface ContentDirector extends PluginDirector
{
/**
* Return the immutable content type identifier.

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/FileChangeEvent.java
Thu May 19 12:11:28 2005
@@ -21,26 +21,18 @@
import java.io.File;
import java.util.EventObject;

-public class FileChangeEvent extends EventObject
+public abstract class FileChangeEvent extends EventObject
{
- private final File m_old;
- private final File m_new;
+ private final File m_file;

- public FileChangeEvent( Object source, File old, File replacement )
+ public FileChangeEvent( Object source, File file )
{
super( source );
-
- m_old = old;
- m_new = replacement;
+ m_file = file;
}

- public File getOldFile()
- {
- return m_old;
- }
-
- public File getNewFile()
+ public File getFile()
{
- return m_new;
+ return m_file;
}
}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangeEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostChangeEvent.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventObject;
+
+public class HostChangeEvent extends EventObject
+{
+ private final String[] m_features;
+
+ public HostChangeEvent( HostDirector host, String[] features )
+ {
+ super( host );
+ m_features = features;
+ }
+
+ public String[] getFeatureNames()
+ {
+ return m_features;
+ }
+}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostDirector.java
Thu May 19 12:11:28 2005
@@ -30,7 +30,7 @@
* synchronization via change events raised by implementations of this
* interface.
*/
-public interface HostDirector
+public interface HostDirector extends PluginDirector
{
// Based on the resource descriptor, this interface attempt to reduce
// down the information needed at instantiation and subsequent runtime.
@@ -102,5 +102,6 @@
* @param listener the host change listener to remove
*/
void removeHostListener( HostListener listener );
+
}


Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostEvent.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostEvent.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventObject;
+
+public abstract class HostEvent extends EventObject
+{
+ private final HostDirector m_host;
+
+ public HostEvent( CacheDirector source, HostDirector host )
+ {
+ super( source );
+ m_host = host;
+ }
+
+ public HostDirector getHostDirector()
+ {
+ return m_host;
+ }
+}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/HostListener.java
Thu May 19 12:11:28 2005
@@ -32,6 +32,6 @@
* Notify a consumer of an aggregated set of changes.
* @param event the host change event
*/
- void hostChanged( HostChangedEvent event );
+ void hostChanged( HostChangeEvent event );
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginChangeEvent.java
Thu May 19 12:11:28 2005
@@ -21,7 +21,7 @@
import java.net.URI;
import java.util.EventObject;

-public class PluginChangeEvent extends EventObject
+public abstract class PluginChangeEvent extends EventObject
{
private final URI m_plugin;


Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginDirector.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginDirector.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.net.URI;
+
+/**
+ * A PluginDirector maintains information about the configuration of
+ * a pluggable subsystem.
+ */
+public interface PluginDirector
+{
+ /**
+ * Return the uri of the plugin to be used for cache management.
+ * @return the cache handler plugin uri
+ */
+ URI getPluginURI();
+
+ /**
+ * Add a plugin listener to the director.
+ * @param listener the listener to add
+ */
+ void addPluginListener( PluginListener listener );
+
+ /**
+ * Remove a plugin listener from the director.
+ * @param listener the listener to remove
+ */
+ void removePluginListener( PluginListener listener );
+
+}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginListener.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/PluginListener.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.util.EventListener;
+
+/**
+ * Interface implemented by objects concerning with plugin
+ * bindings.
+ */
+public interface PluginListener extends EventListener
+{
+ /**
+ * Notification of the change to a plugin uri assigned to a sub-system.
+ * @param event a plugin change event
+ */
+ void pluginChanged( PluginChangeEvent event );
+
+}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryDirector.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryDirector.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryDirector.java
Thu May 19 12:11:28 2005
@@ -25,7 +25,7 @@
* content registry subsystem. Instances of RegistryDirector shall be
supplied to
* registry implementations as constructor arguments.
*/
-public interface RegistryDirector
+public interface RegistryDirector extends PluginDirector
{
/**
* Return an array of content directors currently assigned to the
registry.
@@ -34,13 +34,6 @@
ContentDirector[] getContentDirectors();

/**
- * Return the uri assigned for the content handler for a given content
type.
- * @param type the content handler type
- * @return the assigned content handler plugin URI
- */
- URI getPluginForContentHandler( String type );
-
- /**
* Add a regstry change listener.
* @param the registry change listener to add
*/

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryEvent.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryEvent.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryEvent.java
Thu May 19 12:11:28 2005
@@ -20,7 +20,7 @@

import java.util.EventObject;

-public class RegistryEvent extends EventObject
+public abstract class RegistryEvent extends EventObject
{
private final ContentDirector m_content;
private final RegistryDirector m_registry;

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryListener.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryListener.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RegistryListener.java
Thu May 19 12:11:28 2005
@@ -39,10 +39,4 @@
*/
void contentRemoved( RegistryEvent event );

- /**
- * Notify a regstry listener of the change to the plugin assigned
- * to be the content handler for a content type.
- * @param event the content plugin change event
- */
- void contentPluginChanged( ContentPluginChangeEvent event );
}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RepositoryDirector.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/RepositoryDirector.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005 Stephen McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.configuration;
+
+import java.net.URI;
+
+/**
+ * A RepositoryDirector maintains information about the configuration of the
Transit
+ * repository service.
+ */
+public interface RepositoryDirector extends PluginDirector
+{
+}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/configuration/TransitDirector.java
Thu May 19 12:11:28 2005
@@ -33,44 +33,18 @@
CacheDirector getCacheDirector();

/**
- * Return the uri of the plugin to be used for cache management.
- * @return the cache handler plugin uri
- */
- URI getCachePluginURI();
-
- /**
- * Return the director maintiaining configuration information about
- * the conent registry.
+ * Return the director maintaining configuration information about
+ * the content registry.
*
* @return the content director
*/
- ContentDirector getContentDirector();
+ RegistryDirector getContentRegistryDirector();

/**
- * Return the uri of the plugin to be used for content registry
management.
- * @return the cache handler plugin uri
- */
- URI getContentPluginURI();
-
- /**
- * Return the uri of the plugin to be used for the repository
implementation.
- * @return the repository implementation plugin uri
- */
- URI getRepositoryPluginURI();
-
- /**
- * Add a listener to the director. The listener will be
- * notified of changes to the cache handler plugin uri and
- * content handler uri.
- *
- * @param listener the listener to add
- */
- void addTransitListener( TransitListener listener );
-
- /**
- * Remove a listener from the director.
- *
- * @param listener the listener to remove
+ * Return the director maintaining configuration information about
+ * the repository service.
+ *
+ * @return the repository director
*/
- void removeTransitListener( TransitListener listener );
+ RepositoryDirector getRepositoryDirector();
}

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/AbstractPluginManager.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/AbstractPluginManager.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.net.URI;
+import java.util.EventListener;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import net.dpml.transit.event.EventProducer;
+import net.dpml.transit.configuration.PluginDirector;
+import net.dpml.transit.configuration.PluginChangeEvent;
+import net.dpml.transit.configuration.PluginListener;
+
+/**
+ * An abstract plugin manager.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ * @version $Id: StandardTransitDirector.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ */
+abstract class AbstractPluginManager extends EventProducer implements
PluginDirector
+{
+ private final Logger m_logger;
+
+ private URI m_uri;
+
+ public AbstractPluginManager( Logger logger, URI uri )
+ {
+ if( null == logger )
+ {
+ throw new NullPointerException( "logger" );
+ }
+ m_logger = logger;
+ m_uri = uri;
+ }
+
+ protected Logger getLogger()
+ {
+ return m_logger;
+ }
+
+ public void notifyChange( PluginChangeEvent event )
+ {
+ synchronized( m_lock )
+ {
+ m_uri = event.getPluginURI();
+ super.enqueueEvent( event );
+ }
+ }
+
+ public void processPluginChangeEvent( PluginChangeEvent event )
+ {
+ EventListener[] listeners = super.listeners();
+ for( int i=0; i<listeners.length; i++ )
+ {
+ EventListener listener = listeners[i];
+ if( listener instanceof PluginListener )
+ {
+ PluginListener pl = (PluginListener) listener;
+ try
+ {
+ pl.pluginChanged( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "PluginListener notification error.";
+ m_logger.log( Level.SEVERE, error, e );
+ }
+ }
+ }
+ }
+
+ /**
+ * Return the plugin uri.
+ * @return the plugin uri
+ */
+ public URI getPluginURI()
+ {
+ synchronized( m_lock )
+ {
+ return m_uri;
+ }
+ }
+
+ /**
+ * Add a plugin listener to the director.
+ * @param listener the listener to add
+ */
+ public void addPluginListener( PluginListener listener )
+ {
+ super.addListener( listener );
+ }
+
+ /**
+ * Remove a plugin listener from the director.
+ * @param listener the listener to remove
+ */
+ public void removePluginListener( PluginListener listener )
+ {
+ super.addListener( listener );
+ }
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/CacheManager.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/CacheManager.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.io.File;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Iterator;
+import java.util.EventObject;
+import java.util.EventListener;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.net.URI;
+
+import net.dpml.transit.configuration.CacheDirector;
+import net.dpml.transit.configuration.HostDirector;
+import net.dpml.transit.configuration.PluginChangeEvent;
+import net.dpml.transit.configuration.CacheListener;
+import net.dpml.transit.configuration.FileChangeEvent;
+import net.dpml.transit.configuration.HostEvent;
+
+/**
+ * Default implementation of the cache director.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ * @version $Id: StandardTransitDirector.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ */
+public class CacheManager extends AbstractPluginManager implements
CacheDirector
+{
+ private final List m_list = new LinkedList();
+ private File m_cache;
+
+ public CacheManager( Logger logger, URI uri, File cache, HostDirector[]
hosts )
+ {
+ super( logger, uri );
+ m_cache = cache;
+ for( int i=0; i<hosts.length; i++ )
+ {
+ HostDirector d = hosts[i];
+ m_list.add( d );
+ }
+ }
+
+ public void setCacheDirectory( File dir )
+ {
+ synchronized( m_lock )
+ {
+ m_cache = dir;
+ CacheDirectoryChangeEvent event = new CacheDirectoryChangeEvent(
this, dir );
+ super.enqueueEvent( event );
+ }
+ }
+
+ public void setPluginURI( URI uri )
+ {
+ synchronized( m_lock )
+ {
+ CachePluginChangeEvent event = new CachePluginChangeEvent( this,
uri );
+ notifyChange( event );
+ }
+ }
+
+ public void addHostDirector( HostDirector director, int priority )
+ {
+ String id = director.getID();
+ synchronized( m_list )
+ {
+ Iterator iterator = m_list.iterator();
+ while( iterator.hasNext() )
+ {
+ HostDirector d = (HostDirector) iterator.next();
+ if( id.equals( d.getID() ) )
+ {
+ final String error =
+ "Host already registered."
+ + "\nHost ID: " + id;
+ throw new IllegalArgumentException( error );
+ }
+ }
+ m_list.add( director );
+ HostAddedEvent event = new HostAddedEvent( this, director,
priority );
+ super.enqueueEvent( event );
+ }
+ }
+
+ public void removeHostDirector( HostDirector director )
+ {
+ synchronized( m_list )
+ {
+ boolean removed = m_list.remove( director );
+ if( removed )
+ {
+ HostRemovedEvent event = new HostRemovedEvent( this,
director );
+ super.enqueueEvent( event );
+ }
+ }
+ }
+
+ /**
+ * Return the directory to be used by the cache handler as the cache
directory.
+ * @return the cache directory.
+ */
+ public File getCacheDirectory()
+ {
+ return m_cache;
+ }
+
+ /**
+ * Return an array of hosts currently assigned to the cache.
+ * @return the host director array
+ */
+ public HostDirector[] getHostDirectors()
+ {
+ return (HostDirector[]) m_list.toArray( new HostDirector[0] );
+ }
+
+ /**
+ * Add a cache change listener.
+ * @param the listener to add
+ */
+ public void addCacheListener( CacheListener listener )
+ {
+ super.addListener( listener );
+ }
+
+ /**
+ * Remove a cache change listener.
+ * @param the listener to remove
+ */
+ public void removeCacheListener( CacheListener listener )
+ {
+ super.removeListener( listener );
+ }
+
+ public void processEvent( EventObject event )
+ {
+ if( event instanceof PluginChangeEvent )
+ {
+ super.processPluginChangeEvent( (PluginChangeEvent) event );
+ }
+ else if( event instanceof HostEvent )
+ {
+ processHostEvent( (HostEvent) event );
+ }
+ else if( event instanceof CacheDirectoryChangeEvent )
+ {
+ processCacheDirectoryChangeEvent( (CacheDirectoryChangeEvent)
event );
+ }
+ else
+ {
+ final String error =
+ "Event type not regognized."
+ + "\nEvent Class: " + event.getClass();
+ throw new IllegalArgumentException( error );
+ }
+ }
+
+ public void processHostEvent( HostEvent event )
+ {
+ EventListener[] listeners = super.listeners();
+ for( int i=0; i<listeners.length; i++ )
+ {
+ EventListener eventListener = listeners[i];
+ if( eventListener instanceof CacheListener )
+ {
+ CacheListener listener = (CacheListener) eventListener;
+ if( event instanceof HostAddedEvent )
+ {
+ try
+ {
+ listener.hostAdded( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "CacheListener host addition notification error.";
+ getLogger().log( Level.SEVERE, error, e );
+ }
+ }
+ else if( event instanceof HostRemovedEvent )
+ {
+ try
+ {
+ listener.hostRemoved( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "CacheListener host removed notification error.";
+ getLogger().log( Level.SEVERE, error, e );
+ }
+ }
+ }
+ }
+ }
+
+ private void processCacheDirectoryChangeEvent( CacheDirectoryChangeEvent
event )
+ {
+ EventListener[] listeners = super.listeners();
+ for( int i=0; i<listeners.length; i++ )
+ {
+ EventListener listener = listeners[i];
+ if( listener instanceof CacheListener )
+ {
+ CacheListener cl = (CacheListener) listener;
+ try
+ {
+ cl.cacheDirectoryChanged( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "CacheListener host addition notification error.";
+ getLogger().log( Level.SEVERE, error, e );
+ }
+ }
+ }
+ }
+
+ static class HostAddedEvent extends HostEvent
+ {
+ private int m_priority;
+
+ public HostAddedEvent( CacheDirector source, HostDirector host, int
priority )
+ {
+ super( source, host );
+ }
+
+ public int getPriority()
+ {
+ return m_priority;
+ }
+ }
+
+ static class HostRemovedEvent extends HostEvent
+ {
+ public HostRemovedEvent( CacheDirector source, HostDirector host )
+ {
+ super( source, host );
+ }
+ }
+
+ static class CachePluginChangeEvent extends PluginChangeEvent
+ {
+ /**
+ * Creation of a new CachePluginChangeEvent.
+ *
+ * @param source the object initiating the event
+ * @param plugin the plugin uri
+ */
+ public CachePluginChangeEvent( CacheDirector source, URI plugin )
+ {
+ super( source, plugin );
+ }
+ }
+
+ class CacheDirectoryChangeEvent extends FileChangeEvent
+ {
+ public CacheDirectoryChangeEvent( Object source, File file )
+ {
+ super( source, file );
+ }
+ }
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/HostManager.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/HostManager.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.util.Map;
+import java.util.EventObject;
+import java.util.EventListener;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.net.URI;
+import java.net.URL;
+import java.net.Authenticator;
+
+import net.dpml.transit.configuration.HostDirector;
+import net.dpml.transit.configuration.PluginDirector;
+import net.dpml.transit.configuration.PluginChangeEvent;
+import net.dpml.transit.configuration.HostChangeEvent;
+import net.dpml.transit.configuration.HostListener;
+
+/**
+ * Default implementation of a host manager.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ * @version $Id: HostManager.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ */
+public class HostManager extends AbstractPluginManager implements
HostDirector
+{
+ private final String m_id;
+
+ public HostManager( Logger logger, String id )
+ {
+ this( logger, id, null );
+ }
+
+ public HostManager( Logger logger, String id, URI uri )
+ {
+ super( logger, uri );
+ if( null == id )
+ {
+ throw new NullPointerException( "id" );
+ }
+ m_id = id;
+ }
+
+ public void setPluginURI( URI uri )
+ {
+ synchronized( m_lock )
+ {
+ HostPluginChangeEvent event = new HostPluginChangeEvent( this,
uri );
+ notifyChange( event );
+ }
+ }
+
+ public void setFeatures( Map map )
+ {
+ throw new UnsupportedOperationException( "setFeatures/0" );
+ }
+
+ //----------------------------------------------------------------------
+ // HostDirector
+ //----------------------------------------------------------------------
+
+ /**
+ * Return an immutable host identifier. The host identifier shall be
+ * guranteed to be unique and constant for the life of the director.
+ */
+ public String getID()
+ {
+ return m_id;
+ }
+
+ /**
+ * Return the name of the resource host. The value returned may be used
to uniquely
+ * identify the host within the set of managed hosts.
+ */
+ public String getHostName()
+ {
+ throw new UnsupportedOperationException( "getHostName/0" );
+ }
+
+ /**
+ * Return the host base url.
+ * @return the base url
+ */
+ public URL getBaseURL()
+ {
+ throw new UnsupportedOperationException( "getBaseURL/0" );
+ }
+
+ /**
+ * Return index url.
+ * @return the index url
+ */
+ public String getIndexURL()
+ {
+ throw new UnsupportedOperationException( "getIndexURL/0" );
+ }
+
+ /**
+ * Return the enabled status of the host.
+ * @return TRUE if enabled
+ */
+ public boolean getEnabled()
+ {
+ throw new UnsupportedOperationException( "getEnabled/0" );
+ }
+
+ /**
+ * Return the trusted status.
+ * @return TRUE if trusted
+ */
+ public boolean getTrusted()
+ {
+ throw new UnsupportedOperationException( "getTrusted/0" );
+ }
+
+ /**
+ * Return the host authenticator.
+ * @return the authenticator
+ */
+ public Authenticator getAuthenticator()
+ {
+ throw new UnsupportedOperationException( "getAuthenticator/0" );
+ }
+
+ /**
+ * Return the location resolver plugin uri.
+ * @return the uri of the location resolver plugin
+ */
+ public URI getLocationResolverPluginURI()
+ {
+ throw new UnsupportedOperationException( "getAuthenticator/0" );
+ }
+
+ /**
+ * Add a host change listener to the director.
+ * @param listener the host change listener to add
+ */
+ public void addHostListener( HostListener listener )
+ {
+ super.addListener( listener );
+ }
+
+ /**
+ * Remove a host change listener from the director.
+ * @param listener the host change listener to remove
+ */
+ public void removeHostListener( HostListener listener )
+ {
+ super.removeListener( listener );
+ }
+
+ //----------------------------------------------------------------------
+ // internal
+ //----------------------------------------------------------------------
+
+ protected void processEvent( EventObject event )
+ {
+ if( event instanceof PluginChangeEvent )
+ {
+ super.processPluginChangeEvent( (PluginChangeEvent) event );
+ }
+ else if( event instanceof HostChangeEvent )
+ {
+ processHostChangeEvent( (HostChangeEvent) event );
+ }
+ else
+ {
+ final String error =
+ "Event type not regognized."
+ + "\nEvent Class: " + event.getClass();
+ throw new IllegalArgumentException( error );
+ }
+ }
+
+ private void processHostChangeEvent( HostChangeEvent event )
+ {
+ EventListener[] listeners = super.listeners();
+ for( int i=0; i<listeners.length; i++ )
+ {
+ EventListener eventListener = listeners[i];
+ if( eventListener instanceof HostListener )
+ {
+ HostListener listener = (HostListener) eventListener;
+ try
+ {
+ listener.hostChanged( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "HostListener change notification error.";
+ getLogger().log( Level.SEVERE, error, e );
+ }
+ }
+ }
+ }
+
+ static class HostPluginChangeEvent extends PluginChangeEvent
+ {
+ /**
+ * Creation of a new HostPluginChangeEvent.
+ *
+ * @param source the object initiating the event
+ * @param plugin the plugin uri
+ */
+ public HostPluginChangeEvent( HostDirector source, URI plugin )
+ {
+ super( source, plugin );
+ }
+ }
+
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RegistryManager.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Iterator;
+import java.util.EventObject;
+import java.util.EventListener;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.net.URI;
+
+import net.dpml.transit.configuration.RegistryDirector;
+import net.dpml.transit.configuration.ContentDirector;
+import net.dpml.transit.configuration.PluginChangeEvent;
+import net.dpml.transit.configuration.RegistryListener;
+import net.dpml.transit.configuration.RegistryEvent;
+
+/**
+ * Default implementation of a content handler registry manager.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ * @version $Id: StandardTransitDirector.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ */
+public class RegistryManager extends AbstractPluginManager implements
RegistryDirector
+{
+ private final List m_list = new LinkedList();
+
+ public RegistryManager( Logger logger, URI uri, ContentDirector[]
content )
+ {
+ super( logger, uri );
+ for( int i=0; i<content.length; i++ )
+ {
+ ContentDirector c = content[i];
+ m_list.add( c );
+ }
+ }
+
+ public void setPluginURI( URI uri )
+ {
+ synchronized( m_lock )
+ {
+ RegistryPluginChangeEvent event = new RegistryPluginChangeEvent(
this, uri );
+ notifyChange( event );
+ }
+ }
+
+ public void addContentDirector( ContentDirector director )
+ {
+ String type = director.getContentType();
+ synchronized( m_list )
+ {
+ Iterator iterator = m_list.iterator();
+ while( iterator.hasNext() )
+ {
+ ContentDirector d = (ContentDirector) iterator.next();
+ if( type.equals( d.getContentType() ) )
+ {
+ final String error =
+ "Content type already registered."
+ + "\nType: " + type;
+ throw new IllegalArgumentException( error );
+ }
+ }
+ m_list.add( director );
+ ContentAddedEvent event = new ContentAddedEvent( this, director
);
+ super.enqueueEvent( event );
+ }
+ }
+
+ public void removeContentDirector( ContentDirector director )
+ {
+ synchronized( m_list )
+ {
+ boolean removed = m_list.remove( director );
+ if( removed )
+ {
+ ContentRemovedEvent event = new ContentRemovedEvent( this,
director );
+ super.enqueueEvent( event );
+ }
+ }
+ }
+
+ /**
+ * Return an array of content directors currently assigned to the
registry.
+ * @return the content director array
+ */
+ public ContentDirector[] getContentDirectors()
+ {
+ return (ContentDirector[]) m_list.toArray( new ContentDirector[0] );
+ }
+
+ /**
+ * Add a regstry change listener.
+ * @param the registry change listener to add
+ */
+ public void addRegistryListener( RegistryListener listener )
+ {
+ super.addListener( listener );
+ }
+
+ /**
+ * Remove a regstry change listener.
+ * @param the registry change listener to remove
+ */
+ public void removeRegistryListener( RegistryListener listener )
+ {
+ super.removeListener( listener );
+ }
+
+ public void processEvent( EventObject event )
+ {
+ if( event instanceof PluginChangeEvent )
+ {
+ super.processPluginChangeEvent( (PluginChangeEvent) event );
+ }
+ else if( event instanceof RegistryEvent )
+ {
+ processRegistryEvent( (RegistryEvent) event );
+ }
+ else
+ {
+ final String error =
+ "Event type not regognized."
+ + "\nEvent Class: " + event.getClass();
+ throw new IllegalArgumentException( error );
+ }
+ }
+
+ public void processRegistryEvent( RegistryEvent event )
+ {
+ EventListener[] listeners = super.listeners();
+ for( int i=0; i<listeners.length; i++ )
+ {
+ EventListener listener = listeners[i];
+ if( listener instanceof RegistryListener )
+ {
+ RegistryListener rl = (RegistryListener) listener;
+ if( event instanceof ContentAddedEvent )
+ {
+ try
+ {
+ rl.contentAdded( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "RegistryListener content addition notification
error.";
+ getLogger().log( Level.SEVERE, error, e );
+ }
+ }
+ else if( event instanceof ContentRemovedEvent )
+ {
+ try
+ {
+ rl.contentRemoved( event );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "RegistryListener content removed notification
error.";
+ getLogger().log( Level.SEVERE, error, e );
+ }
+ }
+ }
+ }
+ }
+
+ static class ContentAddedEvent extends RegistryEvent
+ {
+ public ContentAddedEvent( RegistryDirector source, ContentDirector
handler )
+ {
+ super( source, handler );
+ }
+ }
+
+ static class ContentRemovedEvent extends RegistryEvent
+ {
+ public ContentRemovedEvent( RegistryDirector source, ContentDirector
handler )
+ {
+ super( source, handler );
+ }
+ }
+
+ static class RegistryPluginChangeEvent extends PluginChangeEvent
+ {
+ /**
+ * Creation of a new RegistryPluginChangeEvent.
+ *
+ * @param source the object initiating the event
+ * @param plugin the plugin uri
+ */
+ public RegistryPluginChangeEvent( RegistryDirector source, URI
plugin )
+ {
+ super( source, plugin );
+ }
+ }
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RepositoryManager.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/RepositoryManager.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.util.EventObject;
+import java.util.EventListener;
+import java.util.logging.Logger;
+import java.net.URI;
+
+import net.dpml.transit.configuration.RepositoryDirector;
+import net.dpml.transit.configuration.PluginDirector;
+import net.dpml.transit.configuration.PluginChangeEvent;
+
+/**
+ * Default implementation of a repository manager.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ * @version $Id: StandardTransitDirector.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ */
+public class RepositoryManager extends AbstractPluginManager implements
RepositoryDirector
+{
+ public RepositoryManager( Logger logger )
+ {
+ super( logger, null );
+ }
+
+ public RepositoryManager( Logger logger, URI uri )
+ {
+ super( logger, uri );
+ if( null == uri )
+ {
+ throw new NullPointerException( "uri" );
+ }
+ }
+
+ public void setPluginURI( URI uri )
+ {
+ synchronized( m_lock )
+ {
+ RepositoryPluginChangeEvent event = new
RepositoryPluginChangeEvent( this, uri );
+ notifyChange( event );
+ }
+ }
+
+ public void processEvent( EventObject event )
+ {
+ if( event instanceof PluginChangeEvent )
+ {
+ super.processPluginChangeEvent( (PluginChangeEvent) event );
+ }
+ else
+ {
+ final String error =
+ "Event type not regignized."
+ + "\nEvent Class: " + event.getClass();
+ throw new IllegalArgumentException( error );
+ }
+ }
+
+ static class RepositoryPluginChangeEvent extends PluginChangeEvent
+ {
+ /**
+ * Creation of a new RepositoryPluginChangeEvent.
+ *
+ * @param source the object initiating the event
+ * @param plugin the plugin uri
+ */
+ public RepositoryPluginChangeEvent( RepositoryDirector source, URI
plugin )
+ {
+ super( source, plugin );
+ }
+ }
+
+}
+

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/TransitManager.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/TransitManager.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.net.URI;
+
+import net.dpml.transit.configuration.TransitDirector;
+import net.dpml.transit.configuration.CacheDirector;
+import net.dpml.transit.configuration.RegistryDirector;
+import net.dpml.transit.configuration.RepositoryDirector;
+
+/**
+ * The TransitManager class is the default TransitDirector implementation.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ * @version $Id: StandardTransitDirector.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ */
+public class TransitManager implements TransitDirector
+{
+ private final CacheDirector m_cache;
+ private final RegistryDirector m_registry;
+ private final RepositoryDirector m_repository;
+
+ public TransitManager(
+ final CacheDirector cache, final RegistryDirector registry, final
RepositoryDirector repository )
+ {
+ m_cache = cache;
+ m_registry = registry;
+ m_repository = repository;
+ }
+
+ /**
+ * Return the cache director.
+ * @return the cache director
+ */
+ public CacheDirector getCacheDirector()
+ {
+ return m_cache;
+ }
+
+ /**
+ * Return the director maintiaining configuration information about
+ * the conent registry.
+ *
+ * @return the content director
+ */
+ public RegistryDirector getContentRegistryDirector()
+ {
+ return m_registry;
+ }
+
+ /**
+ * Return the director maintaining configuration information about
+ * the repository service.
+ *
+ * @return the repository director
+ */
+ public RepositoryDirector getRepositoryDirector()
+ {
+ return m_repository;
+ }
+
+}
+

Added:
development/main/transit/core/handler/src/test/net/dpml/transit/manager/RepositoryManagerTestCase.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/manager/RepositoryManagerTestCase.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import java.net.URI;
+import java.util.logging.Logger;
+
+import junit.framework.TestCase;
+
+import net.dpml.transit.configuration.PluginChangeEvent;
+import net.dpml.transit.configuration.PluginListener;
+
+/**
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ */
+public class RepositoryManagerTestCase extends TestCase
+{
+ private int m_count = 0;
+
+ public void testRepositoryManager() throws Exception
+ {
+ Logger logger = Logger.getLogger( "test" );
+ RepositoryManager manager = new RepositoryManager( logger );
+ assertNull( "uri", manager.getPluginURI() );
+ }
+}
+

Added:
development/main/transit/core/handler/src/test/net/dpml/transit/manager/TransitManagerTestCase.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/manager/TransitManagerTestCase.java
Thu May 19 12:11:28 2005
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2005 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.transit.manager;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ */
+public class TransitManagerTestCase extends TestCase
+{
+ public void testTransitManager()
+ {
+ // TODO
+ }
+}
+



  • svn commit: r2623 - in development/main: . transit/core/handler/src/main/net/dpml/transit/configuration transit/core/handler/src/main/net/dpml/transit/manager transit/core/handler/src/test/net/dpml/transit/manager, mcconnell, 05/19/2005

Archive powered by MHonArc 2.6.24.

Top of Page