Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2711 - in development/main: depot/prefs/src/main/net/dpml/depot/prefs test/unit/plus/src/test/net/dpml/test/acme/plus transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/builder transit/core/handler/src/test/net/dpml/transit/manager transit/core/handler/src/test/net/dpml/transit/test transit/core/tools/src/main/net/dpml/transit/tools

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: r2711 - in development/main: depot/prefs/src/main/net/dpml/depot/prefs test/unit/plus/src/test/net/dpml/test/acme/plus transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/builder transit/core/handler/src/test/net/dpml/transit/manager transit/core/handler/src/test/net/dpml/transit/test transit/core/tools/src/main/net/dpml/transit/tools
  • Date: Sun, 05 Jun 2005 16:12:22 -0400

Author: mcconnell AT dpml.net
Date: Sun Jun 5 16:12:21 2005
New Revision: 2711

Added:

development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesStorageHome.java
- copied, changed from r2703,
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHome.java
Removed:

development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHelper.java
Modified:

development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java

development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/Main.java

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

development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/CacheHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentRegistryHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/HostHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutRegistryHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/ProxyHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/RepositoryHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitPreferences.java

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

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

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

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

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

development/main/transit/core/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
Log:
Add storage home.

Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesFrame.java
Sun Jun 5 16:12:21 2005
@@ -41,6 +41,7 @@
import net.dpml.transit.Transit;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.management.TransitManager;
+import net.dpml.transit.builder.TransitHome;

/**
* Dialog that presents the default preferences for DPML applications
including
@@ -74,7 +75,7 @@
*/
private static final int ZERO = 0;

