Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2684 - in development/main: depot/console/src/main/net/dpml/depot/lang depot/prefs/src/main/net/dpml/depot/prefs depot/station transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/adapter transit/core/handler/src/main/net/dpml/transit/cache transit/core/handler/src/main/net/dpml/transit/manager transit/core/handler/src/main/net/dpml/transit/model 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: r2684 - in development/main: depot/console/src/main/net/dpml/depot/lang depot/prefs/src/main/net/dpml/depot/prefs depot/station transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/adapter transit/core/handler/src/main/net/dpml/transit/cache transit/core/handler/src/main/net/dpml/transit/manager transit/core/handler/src/main/net/dpml/transit/model transit/core/tools/src/main/net/dpml/transit/tools
  • Date: Tue, 31 May 2005 20:22:52 -0400

Author: mcconnell AT dpml.net
Date: Tue May 31 20:22:50 2005
New Revision: 2684

Modified:
development/main/depot/console/src/main/net/dpml/depot/lang/Main.java

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

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

development/main/depot/prefs/src/main/net/dpml/depot/prefs/HostManagerPanel.java
development/main/depot/prefs/src/main/net/dpml/depot/prefs/Main.java
development/main/depot/station/ (props changed)

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

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

development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java

development/main/transit/core/handler/src/main/net/dpml/transit/cache/DefaultCacheHandler.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/model/CacheModel.java

development/main/transit/core/handler/src/main/net/dpml/transit/model/HostModel.java

development/main/transit/core/handler/src/main/net/dpml/transit/model/Logger.java

development/main/transit/core/tools/src/main/net/dpml/transit/tools/AntAdapter.java
Log:
Improvements to the human interface and to the process by which atomic
updates are aplied to the cache management model.

Modified:
development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
==============================================================================
--- development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
(original)
+++ development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
Tue May 31 20:22:50 2005
@@ -29,6 +29,8 @@
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

