Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2464 - in development/main: metro metro/composition/control/src/main/net/dpml/composition/control metro/composition/control/src/main/net/dpml/composition/event 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/event transit/core/handler/src/main/net/dpml/transit/host transit/core/handler/src/main/net/dpml/transit/logging transit/core/handler/src/main/net/dpml/transit/monitors transit/core/handler/src/main/net/dpml/transit/prefs transit/core/handler/src/main/net/dpml/transit/util 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: r2464 - in development/main: metro metro/composition/control/src/main/net/dpml/composition/control metro/composition/control/src/main/net/dpml/composition/event 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/event transit/core/handler/src/main/net/dpml/transit/host transit/core/handler/src/main/net/dpml/transit/logging transit/core/handler/src/main/net/dpml/transit/monitors transit/core/handler/src/main/net/dpml/transit/prefs transit/core/handler/src/main/net/dpml/transit/util transit/core/tools/src/main/net/dpml/transit/tools
  • Date: Sat, 07 May 2005 00:14:15 -0400

Author: mcconnell AT dpml.net
Date: Sat May 7 00:14:13 2005
New Revision: 2464

Added:

development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java
- copied, changed from r2458,
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/ConsoleAdapter.java
development/main/transit/core/handler/src/main/net/dpml/transit/logging/

development/main/transit/core/handler/src/main/net/dpml/transit/logging/LoggingController.java

development/main/transit/core/handler/src/main/net/dpml/transit/logging/StandardFormatter.java
- copied, changed from r2458,
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/StandardFormatter.java

development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
- copied, changed from r2458,
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java
Removed:

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

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

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

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/ConsoleMonitor.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/NullMonitor.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/SystemMonitor.java
Modified:

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java

development/main/metro/composition/control/src/main/net/dpml/composition/event/EventProducer.java

development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
development/main/metro/module.xml
development/main/transit/core/handler/src/main/net/dpml/transit/Main.java

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/cache/FileCacheHandler.java

development/main/transit/core/handler/src/main/net/dpml/transit/event/EventProducer.java

development/main/transit/core/handler/src/main/net/dpml/transit/host/PreferencesResourceManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostFactory.java

development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostHelper.java

development/main/transit/core/handler/src/main/net/dpml/transit/host/StandardResourceManager.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/AbstractMonitorRouter.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/CacheMonitorRouter.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/Monitor.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/NetworkMonitorRouter.java

development/main/transit/core/handler/src/main/net/dpml/transit/monitors/RepositoryMonitorRouter.java

development/main/transit/core/handler/src/main/net/dpml/transit/prefs/CachePanel.java

development/main/transit/core/handler/src/main/net/dpml/transit/prefs/HostPanel.java

development/main/transit/core/handler/src/main/net/dpml/transit/prefs/ResourcePanel.java

development/main/transit/core/tools/src/main/net/dpml/transit/tools/AntAdapter.java