- public DepotPreferencesFrame( TransitManager manager ) throws Exception
+ public DepotPreferencesFrame( TransitHome home ) throws Exception
{
super();

@@ -84,7 +85,7 @@
setTitle( "DPML Depot" );
Dimension size = new Dimension( DEFAULT_DIALOG_WIDTH,
DEFAULT_DIALOG_HEIGHT );
setSize( size );
- DepotPreferencesPanel panel = new DepotPreferencesPanel( this,
manager );
+ DepotPreferencesPanel panel = new DepotPreferencesPanel( this, home
);
setContentPane( panel );
getRootPane().setDefaultButton( panel.getDefaultButton() );
addWindowListener(

Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/DepotPreferencesPanel.java
Sun Jun 5 16:12:21 2005
@@ -46,6 +46,7 @@
import net.dpml.transit.management.CacheManager;
import net.dpml.transit.management.ContentRegistryManager;
import net.dpml.transit.management.ProxyManager;
+import net.dpml.transit.builder.TransitHome;

/**
* Panel that presents the default preferences for DPML applications
including
@@ -76,6 +77,7 @@

private ButtonPanel m_buttons;

+ private TransitHome m_home;
private TransitManager m_manager;
private LayoutRegistryManagerPanel m_layoutPanel;
private CacheManagerPanel m_cachePanel;
@@ -84,12 +86,15 @@

private final Window m_window;

- public DepotPreferencesPanel( Window window, final TransitManager
manager ) throws Exception
+ public DepotPreferencesPanel( Window window, final TransitHome home )
throws Exception
{
super( new BorderLayout() );

- m_manager = manager;
+ m_home = home;
m_window = window;
+ m_manager = home.createTransitManager();
+
+ Transit.getInstance( m_manager );

JLabel label =
IconHelper.createImageIconJLabel(
@@ -109,8 +114,8 @@
new Runnable() {
public void run()
{
- final CacheManager cache = manager.getCacheManager();
- final LayoutRegistryManager layouts =
manager.getLayoutRegistryManager();
+ final CacheManager cache = m_manager.getCacheManager();
+ final LayoutRegistryManager layouts =
m_manager.getLayoutRegistryManager();
m_layoutPanel = new LayoutRegistryManagerPanel( m_window,
layouts );
m_cachePanel = new CacheManagerPanel( m_window, cache,
layouts );
tabbedPane.addTab( "Cache", m_cachePanel );
@@ -124,7 +129,7 @@
new Runnable() {
public void run()
{
- final ContentRegistryManager content =
manager.getContentRegistryManager();
+ final ContentRegistryManager content =
m_manager.getContentRegistryManager();
m_registryPanel = new ContentRegistryManagerPanel( m_window,
content );
tabbedPane.addTab( "Content", m_registryPanel );
}
@@ -135,7 +140,7 @@
new Runnable() {
public void run()
{
- final ProxyManager proxy = manager.getProxyManager();
+ final ProxyManager proxy = m_manager.getProxyManager();
m_proxyPanel = new ProxyManagerPanel( m_window, proxy );
tabbedPane.addTab( "Proxy", m_proxyPanel );
}

Modified: development/main/depot/prefs/src/main/net/dpml/depot/prefs/Main.java
==============================================================================
--- development/main/depot/prefs/src/main/net/dpml/depot/prefs/Main.java
(original)
+++ development/main/depot/prefs/src/main/net/dpml/depot/prefs/Main.java
Sun Jun 5 16:12:21 2005
@@ -27,7 +27,8 @@
import net.dpml.transit.Transit;
import net.dpml.transit.adapter.LoggingAdapter;
import net.dpml.transit.management.TransitManager;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;
import net.dpml.transit.model.Logger;

/**
@@ -96,9 +97,8 @@
Preferences prefs = Preferences.userNodeForPackage( Transit.class );
try
{
- TransitManager manager = TransitHelper.createTransitManager(
logger, prefs );
- Transit.getInstance( manager );
- new DepotPreferencesFrame( manager );
+ TransitHome home = new PreferencesStorageHome( logger, prefs );
+ new DepotPreferencesFrame( home );
}
catch( Exception e )
{

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
Sun Jun 5 16:12:21 2005
@@ -31,7 +31,8 @@
import net.dpml.test.acme.Dimension;

import net.dpml.transit.Transit;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;
import net.dpml.transit.management.TransitManager;

/**
@@ -124,7 +125,8 @@
try
{
URI uri = new URI( CONTENT_MANAGER_PLUGIN );
- TransitManager MANAGER = TransitHelper.createTransitManager();
+ TransitHome home = new PreferencesStorageHome();
+ TransitManager MANAGER = home.createTransitManager();
MANAGER.getContentRegistryManager().setPluginURI( uri );
TRANSIT = Transit.getInstance( MANAGER );
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java
Sun Jun 5 16:12:21 2005
@@ -47,7 +47,8 @@
import net.dpml.transit.management.TransitManager;
import net.dpml.transit.manager.DefaultTransitManager;
import net.dpml.transit.adapter.LoggingAdapter;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.PreferencesStorageHome;
+import net.dpml.transit.builder.TransitHome;

/**
* The Transit class manages the establishment of a singleton transit
instance
@@ -153,8 +154,8 @@
{
try
{
- Logger logger = new LoggingAdapter();
- TransitModel model =
TransitHelper.createTransitManager( logger );
+ TransitHome home = new PreferencesStorageHome();
+ TransitModel model = home.createTransitManager();
return getInstance( model );
}
catch( TransitException e )

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/CacheHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/CacheHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/CacheHelper.java
Sun Jun 5 16:12:21 2005
@@ -41,7 +41,7 @@
* The LayoutRegistryHelper class provides support for the crreating of a
* ContentRegistryManager based on a supplied preferences node.
*/
-public class CacheHelper extends HostHelper
+class CacheHelper extends HostHelper
{
public static CacheManager createCacheManager(
LayoutRegistryModel registry, Logger logger, Preferences prefs )

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentHelper.java
Sun Jun 5 16:12:21 2005
@@ -30,7 +30,7 @@
* The LayoutHelper class is responsible for the setup of initial factory
* default preference settings.
*/
-public class ContentHelper extends PreferencesHelper
+class ContentHelper extends PreferencesHelper
{
public static ContentManager createContentManager( Logger logger,
Preferences prefs )
throws BuilderException

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentRegistryHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentRegistryHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ContentRegistryHelper.java
Sun Jun 5 16:12:21 2005
@@ -34,7 +34,7 @@
* The LayoutRegistryHelper class provides support for the crreating of a
* ContentRegistryManager based on a supplied preferences node.
*/
-public class ContentRegistryHelper extends ContentHelper
+class ContentRegistryHelper extends ContentHelper
{
public static ContentRegistryManager createContentRegistryManager(
Logger logger, Preferences prefs )
throws BackingStoreException, BuilderException, DuplicateKeyException

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/HostHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/HostHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/HostHelper.java
Sun Jun 5 16:12:21 2005
@@ -40,7 +40,7 @@
* The LayoutHelper class is responsible for the setup of initial factory
* default preference settings.
*/
-public class HostHelper extends PreferencesHelper
+class HostHelper extends PreferencesHelper
{
public static HostManager createHostManager(
LayoutRegistryModel registry, Logger logger, Preferences prefs )

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutHelper.java
Sun Jun 5 16:12:21 2005
@@ -32,7 +32,7 @@
* The LayoutHelper class is responsible for the setup of initial factory
* default preference settings.
*/
-public class LayoutHelper extends PreferencesHelper
+class LayoutHelper extends PreferencesHelper
{
public static LayoutManager createLayoutManager( Logger logger,
Preferences prefs )
throws BuilderException

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutRegistryHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutRegistryHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/LayoutRegistryHelper.java
Sun Jun 5 16:12:21 2005
@@ -35,7 +35,7 @@
* The LayoutHelper class is responsible for the setup of initial factory
* default preference settings.
*/
-public class LayoutRegistryHelper extends LayoutHelper
+class LayoutRegistryHelper extends LayoutHelper
{
public static LayoutRegistryManager createLayoutRegistryManager( Logger
logger, Preferences prefs )
throws BuilderException, BackingStoreException, DuplicateKeyException

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesHelper.java
Sun Jun 5 16:12:21 2005
@@ -27,7 +27,7 @@
* Utility class that provides support for the creation of URI and URL
* values from preference attributes.
*/
-public class PreferencesHelper
+class PreferencesHelper
{
public static URI getURI( Preferences prefs, String key ) throws
BuilderException
{

Copied:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesStorageHome.java
(from r2703,
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHelper.java)
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/PreferencesStorageHome.java
Sun Jun 5 16:12:21 2005
@@ -40,52 +40,78 @@
* The LayoutRegistryHelper class provides support for the crreating of a
* ContentRegistryManager based on a supplied preferences node.
*/
-public class TransitHelper
+public class PreferencesStorageHome implements TransitHome
{
- public static TransitManager createTransitManager()
- throws BuilderException
+ //
------------------------------------------------------------------------
+ // static
+ //
------------------------------------------------------------------------
+
+ private static Preferences DEFAULT_PREFS_NODE =
+ Preferences.userNodeForPackage( Transit.class );
+
+ //
------------------------------------------------------------------------
+ // state
+ //
------------------------------------------------------------------------
+
+ private Logger m_logger;
+ private final Preferences m_prefs;
+ private final URL m_authority;
+
+ //
------------------------------------------------------------------------
+ // constructor
+ //
------------------------------------------------------------------------
+
+ public PreferencesStorageHome()
{
- Logger logger = new LoggingAdapter();
- return createTransitManager( logger );
+ this( new LoggingAdapter() );
}

- public static TransitManager createTransitManager( Logger logger )
- throws BuilderException
+ public PreferencesStorageHome( Logger logger )
{
- Preferences prefs = Preferences.userNodeForPackage( Transit.class );
- return createTransitManager( logger, prefs, null );
+ this( logger, DEFAULT_PREFS_NODE );
}

- public static TransitManager createTransitManager( Preferences prefs )
- throws BuilderException
+ public PreferencesStorageHome( Preferences prefs )
{
- Logger logger = new LoggingAdapter();
- return createTransitManager( logger, prefs );
+ this( new LoggingAdapter(), prefs, null );
}

- public static TransitManager createTransitManager( Logger logger,
Preferences prefs )
- throws BuilderException
+ public PreferencesStorageHome( Logger logger, Preferences prefs )
{
- return createTransitManager( logger, prefs, null );
+ this( logger, prefs, null );
}

- public static TransitManager createTransitManager( Logger logger,
Preferences prefs, URL authority )
- throws BuilderException
+ public PreferencesStorageHome( Logger logger, Preferences prefs, URL
authority )
{
- if( null == prefs )
- {
- throw new NullPointerException( "prefs" );
- }
if( null == logger )
{
throw new NullPointerException( "logger" );
}
+ if( null == prefs )
+ {
+ throw new NullPointerException( "prefs" );
+ }
+ m_logger = logger;
+ m_prefs = prefs;
+ m_authority = authority;
+ }
+
+ //
------------------------------------------------------------------------
+ // TransitHome
+ //
------------------------------------------------------------------------
+
+ public TransitManager createTransitManager()
+ throws BuilderException
+ {
+ Logger logger = getLogger();
+ Preferences prefs = getPreferences();
+ URL authority = getAuthority();

//
// check for virgin prefs
//

- if( null != authority )
+ if( null != m_authority )
{
TransitPreferences.setupPreferences( prefs, authority );
}
@@ -99,31 +125,17 @@
}

//
- // create the subsystem
+ // create the sub-systems
//

+ ProxyManager proxy = createProxyManager();
+ LayoutRegistryManager layout = createLayoutRegistryManager();
+ CacheManager cache = createCacheManager( layout );
+ ContentRegistryManager content = createContentRegistryManager();
+ RepositoryManager repository = createRepositoryManager();
+
try
{
- ProxyManager proxy =
- ProxyHelper.createProxyManager(
- logger.getChildLogger( "proxy" ), prefs.node( "proxy" ) );
-
- LayoutRegistryManager layout =
- LayoutRegistryHelper.createLayoutRegistryManager(
- logger.getChildLogger( "layout" ), prefs.node( "layout" ) );
-
- CacheManager cache =
- CacheHelper.createCacheManager(
- layout, logger.getChildLogger( "cache" ), prefs.node(
"cache" ) );
-
- ContentRegistryManager content =
- ContentRegistryHelper.createContentRegistryManager(
- logger.getChildLogger( "content" ), prefs.node( "content" )
);
-
- RepositoryManager repository =
- RepositoryHelper.createRepositoryManager(
- logger.getChildLogger( "repository" ), prefs.node(
"repository" ) );
-
return new DefaultTransitManager(
logger, layout, cache, content, repository, proxy );
}
@@ -134,6 +146,107 @@
throw new BuilderException( error, e );
}
}
+
+ public void saveTransitManager( TransitManager manager ) throws
BuilderException
+ {
+ throw new UnsupportedOperationException( "saveTransitManager/1" );
+ }
+
+ private ProxyManager createProxyManager() throws BuilderException
+ {
+ try
+ {
+ Logger logger = getLogger().getChildLogger( "proxy" );
+ Preferences prefs = getPreferences().node( "proxy" );
+ return ProxyHelper.createProxyManager( logger, prefs );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "An error occured during construction of the proxy manager.";
+ throw new BuilderException( error, e );
+ }
+ }
+
+ private LayoutRegistryManager createLayoutRegistryManager() throws
BuilderException
+ {
+ try
+ {
+ Logger logger = getLogger().getChildLogger( "layout" );
+ Preferences prefs = getPreferences().node( "layout" );
+ return LayoutRegistryHelper.createLayoutRegistryManager( logger,
prefs );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "An error occured during construction of the layout registry
manager.";
+ throw new BuilderException( error, e );
+ }
+ }
+
+ private CacheManager createCacheManager( LayoutRegistryManager registry
) throws BuilderException
+ {
+ try
+ {
+ Logger logger = getLogger().getChildLogger( "cache" );
+ Preferences prefs = getPreferences().node( "cache" );
+ return CacheHelper.createCacheManager( registry, logger, prefs );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "An error occured during construction of the cache manager.";
+ throw new BuilderException( error, e );
+ }
+ }
+
+ private ContentRegistryManager createContentRegistryManager() throws
BuilderException
+ {
+ try
+ {
+ Logger logger = getLogger().getChildLogger( "content" );
+ Preferences prefs = getPreferences().node( "content" );
+ return ContentRegistryHelper.createContentRegistryManager(
logger, prefs );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "An error occured during construction of the content registry
manager.";
+ throw new BuilderException( error, e );
+ }
+ }
+
+ private RepositoryManager createRepositoryManager() throws
BuilderException
+ {
+ try
+ {
+ Logger logger = getLogger().getChildLogger( "repository" );
+ Preferences prefs = getPreferences().node( "repository" );
+ return RepositoryHelper.createRepositoryManager( logger, prefs );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "An error occured during construction of the repository
manager.";
+ throw new BuilderException( error, e );
+ }
+ }
+
+ private Preferences getPreferences()
+ {
+ return m_prefs;
+ }
+
+ private Logger getLogger()
+ {
+ return m_logger;
+ }
+
+ private URL getAuthority()
+ {
+ return m_authority;
+ }
+
}



Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ProxyHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ProxyHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/ProxyHelper.java
Sun Jun 5 16:12:21 2005
@@ -32,7 +32,7 @@
* The LayoutHelper class is responsible for the setup of initial factory
* default preference settings.
*/
-public class ProxyHelper extends PreferencesHelper
+class ProxyHelper extends PreferencesHelper
{
//
------------------------------------------------------------------------
// internalization

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/RepositoryHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/RepositoryHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/RepositoryHelper.java
Sun Jun 5 16:12:21 2005
@@ -31,7 +31,7 @@
* The LayoutHelper class is responsible for the setup of initial factory
* default preference settings.
*/
-public class RepositoryHelper extends PreferencesHelper
+class RepositoryHelper extends PreferencesHelper
{
public static RepositoryManager createRepositoryManager( Logger logger,
Preferences prefs )
throws BuilderException

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHome.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitHome.java
Sun Jun 5 16:12:21 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.builder;
+
+import net.dpml.transit.management.TransitManager;
+
+/**
+ * The Home defines the persistent storage home for transit management
configurations.
+ *
+ * @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
+ */
+public interface TransitHome
+{
+ TransitManager createTransitManager() throws BuilderException;
+
+ void saveTransitManager( TransitManager manager ) throws
BuilderException;
+}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitPreferences.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitPreferences.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/builder/TransitPreferences.java
Sun Jun 5 16:12:21 2005
@@ -56,7 +56,7 @@
* The TransitInstaller class is responsible for the setup of initial factory
* default preference settings.
*/
-public class TransitPreferences
+class TransitPreferences
{

//--------------------------------------------------------------------------
// static

Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
Sun Jun 5 16:12:21 2005
@@ -33,11 +33,11 @@
import net.dpml.transit.model.ProxyEvent;
import net.dpml.transit.model.ProxyListener;
import net.dpml.transit.model.Logger;
-
import net.dpml.transit.manager.DefaultProxyManager;
import net.dpml.transit.management.ProxyManager;
import net.dpml.transit.management.TransitManager;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;

/**
* @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
@@ -54,7 +54,8 @@
System.setProperty( "dpml.data", path );
Preferences prefs =
Preferences.userNodeForPackage( Transit.class ).node( "test"
).node( "proxy-manager-test" );
- m_manager = TransitHelper.createTransitManager( prefs );
+ TransitHome home = new PreferencesStorageHome( prefs );
+ m_manager = home.createTransitManager();
}

public void testProxyAuthentication() throws Exception

Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/manager/TransitManagerTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/manager/TransitManagerTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/manager/TransitManagerTestCase.java
Sun Jun 5 16:12:21 2005
@@ -29,7 +29,8 @@
import net.dpml.transit.Transit;
import net.dpml.transit.adapter.LoggingAdapter;
import net.dpml.transit.model.Logger;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;
import net.dpml.transit.management.TransitManager;

/**
@@ -46,7 +47,8 @@
m_data = new File( path );
System.setProperty( "dpml.data", path );
Preferences prefs = Preferences.userNodeForPackage( Transit.class
).node( "test" );
- m_manager = TransitHelper.createTransitManager( prefs );
+ TransitHome home = new PreferencesStorageHome( prefs );
+ m_manager = home.createTransitManager();
}

public void testCacheDirectory() throws Exception

Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/test/LinkTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/test/LinkTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/test/LinkTestCase.java
Sun Jun 5 16:12:21 2005
@@ -34,7 +34,8 @@
import net.dpml.transit.adapter.LoggingAdapter;
import net.dpml.transit.Transit;

-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;
import net.dpml.transit.management.TransitManager;

/**
@@ -60,7 +61,8 @@
Logger logger = Logger.getLogger( "test" );
//logger.setLevel( Level.parse( "FINE" ) );
LoggingAdapter adapter = new LoggingAdapter( logger );
- TransitManager manager = TransitHelper.createTransitManager(
adapter, prefs, authority );
+ TransitHome home = new PreferencesStorageHome( adapter, prefs,
authority );
+ TransitManager manager = home.createTransitManager();
TRANSIT = Transit.getInstance( manager );
}
}

Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/test/OfflineTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/test/OfflineTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/test/OfflineTestCase.java
Sun Jun 5 16:12:21 2005
@@ -33,7 +33,8 @@

import junit.framework.TestCase;

-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;
import net.dpml.transit.management.TransitManager;
import net.dpml.transit.adapter.LoggingAdapter;
import net.dpml.transit.Transit;
@@ -63,7 +64,8 @@
Logger logger = Logger.getLogger( "test" );
//logger.setLevel( Level.parse( "FINE" ) );
LoggingAdapter adapter = new LoggingAdapter( logger );
- TransitManager manager = TransitHelper.createTransitManager(
adapter, prefs, authority );
+ TransitHome home = new PreferencesStorageHome( adapter, prefs,
authority );
+ TransitManager manager = home.createTransitManager();
TRANSIT = Transit.getInstance( manager );
}
}

Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/test/OnlineTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/test/OnlineTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/test/OnlineTestCase.java
Sun Jun 5 16:12:21 2005
@@ -33,7 +33,8 @@

import net.dpml.transit.Transit;
import net.dpml.transit.management.TransitManager;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;

/**
* URL Handler TestCase for Offline operations.
@@ -51,7 +52,8 @@
{
Preferences prefs =
Preferences.userNodeForPackage( Transit.class
).node("test").node( "online-test" );
- TransitManager manager = TransitHelper.createTransitManager(
prefs );
+ TransitHome home = new PreferencesStorageHome( prefs );
+ TransitManager manager = home.createTransitManager();
TRANSIT = Transit.getInstance( manager );
}
}

Modified:
development/main/transit/core/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
==============================================================================
---
development/main/transit/core/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
(original)
+++
development/main/transit/core/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
Sun Jun 5 16:12:21 2005
@@ -32,7 +32,8 @@
import net.dpml.transit.model.Logger;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.management.TransitManager;
-import net.dpml.transit.builder.TransitHelper;
+import net.dpml.transit.builder.TransitHome;
+import net.dpml.transit.builder.PreferencesStorageHome;

/**
* Ant task that provides support for the import of build file templates
@@ -54,8 +55,9 @@
try
{
Logger logger = new AntAdapter( this );
- TransitModel model = TransitHelper.createTransitManager( logger
);
- Transit.getInstance( model );
+ TransitHome home = new PreferencesStorageHome( logger );
+ TransitManager manager = home.createTransitManager();
+ Transit.getInstance( manager );
}
catch( TransitAlreadyInitializedException e )
{



  • svn commit: r2711 - in development/main: depot/prefs/src/main/net/dpml/depot/prefs test/unit/plus/src/test/net/dpml/test/acme/plus transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/builder transit/core/handler/src/test/net/dpml/transit/manager transit/core/handler/src/test/net/dpml/transit/test transit/core/tools/src/main/net/dpml/transit/tools, mcconnell, 06/05/2005

Archive powered by MHonArc 2.6.24.

Top of Page