+import net.dpml.transit.Transit;
+
/**
* CLI hander for the depot package.
*
@@ -69,26 +71,9 @@
String arg = args[i];
if( arg.equals( "-reset" ) )
{
- try
- {
- Preferences prefs = Preferences.systemNodeForPackage(
Main.class );
- logger.info( "Resetting: " + prefs );
- prefs.removeNode();
- }
- catch( Throwable e )
- {
- logger.log( Level.SEVERE, "System preferences reset
failure.", e );
- }
- try
- {
- Preferences prefs = Preferences.userNodeForPackage(
Main.class );
- logger.info( "Resetting: " + prefs );
- prefs.removeNode();
- }
- catch( Throwable e )
- {
- logger.log( Level.SEVERE, "User preferences reset
failure.", e );
- }
+ clearPreferences( logger, Main.class );
+ clearPreferences( logger, Transit.class );
+ return;
}
}

@@ -185,6 +170,30 @@
}
}

+ private static void clearPreferences( Logger logger, Class c )
+ {
+ try
+ {
+ Preferences prefs = Preferences.userNodeForPackage( c );
+ logger.info( "Resetting: " + prefs );
+ prefs.removeNode();
+ }
+ catch( Throwable e )
+ {
+ logger.log( Level.SEVERE, "User preferences reset failure.", e
);
+ }
+ try
+ {
+ Preferences prefs = Preferences.systemNodeForPackage( c );
+ logger.info( "Resetting: " + prefs );
+ prefs.removeNode();
+ }
+ catch( Throwable e )
+ {
+ logger.log( Level.SEVERE, "System preferences reset failure.",
e );
+ }
+ }
+
/**
* Setup the system properties for the target.
* @param prefs the profile's system properties preferences node

Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheManagerPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheManagerPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheManagerPanel.java
Tue May 31 20:22:50 2005
@@ -231,8 +231,8 @@
"Unexpected error while attempting to handle the
'Controller' action. "
+ "\nCODEBASE: "
+
getClass().getProtectionDomain().getCodeSource().getLocation().toString();
- String message = ExceptionHelper.packException( error, e,
true );
- System.err.println( message );
+ Logger logger = Logger.getLogger( "depot.prefs" );
+ logger.log( Level.SEVERE, error, e );
}
}
}

Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheTableModel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheTableModel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/CacheTableModel.java
Tue May 31 20:22:50 2005
@@ -16,11 +16,14 @@

package net.dpml.depot.prefs;

+import java.util.Arrays;
+
import javax.swing.Icon;
import javax.swing.table.AbstractTableModel;

import net.dpml.transit.Transit;
import net.dpml.transit.model.FileChangeEvent;
+import net.dpml.transit.model.HostModel;
import net.dpml.transit.model.HostNodeEvent;
import net.dpml.transit.model.CacheListener;
import net.dpml.transit.manager.CacheManager;
@@ -181,7 +184,9 @@
{
try
{
- return m_manager.getHostModels()[ row ].getID();
+ HostModel[] hosts = m_manager.getHostModels();
+ Arrays.sort( hosts );
+ return hosts[ row ].getID();
}
catch( Throwable e )
{

Modified:
development/main/depot/prefs/src/main/net/dpml/depot/prefs/HostManagerPanel.java
==============================================================================
---
development/main/depot/prefs/src/main/net/dpml/depot/prefs/HostManagerPanel.java
(original)
+++
development/main/depot/prefs/src/main/net/dpml/depot/prefs/HostManagerPanel.java
Tue May 31 20:22:50 2005
@@ -234,6 +234,7 @@
m_enabled = new JCheckBox( new EnableAction( "Enabled" ) );
m_enabled.setBackground( Color.white );
m_enabled.setSelected( m_manager.getEnabled() );
+ m_enabled.setEnabled( m_manager.getAvailable() );

JPanel enabledPanel = new JPanel();
enabledPanel.setLayout( new BorderLayout() );
@@ -381,6 +382,16 @@
}
m_ok.setEnabled( flag );
m_revert.setEnabled( flag );
+ try
+ {
+ new URL( m_base.getText() );
+ m_enabled.setEnabled( true );
+ }
+ catch( Throwable e )
+ {
+ m_enabled.setEnabled( m_manager.getAvailable() );
+ m_enabled.setSelected( m_manager.getEnabled() );
+ }
}

//--------------------------------------------------------------
@@ -529,33 +540,17 @@
setEnabled( false );
}

- // TODO: we need a solution in place under which we log
- // information about preference changes
+ // TODO: include index changes

public void actionPerformed( ActionEvent event )
{
- m_parent.hide();
- {
- String value = m_base.getText();
- URL base = resolveBaseURL( value );
- m_manager.setBaseURL( base );
- }
- {
- boolean value = m_trusted.isSelected();
- m_manager.setTrusted( value );
- }
- {
- boolean value = m_enabled.isSelected();
- m_manager.setEnabled( value );
- }
+ String baseValue = m_base.getText();
+ URL base = resolveBaseURL( baseValue );
+ boolean trusted = m_trusted.isSelected();
+ boolean value = m_enabled.isSelected();
LayoutModel layout = (LayoutModel) m_strategy.getSelectedItem();
- if( null != layout )
- {
- if( false == layout.equals( m_manager.getLayoutModel() ) )
- {
- m_manager.setLayoutModel( layout );
- }
- }
+ m_manager.update( base, null, enabled, trusted, layout );
+ m_parent.hide();
dispose();
}
}

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
Tue May 31 20:22:50 2005
@@ -75,16 +75,6 @@
//

System.setProperty( "java.protocol.handler.pkgs", "net.dpml.transit"
);
-
- //
- // check if a prefs are enabled (default is true)
- //
-
- System.setProperty( "dpml.transit.preferences.enabled", "true" );
-
- //
- //
-
SwingUtilities.invokeLater(
new Runnable() {
public void run()
@@ -111,7 +101,9 @@
}
catch( Exception e )
{
- e.printStackTrace();
+ String message = e.getMessage();
+ Throwable cause = e.getCause();
+ logger.error( message, cause );
}
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
Tue May 31 20:22:50 2005
@@ -100,7 +100,7 @@
Logger logger = model.getLogger();
if( logger.isDebugEnabled() )
{
- logger.debug( "creating secure transit context" );
+ logger.debug( "creating transit context" );
}

try
@@ -109,8 +109,7 @@
}
catch( Exception e )
{
- String error = "Unable to establish the
SecuredTransitContext.";
- logger.error( error, e );
+ String error = "Unable to establish the transit context.";
throw new TransitException( error, e );
}


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
Tue May 31 20:22:50 2005
@@ -152,7 +152,6 @@
try
{
Logger logger = new LoggingAdapter();
- logger.info( "Creating anonomouse Transit instance." );
Preferences prefs = Preferences.userNodeForPackage(
Transit.class );
TransitModel model = new TransitManager( logger, prefs
);
return getInstance( model );
@@ -299,7 +298,6 @@
}
catch( Throwable e )
{
- e.printStackTrace();
final String error = "Unable to construct transit instance.";
throw new TransitException( error, e );
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java
Tue May 31 20:22:50 2005
@@ -151,6 +151,18 @@
}

/**
+ * Record a warning message.
+ * @param message the warning message to record
+ */
+ public void warn( String message, Throwable cause )
+ {
+ if( isWarnEnabled() )
+ {
+ m_logger.log( Level.WARNING, message, cause );
+ }
+ }
+
+ /**
* Log a error message.
* @param message the message to log
*/
@@ -158,7 +170,7 @@
{
if( isErrorEnabled() )
{
- m_logger.severe( message );
+ m_logger.log( Level.SEVERE, message );
}
}