development/main/transit/core/tools/src/main/net/dpml/transit/tools/ImportArtifactTask.java
Log:
Updates to Transit related to the setup of the console logger and removal of
some of the nasty stuff in the SystemMonitor that is not longer required
following the introduction of the preferences back-end. These changes mainly
include the addition of a logging controller which is responsible for the
inital setup of the JVM logging configuration and from this, the removal of
loging concerns from Monitor and the removal of the SystemMonitor class (and
updating of related classes that used SystemMonitor to use Logger instead).
Subsequent work can now focus on just the LoggingController implementation.

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
Sat May 7 00:14:13 2005
@@ -80,57 +80,11 @@
{
super( new DefaultMonitor( system.getLogger() ), system,
createPartition( system ) );

- URI partition = createPartition( system );
- m_classloader =
net.dpml.composition.info.Type.class.getClassLoader();
-
m_context = system;
- m_partition = partition;
+ m_partition = createPartition( system );
+ m_classloader =
net.dpml.composition.info.Type.class.getClassLoader();

setShutdownHook( this );
-
- //
- // quick-and-dirty log manager setup
- //
-
- Properties properties = new Properties();
- properties.setProperty(
- "handlers",
- "java.util.logging.ConsoleHandler" );
- properties.setProperty(
- "java.util.logging.ConsoleHandler.formatter",
- "net.dpml.transit.adapter.StandardFormatter" );
- if( system.getDebugMode() )
- {
- properties.setProperty(
- ".level",
- "FINE" );
- properties.setProperty(
- "java.util.logging.ConsoleHandler.level",
- "FINE" );
- }
- else
- {
- properties.setProperty(
- ".level",
- "INFO" );
- properties.setProperty(
- "java.util.logging.ConsoleHandler.level",
- "INFO" );
- }
- try
- {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- properties.store( out, "DPML Logging properties" );
- byte[] bytes = out.toByteArray();
- ByteArrayInputStream input = new ByteArrayInputStream( bytes );
- LogManager manager = LogManager.getLogManager();
- manager.readConfiguration( input );
- }
- catch( Throwable e )
- {
- e.printStackTrace();
- }
-
CommandLine line = getCommandLine( args );
String[] arguments = line.getArgs();
URI uri = getLauchTargetURI( arguments );

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/event/EventProducer.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/event/EventProducer.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/event/EventProducer.java
Sat May 7 00:14:13 2005
@@ -23,7 +23,7 @@
import java.util.List;
import java.util.LinkedList;

-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;


/**

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
Sat May 7 00:14:13 2005
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.WeakHashMap;

-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;


/**

Modified: development/main/metro/module.xml
==============================================================================
--- development/main/metro/module.xml (original)
+++ development/main/metro/module.xml Sat May 7 00:14:13 2005
@@ -153,6 +153,25 @@
<x:javadoc>
<link href="http://java.sun.com/j2se/1.4/docs/api"/>
<link href="http://www.dpml.net/api/commons-cli/1.0"/>
+ <group title="Parts API">
+ <package name="net.dpml.parts.builder"/>
+ <package name="net.dpml.parts.control"/>
+ <package name="net.dpml.parts.model"/>
+ <package name="net.dpml.parts.part"/>
+ <package name="net.dpml.parts.state"/>
+ </group>
+ <group title="Composition API">
+ <package name="net.dpml.composition.builder"/>
+ <package name="net.dpml.composition.control"/>
+ <package name="net.dpml.composition.event"/>
+ <package name="net.dpml.composition.model"/>
+ <package name="net.dpml.composition.data"/>
+ <package name="net.dpml.composition.info"/>
+ <package name="net.dpml.composition.state"/>
+ <package name="net.dpml.composition.unit"/>
+ </group>
+
+ <!--
<group title="Public API">
<package name="net.dpml.service"/>
<package name="net.dpml.context"/>
@@ -183,6 +202,7 @@
<group title="Private API">
<package name="net.dpml.*"/>
</group>
+ -->
</x:javadoc>
</target>


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/Main.java
==============================================================================
--- development/main/transit/core/handler/src/main/net/dpml/transit/Main.java
(original)
+++ development/main/transit/core/handler/src/main/net/dpml/transit/Main.java
Sat May 7 00:14:13 2005
@@ -20,18 +20,17 @@

import net.dpml.transit.adapter.Adapter;
import net.dpml.transit.adapter.CacheMonitorAdapter;
-import net.dpml.transit.adapter.ConsoleAdapter;
+import net.dpml.transit.adapter.LoggingAdapter;
import net.dpml.transit.adapter.NetworkMonitorAdapter;
import net.dpml.transit.adapter.RepositoryMonitorAdapter;
import net.dpml.transit.artifact.Artifact;
import net.dpml.transit.monitors.CacheMonitor;
-import net.dpml.transit.monitors.ConsoleMonitor;
import net.dpml.transit.monitors.Monitor;
import net.dpml.transit.monitors.NetworkMonitor;
import net.dpml.transit.monitors.RepositoryMonitor;
-import net.dpml.transit.monitors.SystemMonitor;
import net.dpml.transit.util.Dictionary;
import net.dpml.transit.prefs.TransitDialog;
+import net.dpml.transit.logging.LoggingController;

import java.io.File;
import java.io.FileInputStream;
@@ -39,6 +38,8 @@
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Map;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import java.util.prefs.Preferences;

/**
@@ -126,8 +127,11 @@
{
System.getProperties().list( System.out );
}
- ConsoleMonitor console = new ConsoleMonitor( debug );
- SystemMonitor monitor = new SystemMonitor( console );
+
+ // configure logging
+
+ new LoggingController( debug );
+ Logger logger = Logger.getLogger( "transit" );

//
// check if a prefs reset has been requested
@@ -141,18 +145,17 @@
try
{
Preferences usr = Preferences.userNodeForPackage(
Transit.class );
- System.out.println( "resetting preferences: " + usr );
+ logger.info( "resetting preferences: " + usr );
usr.removeNode();
usr.flush();
Preferences sys = Preferences.systemNodeForPackage(
Transit.class );
- System.out.println( "resetting preferences: " + sys );
+ logger.info( "resetting preferences: " + sys );
sys.removeNode();
sys.flush();
}
catch( Throwable e )
{
- System.out.println( "RESET ERROR" );
- e.printStackTrace();
+ logger.log( Level.SEVERE, "preference rest failed", e );
}
}
}
@@ -176,9 +179,9 @@
// setup transit
//

- Transit transit = Transit.getInstance( monitor );
+ Transit transit = Transit.getInstance();

- Adapter adapter = new ConsoleAdapter( debug );
+ Adapter adapter = new LoggingAdapter();
RepositoryMonitor repoMonitor = new RepositoryMonitorAdapter(
adapter );
CacheMonitor cacheMonitor = new CacheMonitorAdapter( adapter );
NetworkMonitor netMonitor = new NetworkMonitorAdapter( adapter );
@@ -198,13 +201,13 @@
{
path = arg.substring( "-Xbootstrap=".length() );

- if( monitor.isTraceEnabled() )
+ if( adapter.isDebugEnabled() )
{
final String message =
"using -Xbootstrap argument: ["
+ path
+ "]";
- monitor.trace( message );
+ adapter.debug( message );
}
}
}
@@ -215,7 +218,7 @@

if( null != path )
{
- if( monitor.isTraceEnabled() )
+ if( adapter.isDebugEnabled())
{
final String message =
"using system property "
@@ -223,7 +226,7 @@
+ " with value: ["
+ path
+ "]";
- monitor.trace( message );
+ adapter.debug( message );
}
}
}
@@ -239,7 +242,6 @@
Map data = new Hashtable();
data.put( "urn:transit.handler.uri", TRANSIT_URI );
data.put( "urn:transit.cli.uri", uri );
- data.put( "urn:transit.system.monitor", monitor );
data.put( "urn:transit.repository.monitor", repoMonitor );
data.put( "urn:transit.cache.monitor", cacheMonitor );
data.put( "urn:transit.network.monitor", netMonitor );

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
Sat May 7 00:14:13 2005
@@ -24,7 +24,6 @@
import net.dpml.transit.host.ResourceManager;
import net.dpml.transit.link.FileLinkManager;
import net.dpml.transit.link.LinkManager;
-import net.dpml.transit.monitors.SystemMonitor;
import net.dpml.transit.network.DelegatingAuthenticator;
import net.dpml.transit.network.RequestIdentifier;
import net.dpml.transit.network.TransitAuthenticator;
@@ -39,6 +38,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import java.util.prefs.Preferences;
import java.util.Properties;

@@ -171,28 +172,10 @@
*
* @return the secured transit context
* @exception TransitException if an error occurs during context creation
- */
- public static SecuredTransitContext create()
- throws TransitException
- {
- synchronized( SecuredTransitContext.class )
- {
- return SecuredTransitContext.create( new SystemMonitor() );
- }
- }
-
- /**
- * Creation of the transit context. If the transit context has already
- * been established the method returns the singeton context otherwise a
new context
- * is created relative to the authoritve url and returned.
- *
- * @param monitor the bootstrap monitor
- * @return the secured transit context
- * @exception TransitException if an error occurs during context creation
* @exception NullArgumentException if the supplied monitor is null and
an instance
* of this class has not been created already.
*/
- public static SecuredTransitContext create( final SystemMonitor monitor )
+ public static SecuredTransitContext create()
throws TransitException, NullArgumentException
{
synchronized( SecuredTransitContext.class )
@@ -201,19 +184,21 @@
{
return m_CONTEXT;
}
- if( null == monitor )
- {
- throw new NullArgumentException( "monitor" );
- }
- if( monitor.isTraceEnabled() )
+
+ Logger logger = Logger.getLogger( "transit" );
+ if( logger.isLoggable( Level.FINE ) )
{
- monitor.trace( "creating secure transit context" );
+ logger.fine( "creating secure transit context" );
}

try
{
- URL authorative = establishAuthority( monitor );
- monitor.notifyAuthority( authorative );
+ URL authorative = establishAuthority( logger );
+ if( logger.isLoggable( Level.FINE ) )
+ {
+ logger.fine( "using authority: " + authorative );
+ }
+
Properties props = getTransitProperties( authorative );
String classname = null;
boolean flag = isPreferencesEnabled( props );
@@ -225,17 +210,20 @@
{
classname = getResourceManagerClassname( props ); //
using properties
}
- ResourceManager manager = createResourceManager( classname,
authorative, monitor );
+ ResourceManager manager = createResourceManager( classname,
authorative );
CacheHandler ch = manager.createCacheHandler();
- monitor.notifyCacheHandlerCreation( ch );
+ if( logger.isLoggable( Level.FINE ) )
+ {
+ logger.fine( "establish cache: " +
ch.getClass().getName() );
+ }
m_CONTEXT = new SecuredTransitContext( authorative, ch,
props );
}
catch( IOException e )
{
String error = "Unable to establish the
SecuredTransitContext.";
+ logger.log( Level.SEVERE, error, e );
throw new TransitException( error, e );
}
-
return m_CONTEXT;
}
}
@@ -254,17 +242,15 @@
* @return the resource manager
*/
private static ResourceManager createResourceManager(
- String classname, URL authorative, SystemMonitor monitor ) throws
TransitException
+ String classname, URL authorative ) throws TransitException
{
try
{
Class cls = ResourceManager.class.getClassLoader().loadClass(
classname );
Class[] params = new Class[]{
- URL.class,
- SystemMonitor.class};
+ URL.class};
Object[] args = new Object[]{
- authorative,
- monitor};
+ authorative};
Constructor cons = cls.getConstructor( params );
return (ResourceManager) cons.newInstance( args );
}
@@ -418,7 +404,7 @@
* @return the authorative url
* @exception TransitException if an error occurs during authority url
creation
*/
- private static URL establishAuthority( final SystemMonitor monitor )
+ private static URL establishAuthority( final Logger logger )
throws TransitException
{
try
@@ -441,13 +427,13 @@
}
else
{
- if( monitor.isTraceEnabled() )
+ if( logger.isLoggable( Level.FINE ) )
{
final String message =
"using system property
'dpml.transit.authority.file' ["
+ path
+ "]";
- monitor.trace( message );
+ logger.fine( message );
}
return useForAuthority( authorativeFile );
}
@@ -462,13 +448,13 @@
File artifactAuthFile = new File( transitDir, AUTHORITY_FILENAME
);
if( artifactAuthFile.exists() )
{
- if( monitor.isTraceEnabled() )
+ if( logger.isLoggable( Level.FINE ) )
{
final String message =
"using authority file ["
+ artifactAuthFile
+ "]";
- monitor.trace( message );
+ logger.fine( message );
}
return useForAuthority( artifactAuthFile );
}
@@ -482,13 +468,13 @@
File javaAuthFile = new File( extlib, AUTHORITY_FILENAME );
if( javaAuthFile .exists() )
{
- if( monitor.isTraceEnabled() )
+ if( logger.isLoggable( Level.FINE ) )
{
final String message =
"using extension authority file ["
+ javaAuthFile
+ "]";
- monitor.trace( message );
+ logger.fine( message );
}
return useForAuthority( javaAuthFile );
}
@@ -517,13 +503,13 @@
ResourceHelper.unpack(
classloader,
"transit/authority/hosts/www.apache.org.host", new File( hosts,
"www.apache.org.host" ) );

- if( monitor.isTraceEnabled() )
+ if( logger.isLoggable( Level.FINE ) )
{
final String message =
"using bundled defaults ["
+ artifactAuthFile
+ "]";
- monitor.trace( message );
+ logger.fine( message );
}

return useForAuthority( artifactAuthFile );
@@ -531,11 +517,11 @@
}
catch( SecurityException se )
{
- if( monitor.isTraceEnabled() )
+ if( logger.isLoggable( Level.FINE ) )
{
final String message =
"using http://repository.dpml.net/ as authorative
source";
- monitor.trace( message );
+ logger.fine( message );
}
return new URL( DEFAULT_REMOTE_AUTHORITY );
}

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
Sat May 7 00:14:13 2005
@@ -31,11 +31,9 @@
import net.dpml.lang.NullArgumentException;