@@ -171,8 +183,7 @@
{
if( isErrorEnabled() )
{
- String error = ExceptionHelper.packException( message, e, true );
- m_logger.severe( message );
+ m_logger.log( Level.SEVERE, message, e );
}
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/cache/DefaultCacheHandler.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/cache/DefaultCacheHandler.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/cache/DefaultCacheHandler.java
Tue May 31 20:22:50 2005
@@ -130,7 +130,7 @@
// with host loading for plugin based resource hosts.
//

- HostModel[] hosts = model.getHostModels();
+ HostModel[] hosts = model.getAvailableHosts();
if( m_logger.isDebugEnabled() )
{
m_logger.debug( "cache configuration host count: " +
hosts.length );
@@ -144,7 +144,7 @@
if( m_logger.isDebugEnabled() )
{
final String message =
- "Creating new classic resource host: " + id
+ "Creating bootstrap host: " + id
+ "\nBase URL: " + host.getBaseURL();
m_logger.debug( message );
}
@@ -182,7 +182,7 @@
{
m_model.addCacheListener( this );

- HostModel[] hosts = m_model.getHostModels();
+ HostModel[] hosts = m_model.getAvailableHosts();
for( int i=0; i<hosts.length; i++ )
{
HostModel host = hosts[i];
@@ -586,17 +586,30 @@
{
synchronized( m_resourceHosts )
{
- String id = model.getID();
- if( null == m_resourceHosts.get( id ) )
+ if( model.getAvailable() )
{
- ResourceHost host = createResourceHost( model );
- m_resourceHosts.put( id, host );
+ String id = model.getID();
+ if( null == m_resourceHosts.get( id ) )
+ {
+ ResourceHost host = createResourceHost( model );
+ m_resourceHosts.put( id, host );
+ }
+ else
+ {
+ final String error =
+ "Illegal attempt to override existing host handler: "
+ id;
+ throw new TransitException( error );
+ }
}
else
{
- final String error =
- "Illegal attempt to override existing host handler: " + id;
- throw new TransitException( error );
+ System.out.println( "# HOST UNAVAILABLE: " + model.getID() );
+
+ // TODO:
+ // its a host in construction so we need to track this and
add it
+ // if and when it becomes available - or alternatively - we
drop
+ // local host references and just consult the model with a
local cache
+ // a weakly referenced host instances
}
}
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/CacheManager.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/manager/CacheManager.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/CacheManager.java
Tue May 31 20:22:50 2005
@@ -20,6 +20,10 @@

import java.io.File;
import java.io.IOException;
+import java.net.URI;
+import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
import java.util.LinkedList;
import java.util.Iterator;
@@ -31,8 +35,6 @@
import java.util.prefs.NodeChangeEvent;
import java.util.prefs.NodeChangeListener;
import java.util.prefs.BackingStoreException;
-import java.net.URI;
-import java.net.UnknownHostException;

import net.dpml.transit.Transit;

@@ -88,7 +90,7 @@
// construct the hosts
//

- Preferences hostsNode = prefs.node( "hosts" );
+ Preferences hostsNode = getHostsRoot();
hostsNode.addNodeChangeListener( this );
try
{
@@ -103,19 +105,24 @@
catch( Exception e )
{
final String error =
- "Unexpected exception while reading host preferences."
+ "Unexpected exception while resolving host preferences."
+ "\nPreferences: " + prefs;
throw new ModelException( error, e );
}
}

+ private Preferences getHostsRoot()
+ {
+ return getPreferences().node( "hosts" );
+ }
+
//
------------------------------------------------------------------------
// CacheManager
//
------------------------------------------------------------------------

/**
- * Return an array of content managers currently assigned to the registry.
- * @return the content manager array
+ * Return an array of host managers currently assigned to the cache.
+ * @return the host manager array
*/
public HostManager[] getHostManagers()
{
@@ -126,7 +133,7 @@
{
if( null != id )
{
- getPreferences().node( id );
+ getHostsRoot().node( id );
}
}

@@ -156,9 +163,9 @@
}
try
{
- if( getPreferences().nodeExists( id ) )
+ if( getHostsRoot().nodeExists( id ) )
{
- Preferences prefs = getPreferences().node( id );
+ Preferences prefs = getHostsRoot().node( id );
prefs.removeNode();
}
}
@@ -172,7 +179,6 @@
}
}

-
/**
* Set the local cache directory.
* @param file the cache directory
@@ -201,7 +207,7 @@
super.dispose();
try
{
- getPreferences().removeNodeChangeListener( this );
+ getHostsRoot().removeNodeChangeListener( this );
}
catch( Throwable e )
{
@@ -245,6 +251,27 @@
}

/**
+ * Return an array of available and enabled hosts is priority order.
+ * @return the available host model array
+ */
+ public HostModel[] getAvailableHosts()
+ {
+ ArrayList list = new ArrayList();
+ HostModel[] hosts = (HostModel[]) m_list.toArray( new HostModel[0] );
+ for( int i=0; i<hosts.length; i++ )
+ {
+ HostModel host = hosts[i];
+ if( host.getAvailable() && host.getEnabled() )
+ {
+ list.add( host );
+ }
+ }
+ HostModel[] selection = (HostModel[]) list.toArray( new HostModel[0]
);
+ Arrays.sort( selection );
+ return selection;
+ }
+
+ /**
* Add a cache change listener.
* @param listener the listener to add
*/
@@ -309,7 +336,7 @@
catch( Throwable e )
{
final String error =
- "Unable to add host due to an unresolved host url."
+ "Unable to add host."
+ "\nPreferences Node: " + event.getChild()
+ "\nHost path: " + event.getChild().get( "base", null );
getLogger().error( error, e );
@@ -334,17 +361,13 @@
int priority = model.getPriority();
synchronized( m_list )
{
- Iterator iterator = m_list.iterator();
- while( iterator.hasNext() )
+ HostModel h = findHostModel( id );
+ if( null != h )
{
- HostModel d = (HostModel) iterator.next();
- if( id.equals( d.getID() ) )
- {
- final String error =
- "Host already registered."
- + "\nHost ID: " + id;
- throw new IllegalArgumentException( error );
- }
+ final String error =
+ "Host already registered."
+ + "\nHost ID: " + id;
+ throw new IllegalArgumentException( error );
}
m_list.add( model );
model.addPluginListener( this );

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/HostManager.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/manager/HostManager.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/HostManager.java
Tue May 31 20:22:50 2005
@@ -68,11 +68,11 @@
private String m_name;
private URL m_base;
private URL m_index;
- private boolean m_enabled = true;
+ private boolean m_enabled = false;
private boolean m_trusted = false;
private LayoutModel m_layout;
private boolean m_available = false;
- private int m_priority = 100;
+ private int m_priority = 600;
private RequestIdentifier m_identifier;
private PasswordAuthentication m_authentication;
private boolean m_bootstrap = false;
@@ -85,8 +85,8 @@
throws UnknownHostException, IOException
{
super( logger, prefs );
- m_layoutRegistry = registry;

+ m_layoutRegistry = registry;
m_bootstrap = prefs.getBoolean( "bootstrap", false );
m_id = prefs.name();
m_name = prefs.get( "name", m_id );
@@ -102,6 +102,7 @@
m_index = resolveIndex( m_base, prefs );
m_identifier = resolveRequestIdentifier( m_base, prefs );
m_authentication = resolvePasswordAuthentication( prefs );
+ m_available = true;
}
}

@@ -109,39 +110,47 @@
// HostManager
//----------------------------------------------------------------------

- public void setBaseURL( URL url )
+ public synchronized void update( URL base, URL index, boolean enabled,
boolean trusted, LayoutModel layout )
+ {
+ m_base = base;
+ m_enabled = enabled;
+ m_trusted = trusted;
+ m_layout = layout;
+
+ updateBaseURL();
+ updateTrusted();
+ updateEnabled();
+ updateLayoutModel();
+ }
+
+ private void updateBaseURL()
{
Preferences prefs = getPreferences();
- if( null == url )
+ if( null == m_base )
{
- prefs.putBoolean( "enabled", false );
prefs.remove( "base" );
}
else
{
- prefs.put( "base", url.toExternalForm() );
+ prefs.put( "base", m_base.toExternalForm() );
}
}

- public void setTrusted( boolean flag )
+ private void updateTrusted()
{
Preferences prefs = getPreferences();
- prefs.putBoolean( "trusted", flag );
+ prefs.putBoolean( "trusted", m_trusted );
}

- public void setEnabled( boolean flag )
+ public void updateEnabled()
{
Preferences prefs = getPreferences();
- prefs.putBoolean( "enabled", flag );
+ prefs.putBoolean( "enabled", m_enabled );
}

- public void setLayoutModel( LayoutModel layout )
+ public void updateLayoutModel()
{
- if( null == layout )
- {
- throw new NullPointerException( "layout" );
- }
- String id = layout.getID();
+ String id = m_layout.getID();
Preferences prefs = getPreferences();
prefs.put( "layout", id );
}
@@ -166,6 +175,29 @@
}

//----------------------------------------------------------------------
+ // Comparable
+ //----------------------------------------------------------------------
+
+ public int compareTo( Object other )
+ {
+ if( null == other )
+ {
+ return -1;
+ }
+ else if( false == other instanceof HostManager )
+ {
+ return -1;
+ }
+ else
+ {
+ HostManager host = (HostManager) other;
+ Integer i = new Integer( getPriority() );
+ Integer j = new Integer( host.getPriority() );
+ return i.compareTo( j );
+ }
+ }
+
+ //----------------------------------------------------------------------
// HostModel
//----------------------------------------------------------------------

@@ -208,7 +240,7 @@
{
synchronized( this )
{
- return m_available;
+ return m_base != null;
}
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/CacheModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/CacheModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/CacheModel.java
Tue May 31 20:22:50 2005
@@ -41,6 +41,12 @@
HostModel[] getHostModels();

/**
+ * Return an array of available and enabled hosts is priority order.
+ * @return the available host model array
+ */
+ HostModel[] getAvailableHosts();
+
+ /**
* Add a cache listener to the director.
* @param listener the listener to add
*/

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/HostModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/HostModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/HostModel.java
Tue May 31 20:22:50 2005
@@ -33,7 +33,7 @@
* synchronization via change events raised by implementations of this
* interface.
*/
-public interface HostModel extends PluginModel
+public interface HostModel extends PluginModel, Comparable
{
/**
* Return an immutable host identifier. The host identifier shall be

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/Logger.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/Logger.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/Logger.java
Tue May 31 20:22:50 2005
@@ -68,6 +68,13 @@
void warn( String message );

/**
+ * Record a warning message.
+ * @param message the warning message to record
+ * @param cause the causal exception
+ */
+ void warn( String message, Throwable cause );
+
+ /**
* Record a error level message.
* @param message the error message to record
*/
@@ -76,10 +83,15 @@
/**
* Record a error level message.
* @param message the error message to record
- * @param e the error
+ * @param cause the causal exception
*/
- void error( String message, Throwable e );
+ void error( String message, Throwable cause );

+ /**
+ * Return a child logger relative to the current logger.
+ * @param category the relative category name
+ * @return the child logging channel
+ */
Logger getChildLogger( String category );
}


Modified:
development/main/transit/core/tools/src/main/net/dpml/transit/tools/AntAdapter.java
==============================================================================
---
development/main/transit/core/tools/src/main/net/dpml/transit/tools/AntAdapter.java
(original)
+++
development/main/transit/core/tools/src/main/net/dpml/transit/tools/AntAdapter.java
Tue May 31 20:22:50 2005
@@ -104,6 +104,20 @@
}

/**
+ * Record a warning message.
+ * @param message the warning message to record
+ */
+ public void warn( String message, Throwable cause )
+ {
+ m_task.log( message, Project.MSG_WARN );
+ if( null != cause )
+ {
+ final String error = ExceptionHelper.packException( message,
cause, true );
+ m_task.log( error, Project.MSG_WARN );
+ }
+ }
+
+ /**
* Record a error level message.
* @param message the error message to record
*/
@@ -123,7 +137,7 @@
if( null != e )
{
final String error = ExceptionHelper.packException( message, e,
true );
- m_task.log( error );
+ m_task.log( error, Project.MSG_ERR );
}
}




  • svn commit: r2684 - in development/main: depot/console/src/main/net/dpml/depot/lang depot/prefs/src/main/net/dpml/depot/prefs depot/station transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/adapter transit/core/handler/src/main/net/dpml/transit/cache transit/core/handler/src/main/net/dpml/transit/manager transit/core/handler/src/main/net/dpml/transit/model transit/core/tools/src/main/net/dpml/transit/tools, mcconnell, 05/31/2005

Archive powered by MHonArc 2.6.24.

Top of Page