import net.dpml.transit.monitors.Monitor;
-import net.dpml.transit.monitors.SystemMonitor;
import net.dpml.transit.monitors.RepositoryMonitorRouter;
import net.dpml.transit.monitors.CacheMonitorRouter;
import net.dpml.transit.monitors.NetworkMonitorRouter;
-import net.dpml.transit.monitors.NullMonitor;

import net.dpml.transit.repository.Repository;
import net.dpml.transit.repository.StandardLoader;
@@ -154,36 +152,19 @@
}

/**
- * Returns the singleton instance of the transit system.
- * @return the singleton transit instance
- * @exception TransitException if an error occurs during establishment
- */
- public static Transit getInstance()
- throws TransitException
- {
- return Transit.getInstance( new SystemMonitor() );
- }
-
- /**
* Returns the singleton instance of the transit system. If this method
* has already been invoked the server and monitor argument will be
ignored.
- * @param monitor the bootstrap monitor
* @return the singleton transit instance
* @exception TransitException if an error occurs during establishment
- * @exception NullArgumentException if the monitor argument is null.
*/
- public static Transit getInstance( SystemMonitor monitor )
+ public static Transit getInstance()
throws TransitException, NullArgumentException
{
- if( null == monitor )
- {
- throw new NullArgumentException( "monitor" );
- }
synchronized( Transit.class )
{
if( m_INSTANCE == null )
{
- m_INSTANCE = new Transit( monitor );
+ m_INSTANCE = new Transit();
}
return m_INSTANCE;
}
@@ -196,23 +177,17 @@

/**
* Private constructor of a transit instance.
- * @param monitor the bootstrap monitor
* @exception TransitException if an establishment error occurs
*/
- private Transit( SystemMonitor monitor )
+ private Transit()
throws TransitException
{
try
{
- if( monitor.isTraceEnabled() )
- {
- monitor.trace( "creating transit instance" );
- }
-
- m_context = SecuredTransitContext.create( monitor ); // Ensure
secured environment.
- m_repositoryMonitor = new RepositoryMonitorRouter( monitor );
- m_cacheMonitor = new CacheMonitorRouter( monitor );
- m_networkMonitor = new NetworkMonitorRouter( monitor );
+ m_context = SecuredTransitContext.create(); // Ensure secured
environment.
+ m_repositoryMonitor = new RepositoryMonitorRouter();
+ m_cacheMonitor = new CacheMonitorRouter();
+ m_networkMonitor = new NetworkMonitorRouter();

// Setting up a temporary directory for Transit.


Copied:
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java
(from r2458,
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/ConsoleAdapter.java)
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/ConsoleAdapter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/LoggingAdapter.java
Sat May 7 00:14:13 2005
@@ -19,6 +19,10 @@
package net.dpml.transit.adapter;

import java.net.URL;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import net.dpml.transit.util.ExceptionHelper;

/**
* Console montor for download messages.
@@ -26,7 +30,7 @@
* @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
* @version $Id$
*/
-public class ConsoleAdapter implements Adapter
+public class LoggingAdapter implements Adapter
{
//
------------------------------------------------------------------------
// static
@@ -38,18 +42,15 @@
private static final int KBYTE = 1024;

/**
- * Tag identifying console log entries.
+ * The logging channel.
*/
- private static final String TAG = "[transit] ";
+ private static final String CATEGORY = "transit";

//
------------------------------------------------------------------------
// state
//
------------------------------------------------------------------------

- /**
- * The debug mode.
- */
- private boolean m_debug;
+ private Logger m_logger;

//
------------------------------------------------------------------------
// constructor
@@ -58,11 +59,10 @@
/**
* Creation of a new console adapter that is used to redirect transit
events
* the system output stream.
- * @param debug if TRUE the adapter should assume debug style reporting
*/
- public ConsoleAdapter( boolean debug )
+ public LoggingAdapter()
{
- m_debug = debug;
+ m_logger = Logger.getLogger( CATEGORY );
}

//
------------------------------------------------------------------------
@@ -75,7 +75,7 @@
*/
public boolean isDebugEnabled()
{
- return m_debug;
+ return m_logger.isLoggable( Level.FINE );
}

/**
@@ -84,7 +84,16 @@
*/
public boolean isInfoEnabled()
{
- return true;
+ return m_logger.isLoggable( Level.INFO );
+ }
+
+ /**
+ * Return TRUE is error level logging is enabled.
+ * @return the enabled state of error logging
+ */
+ public boolean isWarnEnabled()
+ {
+ return m_logger.isLoggable( Level.WARNING );
}

/**
@@ -93,7 +102,7 @@
*/
public boolean isErrorEnabled()
{
- return true;
+ return m_logger.isLoggable( Level.SEVERE );
}

/**
@@ -102,9 +111,9 @@
*/
public void debug( String message )
{
- if( m_debug )
+ if( isDebugEnabled() )
{
- log( message );
+ m_logger.fine( message );
}
}

@@ -114,7 +123,10 @@
*/
public void info( String message )
{
- log( message );
+ if( isInfoEnabled() )
+ {
+ m_logger.info( message );
+ }
}

/**
@@ -123,7 +135,10 @@
*/
public void warn( String message )
{
- log( message );
+ if( isWarnEnabled() )
+ {
+ m_logger.warning( message );
+ }
}

/**
@@ -132,7 +147,10 @@
*/
public void error( String message )
{
- error( message, null );
+ if( isErrorEnabled() )
+ {
+ m_logger.severe( message );
+ }
}

/**
@@ -142,8 +160,12 @@
*/
public void error( String message, Throwable e )
{
- String error = ExceptionHelper.packException( message, e, m_debug );
- log( error );
+
+ if( isErrorEnabled() )
+ {
+ String error = ExceptionHelper.packException( message, e, true );
+ m_logger.severe( message );
+ }
}

/**
@@ -156,7 +178,7 @@
{
if( isAnt() && total == count )
{
- log( "downloaded: " + resource );
+ info( "downloaded: " + resource );
return;
}

@@ -166,7 +188,7 @@

String value = getFranctionalValue( count );
int pad = max.length() - value.length();
- StringBuffer buffer = new StringBuffer( TAG + "Progress: " );
+ StringBuffer buffer = new StringBuffer( "[TRANSIT] " +
"Progress: " );
for( int i=0; i < pad; i++ )
{
buffer.append( " " );
@@ -255,8 +277,7 @@
*/
private void log( String message )
{
- System.out.print( TAG );
- System.out.println( message );
+ debug( message);
}
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/cache/FileCacheHandler.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/cache/FileCacheHandler.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/cache/FileCacheHandler.java
Sat May 7 00:14:13 2005
@@ -30,6 +30,8 @@
import java.util.Iterator;
import java.util.Properties;
import java.util.TreeMap;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import java.util.prefs.Preferences;
import java.util.prefs.PreferenceChangeListener;
import java.util.prefs.PreferenceChangeEvent;
@@ -82,10 +84,10 @@

private ZipCache m_zipCache;

- private Monitor m_monitor;
-
private boolean m_flag = false;

+ private Logger m_logger;
+
//
------------------------------------------------------------------------
// constructor (preferences based)
//
------------------------------------------------------------------------
@@ -95,14 +97,15 @@
* @param monitor the assigned monitor
* @param resolver the location resolver
*/
- public FileCacheHandler( Monitor monitor, LocationResolver resolver )
throws TransitException
+ public FileCacheHandler( LocationResolver resolver ) throws
TransitException
{
- m_monitor = monitor;
m_zipCache = new ZipCache();
m_resourceHosts = new TreeMap();
m_resolver = resolver;
m_flag = true;

+ m_logger = Logger.getLogger( "transit" );
+
//
// construct the hosts using the system preferences
//
@@ -146,13 +149,15 @@
* @param hosts the assigned hosts
* @param props the properties against which this instance will be
configured
*/
- public FileCacheHandler( Monitor monitor, ResourceHost[] hosts,
Properties props, LocationResolver resolver )
+ public FileCacheHandler( ResourceHost[] hosts, Properties props,
LocationResolver resolver )
{
- m_monitor = monitor;
m_zipCache = new ZipCache();

m_resolver = resolver;
m_resourceHosts = new TreeMap();
+
+ m_logger = Logger.getLogger( "transit" );
+
for( int i=0; i < hosts.length; i++ )
{
// We need to ensure that no other host already have the same
@@ -175,8 +180,6 @@

File cache = resolveCacheDirectory( props );
setLocalCacheDirectory( cache );
- monitor.trace( "created file based cache on: " + m_cacheDir );
-
}

/**
@@ -195,7 +198,7 @@
final String message =
"Setting cache directory."
+ "\nDirectory: " + cache;
- m_monitor.trace( message );
+ m_logger.fine( message );
}
else
{
@@ -203,7 +206,7 @@
"Changing cache directory."
+ "\nOld: " + m_cacheDir
+ "\nNew: " + cache;
- m_monitor.trace( message );
+ m_logger.fine( message );
}
if( false == cache.isAbsolute() )
{

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/event/EventProducer.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/event/EventProducer.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/event/EventProducer.java
Sat May 7 00:14:13 2005
@@ -23,7 +23,7 @@
import java.util.List;
import java.util.LinkedList;

-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;


/**

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/host/PreferencesResourceManager.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/host/PreferencesResourceManager.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/host/PreferencesResourceManager.java
Sat May 7 00:14:13 2005
@@ -39,8 +39,6 @@

import net.dpml.transit.Transit;
import net.dpml.transit.cache.CacheHandler;
-import net.dpml.transit.monitors.Monitor;
-import net.dpml.transit.monitors.SystemMonitor;
import net.dpml.transit.TransitException;
import net.dpml.transit.util.Util;
import net.dpml.transit.layout.LocationResolver;
@@ -80,8 +78,6 @@
// state

//--------------------------------------------------------------------------

- private final SystemMonitor m_monitor;
-
private final Preferences m_system;
private final Preferences m_user;

@@ -96,15 +92,14 @@
/**
* Creation of a new resource manager.
* @param authorative the authorative base url
- * @param monitor the internal monitor
* @exception IOException if an io error occurs
* @exception TransitException if a transit system error occurs
*/
- public PreferencesResourceManager( URL authorative, SystemMonitor
monitor )
+ public PreferencesResourceManager( URL authorative )
throws TransitException, IOException
{
- super( authorative, monitor );
- m_monitor = monitor;
+ super( authorative );
+
m_system = Preferences.systemNodeForPackage( ResourceManager.class );
m_user = Preferences.userNodeForPackage( ResourceManager.class );
String version = m_system.get( "install", null );
@@ -158,10 +153,8 @@
{
Class cls = getClass().getClassLoader().loadClass( classname );
Class[] params = new Class[]{
- Monitor.class,
LocationResolver.class};
Object[] args = new Object[]{
- m_monitor,
m_resolver};
Constructor cons = cls.getConstructor( params );
return (CacheHandler) cons.newInstance( args );

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostFactory.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostFactory.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostFactory.java
Sat May 7 00:14:13 2005
@@ -32,6 +32,8 @@
import java.util.List;
import java.util.ArrayList;
import java.util.Properties;
+import java.util.logging.Logger;
+import java.util.logging.Level;

import net.dpml.lang.NullArgumentException;

@@ -42,8 +44,6 @@

import net.dpml.transit.layout.LocationResolver;

-import net.dpml.transit.monitors.SystemMonitor;
-
/**
* Internal class that handles the creation of resource hosts based on an
XML host
* destriptor or property files.
@@ -88,11 +88,6 @@
*/
private URL m_authorative;

- /**
- * Monitor
- */
- private SystemMonitor m_monitor;
-
//
------------------------------------------------------------------------
// constructor
//
------------------------------------------------------------------------
@@ -101,13 +96,10 @@
* Creation of a new resource host factory using a supplied authoriative
* anchor url.
* @param authorative the authorative anchor
- * @param monitor the bootstrap monitor
- * @param flag TRUE if preferences are enabled
*/
- ResourceHostFactory( URL authorative, SystemMonitor monitor )
+ ResourceHostFactory( URL authorative )
{
m_authorative = authorative;
- m_monitor = monitor;
}

//
------------------------------------------------------------------------
@@ -570,7 +562,14 @@
if( instance instanceof ResourceHost )
{
ResourceHost host = (ResourceHost) instance;
- m_monitor.notifyHostCreation( host );
+ Logger logger = Logger.getLogger( "transit" );
+ if( logger.isLoggable( Level.FINE ) )
+ {
+ final String message =
+ "Create a new resource host"
+ + "\nClass: " + classname;
+ logger.fine( message );
+ }
return host;
}
else

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/host/ResourceHostHelper.java
Sat May 7 00:14:13 2005
@@ -42,8 +42,6 @@

import net.dpml.transit.layout.LocationResolver;

-import net.dpml.transit.monitors.SystemMonitor;
-
import net.dpml.transit.util.Util;

/**

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/host/StandardResourceManager.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/host/StandardResourceManager.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/host/StandardResourceManager.java
Sat May 7 00:14:13 2005
@@ -23,8 +23,6 @@
import net.dpml.transit.cache.CacheHandler;
import net.dpml.transit.layout.ClassicResolver;
import net.dpml.transit.layout.LocationResolver;
-import net.dpml.transit.monitors.Monitor;
-import net.dpml.transit.monitors.SystemMonitor;
import net.dpml.transit.util.Util;

import java.io.FileNotFoundException;
@@ -39,7 +37,7 @@
*
* The CacheHandler constructor MUST have the signature of;
* <code><pre>
- * MyCacheHandler( Monitor monitor, ResourceHost[] hosts, Properties
props, LocationResolver resolver )
+ * MyCacheHandler( ResourceHost[] hosts, Properties props,
LocationResolver resolver )
* </pre></code>
*/
public class StandardResourceManager implements ResourceManager
@@ -70,7 +68,6 @@
//
------------------------------------------------------------------------

private final URL m_authorative;
- private final SystemMonitor m_monitor;
private final ResourceHost[] m_hosts;
private final Properties m_properties;
private final LocationResolver m_resolver;
@@ -82,17 +79,15 @@
/**
* Creation of a new resource manager.
* @param authorative the authorative base url
- * @param monitor the internal monitor
* @exception IOException if an io error occurs
* @exception TransitException if a transit system error occurs
*/
- public StandardResourceManager( URL authorative, SystemMonitor monitor )
+ public StandardResourceManager( URL authorative )
throws TransitException, IOException
{
m_authorative = authorative;
- m_monitor = monitor;

- ResourceHostFactory factory = new ResourceHostFactory(
m_authorative, m_monitor );
+ ResourceHostFactory factory = new ResourceHostFactory( m_authorative
);
m_hosts = factory.createResourceHosts();

m_properties = getCacheProperties( m_authorative );
@@ -131,12 +126,10 @@
{
Class cls = getClass().getClassLoader().loadClass( classname );
Class[] params = new Class[]{
- Monitor.class,
ResourceHost[].class,
Properties.class,
LocationResolver.class};
Object[] args = new Object[]{
- m_monitor,
m_hosts,
m_properties,
m_resolver};

Added:
development/main/transit/core/handler/src/main/net/dpml/transit/logging/LoggingController.java
==============================================================================
--- (empty file)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/logging/LoggingController.java
Sat May 7 00:14:13 2005
@@ -0,0 +1,92 @@
+/*
+ * 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.logging;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.Properties;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * Utility class used to establish the logging configuration. The contents
of
+ * this class are subject to radical change but that's largely academic
because
+ * this class does not expose any operations. Changes will include reading
+ * logging configuration info from preferences (and initialization of prefs
if
+ * required).
+ */
+ public class LoggingController
+ {
+ /**
+ * Creation of the logging controller.
+ */
+ public LoggingController()
+ {
+ this( false );
+ }
+
+ /**
+ * Creation of a new bootstrap monitor.
+ * @param monitor the trace monitor
+ */
+ public LoggingController( boolean debug )
+ {
+ Properties properties = new Properties();
+ properties.setProperty(
+ "handlers",
+ "java.util.logging.ConsoleHandler" );
+ properties.setProperty(
+ "java.util.logging.ConsoleHandler.formatter",
+ "net.dpml.transit.logging.StandardFormatter" );
+ if( debug )
+ {
+ properties.setProperty(
+ ".level",
+ "FINE" );
+ properties.setProperty(
+ "java.util.logging.ConsoleHandler.level",
+ "FINE" );
+ }
+ else
+ {
+ properties.setProperty(
+ ".level",
+ "INFO" );
+ properties.setProperty(
+ "java.util.logging.ConsoleHandler.level",
+ "INFO" );
+ }
+ try
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ properties.store( out, "DPML Logging properties" );
+ byte[] bytes = out.toByteArray();
+ ByteArrayInputStream input = new ByteArrayInputStream( bytes );
+ LogManager manager = LogManager.getLogManager();
+ manager.readConfiguration( input );
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
+ }
+}
+
+

Copied:
development/main/transit/core/handler/src/main/net/dpml/transit/logging/StandardFormatter.java
(from r2458,
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/StandardFormatter.java)
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/StandardFormatter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/logging/StandardFormatter.java
Sat May 7 00:14:13 2005
@@ -1,11 +1,30 @@
+/*
+ * 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.adapter;
+package net.dpml.transit.logging;

-import java.io.*;
-import java.text.*;
+//import java.io.*;
+//import java.text.*;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;

+import net.dpml.transit.util.ExceptionHelper;
+
/**
* Logging message formatter that includes the category in the logging
statement.
*/

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/AbstractMonitorRouter.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/AbstractMonitorRouter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/AbstractMonitorRouter.java
Sat May 7 00:14:13 2005
@@ -24,7 +24,7 @@
* A repository monitor router handles mutlicast distribution of monitor
events to
* a set of subscribed monitors.
*/
-public class AbstractMonitorRouter implements Router, Monitor
+public class AbstractMonitorRouter implements Router
{
//--------------------------------------------------------------------
// static
@@ -44,24 +44,6 @@
*/
private ArrayList m_monitors;

- /**
- * The trace monitor.
- */
- private final Monitor m_monitor;
-
- //--------------------------------------------------------------------
- // constructors
- //--------------------------------------------------------------------
-
- /**
- * Creation of a new abstract router.
- * @param monitor the trace monitor
- */
- public AbstractMonitorRouter( Monitor monitor )
- {
- m_monitor = monitor;
- }
-
//--------------------------------------------------------------------
// Router
//--------------------------------------------------------------------
@@ -128,30 +110,5 @@
return (Monitor[]) m_monitors.toArray( new Monitor[0] );
}
}
-
- //--------------------------------------------------------------------
- // Monitor
- //--------------------------------------------------------------------
-
- /**
- * Test is debug trace monitoring is enabled.
- * @return true if debug trace messages are enabled else false
- */
- public boolean isTraceEnabled()
- {
- return m_monitor.isTraceEnabled();
- }
-
- /**
- * Notify the monitor of a trace level message to log. An implement
- * is responsible for checking if trace debug logging is enabled
- * before handling content.
- *
- * @param message the trace level message to log
- */
- public void trace( String message )
- {
- m_monitor.trace( message );
- }
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/CacheMonitorRouter.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/CacheMonitorRouter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/CacheMonitorRouter.java
Sat May 7 00:14:13 2005
@@ -32,19 +32,6 @@
implements CacheMonitor, Router
{
//--------------------------------------------------------------------
- // constructors
- //--------------------------------------------------------------------
-
- /**
- * Creation of a new cache monitor router.
- * @param monitor the bootstrap trace monitor
- */
- public CacheMonitorRouter( Monitor monitor )
- {
- super( monitor );
- }
-
- //--------------------------------------------------------------------
// CacheMonitor
//--------------------------------------------------------------------


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java
Sat May 7 00:14:13 2005
@@ -28,19 +28,6 @@
implements ConnectionMonitor, Router
{
//--------------------------------------------------------------------
- // constructors
- //--------------------------------------------------------------------
-
- /**
- * Creation of a new connection monitor router.
- * @param monitor the bootstrap trace monitor
- */
- public ConnectionMonitorRouter( Monitor monitor )
- {
- super( monitor );
- }
-
- //--------------------------------------------------------------------
// ConnectionMonitor
//--------------------------------------------------------------------


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/Monitor.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/Monitor.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/Monitor.java
Sat May 7 00:14:13 2005
@@ -28,23 +28,5 @@
* of a debug trace policy.
*/
final String BOOTSTRAP_DEBUG_KEY = "dpml.transit.debug";
-
- /**
- * Null monitor.
- */
- final Monitor NULL_MONITOR = new NullMonitor();
-
- /**
- * Test is trace monitoring is enabled.
- * @return true if debug trace messages are enabled elese false
- */
- boolean isTraceEnabled();
-
- /**
- * Notify the monitor of a trace level message to log.
- *
- * @param message the trace level message
- */
- void trace( String message );
}


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/NetworkMonitorRouter.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/NetworkMonitorRouter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/NetworkMonitorRouter.java
Sat May 7 00:14:13 2005
@@ -26,18 +26,6 @@
public class NetworkMonitorRouter extends AbstractMonitorRouter
implements NetworkMonitor, Router
{
- //--------------------------------------------------------------------
- // constructors
- //--------------------------------------------------------------------
-
- /**
- * Creation of a new network monitor router.
- * @param monitor the bootstrap trace monitor
- */
- public NetworkMonitorRouter( Monitor monitor )
- {
- super( monitor );
- }

//--------------------------------------------------------------------
// NetworkMonitor

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/RepositoryMonitorRouter.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/RepositoryMonitorRouter.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/monitors/RepositoryMonitorRouter.java
Sat May 7 00:14:13 2005
@@ -29,19 +29,6 @@
implements RepositoryMonitor, Router
{
//--------------------------------------------------------------------
- // constructors
- //--------------------------------------------------------------------
-
- /**
- * Creation of a new repository monitor router.
- * @param monitor the bootstrap trace monitor
- */
- public RepositoryMonitorRouter( Monitor monitor )
- {
- super( monitor );
- }
-
- //--------------------------------------------------------------------
// RepositoryMonitor
//--------------------------------------------------------------------


Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/CachePanel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/CachePanel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/CachePanel.java
Sat May 7 00:14:13 2005
@@ -58,7 +58,7 @@
import javax.swing.JFileChooser;

import net.dpml.transit.Transit;
-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;
import net.dpml.transit.cache.CacheHandler;
import net.dpml.transit.host.ResourceManager;
import net.dpml.transit.util.Util;

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/HostPanel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/HostPanel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/HostPanel.java
Sat May 7 00:14:13 2005
@@ -66,7 +66,7 @@
import javax.swing.text.Document;

import net.dpml.transit.Transit;
-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;
import net.dpml.transit.cache.CacheHandler;
import net.dpml.transit.host.ResourceManager;
import net.dpml.transit.host.HostDescriptor;

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/ResourcePanel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/ResourcePanel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/prefs/ResourcePanel.java
Sat May 7 00:14:13 2005
@@ -56,7 +56,7 @@
import javax.swing.event.ListSelectionEvent;

import net.dpml.transit.Transit;
-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;
import net.dpml.transit.cache.CacheHandler;
import net.dpml.transit.host.ResourceHost;
import net.dpml.transit.util.Util;

Copied:
development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
(from r2458,
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java)
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
Sat May 7 00:14:13 2005
@@ -16,7 +16,7 @@
* limitations under the License.
*/

-package net.dpml.transit.adapter;
+package net.dpml.transit.util;

import java.io.PrintWriter;
import java.io.StringWriter;

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
Sat May 7 00:14:13 2005
@@ -21,7 +21,7 @@
import java.net.URL;

import net.dpml.transit.adapter.Adapter;
-import net.dpml.transit.adapter.ExceptionHelper;
+import net.dpml.transit.util.ExceptionHelper;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;

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
Sat May 7 00:14:13 2005
@@ -28,7 +28,6 @@
import net.dpml.transit.Transit;
import net.dpml.transit.artifact.Handler;
import net.dpml.transit.monitors.Monitor;
-import net.dpml.transit.monitors.SystemMonitor;

/**
* Ant task that provides support for the import of build file templates
@@ -36,22 +35,20 @@
*
* @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
*/
-public class ImportArtifactTask extends ImportTask implements Monitor
+public class ImportArtifactTask extends ImportTask
{
/**
- * The transit lead tag.
+ * A flag indicating that nested directives have been provided.
*/
- private static final String TAG = " [transit] ";
+ private boolean m_flag = false;

public void setProject( Project project )
{
super.setProject( project );

- m_trace = ( "true".equals( project.getProperty(
Monitor.BOOTSTRAP_DEBUG_KEY ) ) );
-
try
{
- Transit.getInstance( new SystemMonitor( this ) );
+ Transit.getInstance();
}
catch( Throwable e )
{
@@ -61,16 +58,6 @@
}
}

- /**
- * A flag indicating that nested directives have been provided.
- */
- private boolean m_flag = false;
-
- /**
- * Trace enabled status.
- */
- private boolean m_trace = false;
-
//
------------------------------------------------------------------------
// Task
//
------------------------------------------------------------------------
@@ -98,28 +85,5 @@
throw new BuildException( error, e );
}
}
-
- /**
- * Test is trace monitoring is enabled.
- * @return true if debug trace messages are enabled elese false
- */
- public boolean isTraceEnabled()
- {
- return m_trace;
- }
-
- /**
- * Process a trace message.
- *
- * @param message the trace level message
- */
- public void trace( String message )
- {
- if( isTraceEnabled() )
- {
- getProject().log( TAG + message );
- }
- }
-
}




  • svn commit: r2464 - in development/main: metro metro/composition/control/src/main/net/dpml/composition/control metro/composition/control/src/main/net/dpml/composition/event 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/event transit/core/handler/src/main/net/dpml/transit/host transit/core/handler/src/main/net/dpml/transit/logging transit/core/handler/src/main/net/dpml/transit/monitors transit/core/handler/src/main/net/dpml/transit/prefs transit/core/handler/src/main/net/dpml/transit/util transit/core/tools/src/main/net/dpml/transit/tools, mcconnell, 05/06/2005

Archive powered by MHonArc 2.6.24.

Top of Page