Skip to Content.
Sympa Menu

notify-dpml - r1193 - in trunk/main: depot/build/src/main/net/dpml/library/console depot/core/src/main/net/dpml/depot depot/install/src/main/net/dpml/depot/install depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/impl depot/tools/builder/src/main/net/dpml/tools/process depot/tools/builder/src/main/net/dpml/tools/tasks metro/builder/src/main/net/dpml/metro/builder metro/builder/src/test/net/dpml/metro/builder metro/exec/src/main/net/dpml/metro/exec metro/install/src/main/net/dpml/metro/central metro/model/src/main/net/dpml/metro/data metro/part/api/src/main/net/dpml/part metro/runtime/src/main/net/dpml/metro/runtime metro/station/api/src/main/net/dpml/station metro/station/api/src/main/net/dpml/station/info metro/station/api/src/test/net/dpml/station/info metro/station/builder/src/main/net/dpml/station/builder metro/station/console/src/main/net/dpml/station/console metro/station/server/src/main/ne! t/dpml/station/server metro/station/server/src/test/net/dpml/station/server metro/tools/src/main/net/dpml/metro/tools transit/console/src/main/net/dpml/transit/console transit/core/src/main/net/dpml/lang transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/info transit/core/src/main/net/dpml/transit/model transit/core/src/main/net/dpml/transit/monitor transit/core/src/main/net/dpml/transit/util transit/core/src/test/net/dpml/transit/info transit/core/src/test/net/dpml/transit/test transit/tools/src/main/net/dpml/transit/tools

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1193 - in trunk/main: depot/build/src/main/net/dpml/library/console depot/core/src/main/net/dpml/depot depot/install/src/main/net/dpml/depot/install depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/impl depot/tools/builder/src/main/net/dpml/tools/process depot/tools/builder/src/main/net/dpml/tools/tasks metro/builder/src/main/net/dpml/metro/builder metro/builder/src/test/net/dpml/metro/builder metro/exec/src/main/net/dpml/metro/exec metro/install/src/main/net/dpml/metro/central metro/model/src/main/net/dpml/metro/data metro/part/api/src/main/net/dpml/part metro/runtime/src/main/net/dpml/metro/runtime metro/station/api/src/main/net/dpml/station metro/station/api/src/main/net/dpml/station/info metro/station/api/src/test/net/dpml/station/info metro/station/builder/src/main/net/dpml/station/builder metro/station/console/src/main/net/dpml/station/console metro/station/server/src/main/ne! t/dpml/station/server metro/station/server/src/test/net/dpml/station/server metro/tools/src/main/net/dpml/metro/tools transit/console/src/main/net/dpml/transit/console transit/core/src/main/net/dpml/lang transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/info transit/core/src/main/net/dpml/transit/model transit/core/src/main/net/dpml/transit/monitor transit/core/src/main/net/dpml/transit/util transit/core/src/test/net/dpml/transit/info transit/core/src/test/net/dpml/transit/test transit/tools/src/main/net/dpml/transit/tools
  • Date: Thu, 16 Mar 2006 18:36:35 +0100

Author: mcconnell
Date: 2006-03-16 18:35:47 +0100 (Thu, 16 Mar 2006)
New Revision: 1193

Added:
trunk/main/transit/core/src/main/net/dpml/lang/AbstractDirective.java
trunk/main/transit/core/src/main/net/dpml/lang/Construct.java
trunk/main/transit/core/src/main/net/dpml/lang/Logger.java
trunk/main/transit/core/src/main/net/dpml/lang/LoggingService.java
trunk/main/transit/core/src/main/net/dpml/lang/PID.java
trunk/main/transit/core/src/main/net/dpml/lang/Value.java
trunk/main/transit/core/src/main/net/dpml/lang/ValueDirective.java
trunk/main/transit/core/src/main/net/dpml/lang/ValueException.java
trunk/main/transit/core/src/main/net/dpml/lang/ValueRuntimeException.java
trunk/main/transit/core/src/main/net/dpml/transit/DTD.java
trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
trunk/main/transit/core/src/main/net/dpml/transit/SaxMonitor.java
Removed:
trunk/main/transit/core/src/main/net/dpml/lang/CategoryBeanInfo.java
trunk/main/transit/core/src/main/net/dpml/lang/DTD.java
trunk/main/transit/core/src/main/net/dpml/lang/DTDResolver.java
trunk/main/transit/core/src/main/net/dpml/lang/SaxMonitor.java
trunk/main/transit/core/src/main/net/dpml/part/DOMDocumentBuilder.java
trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
trunk/main/transit/core/src/main/net/dpml/transit/Logger.java
trunk/main/transit/core/src/main/net/dpml/transit/LoggingService.java
trunk/main/transit/core/src/main/net/dpml/transit/PID.java
trunk/main/transit/core/src/main/net/dpml/transit/Value.java
trunk/main/transit/core/src/main/net/dpml/transit/ValueException.java

trunk/main/transit/core/src/main/net/dpml/transit/ValueRuntimeException.java

trunk/main/transit/core/src/main/net/dpml/transit/info/AbstractDirective.java
trunk/main/transit/core/src/main/net/dpml/transit/info/ValueDirective.java
Modified:
trunk/main/depot/build/src/main/net/dpml/library/console/BuilderPlugin.java
trunk/main/depot/core/src/main/net/dpml/depot/DepotHandler.java
trunk/main/depot/core/src/main/net/dpml/depot/Main.java

trunk/main/depot/install/src/main/net/dpml/depot/install/DepotInstaller.java

trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java

trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java

trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/StandardBuilder.java

trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java

trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java

trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/ReactorTask.java

trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentBuilder.java

trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyBuilder.java

trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyWriter.java

trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentWriter.java

trunk/main/metro/builder/src/test/net/dpml/metro/builder/LookupTestCase.java
trunk/main/metro/builder/src/test/net/dpml/metro/builder/PartsTestCase.java
trunk/main/metro/exec/src/main/net/dpml/metro/exec/AbstractAdapter.java
trunk/main/metro/exec/src/main/net/dpml/metro/exec/ApplicationHandler.java
trunk/main/metro/exec/src/main/net/dpml/metro/exec/ComponentAdapter.java

trunk/main/metro/install/src/main/net/dpml/metro/central/MetroInstaller.java
trunk/main/metro/model/src/main/net/dpml/metro/data/ValueDirective.java
trunk/main/metro/part/api/src/main/net/dpml/part/ControllerContext.java
trunk/main/metro/part/api/src/main/net/dpml/part/InitialContext.java
trunk/main/metro/part/api/src/main/net/dpml/part/LocalEventProducer.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/StandardLogger.java
trunk/main/metro/station/api/src/main/net/dpml/station/Application.java
trunk/main/metro/station/api/src/main/net/dpml/station/Callback.java

trunk/main/metro/station/api/src/main/net/dpml/station/info/ApplicationDescriptor.java

trunk/main/metro/station/api/src/test/net/dpml/station/info/ApplicationDescriptorTestCase.java

trunk/main/metro/station/api/src/test/net/dpml/station/info/RegistryDescriptorTestCase.java

trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java

trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryWriter.java

trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/DefaultModel.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/LoggingServer.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplication.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteStation.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/StationServerPlugin.java

trunk/main/metro/station/server/src/main/net/dpml/station/server/UnicastEventSource.java

trunk/main/metro/station/server/src/test/net/dpml/station/server/RemoteApplicationRegistryTestCase.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java

trunk/main/transit/console/src/main/net/dpml/transit/console/ContentDirectiveBuilder.java

trunk/main/transit/console/src/main/net/dpml/transit/console/LayoutDirectiveBuilder.java

trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
trunk/main/transit/core/src/main/net/dpml/part/AbstractBuilder.java
trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
trunk/main/transit/core/src/main/net/dpml/part/PartDirective.java
trunk/main/transit/core/src/main/net/dpml/part/PartHandler.java
trunk/main/transit/core/src/main/net/dpml/part/PartHandlerFactory.java
trunk/main/transit/core/src/main/net/dpml/part/PartStrategyBuilder.java
trunk/main/transit/core/src/main/net/dpml/part/PartStrategyWriter.java
trunk/main/transit/core/src/main/net/dpml/part/Plugin.java
trunk/main/transit/core/src/main/net/dpml/part/StandardPartHandler.java
trunk/main/transit/core/src/main/net/dpml/part/ValueBuilder.java
trunk/main/transit/core/src/main/net/dpml/part/ValueWriter.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCodeBaseModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentModel.java

trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java

trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistryModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutModel.java

trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java

trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistryModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultProxyModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
trunk/main/transit/core/src/main/net/dpml/transit/Repository.java

trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
trunk/main/transit/core/src/main/net/dpml/transit/StandardLayoutModel.java
trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
trunk/main/transit/core/src/main/net/dpml/transit/info/CacheDirective.java

trunk/main/transit/core/src/main/net/dpml/transit/info/CodeBaseDirective.java

trunk/main/transit/core/src/main/net/dpml/transit/info/ContentDirective.java
trunk/main/transit/core/src/main/net/dpml/transit/info/HostDirective.java
trunk/main/transit/core/src/main/net/dpml/transit/info/LayoutDirective.java
trunk/main/transit/core/src/main/net/dpml/transit/info/ProxyDirective.java

trunk/main/transit/core/src/main/net/dpml/transit/info/TransitDirective.java
trunk/main/transit/core/src/main/net/dpml/transit/model/CodeBaseModel.java

trunk/main/transit/core/src/main/net/dpml/transit/model/ParametersEvent.java
trunk/main/transit/core/src/main/net/dpml/transit/monitor/Adapter.java

trunk/main/transit/core/src/main/net/dpml/transit/monitor/LoggingAdapter.java

trunk/main/transit/core/src/main/net/dpml/transit/util/StandardFormatter.java

trunk/main/transit/core/src/test/net/dpml/transit/info/CodeBaseDirectiveTestCase.java

trunk/main/transit/core/src/test/net/dpml/transit/info/ContentDirectiveTestCase.java

trunk/main/transit/core/src/test/net/dpml/transit/info/LayoutDirectiveTestCase.java

trunk/main/transit/core/src/test/net/dpml/transit/info/ValueDirectiveTestCase.java

trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
Log:
cleaning up inter-package dependencies in transit (a work-in-progress)

Modified:
trunk/main/depot/build/src/main/net/dpml/library/console/BuilderPlugin.java
===================================================================
---
trunk/main/depot/build/src/main/net/dpml/library/console/BuilderPlugin.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/build/src/main/net/dpml/library/console/BuilderPlugin.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -25,7 +25,7 @@
import java.util.Arrays;
import java.util.List;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.Transit;

import net.dpml.library.info.Scope;

Modified: trunk/main/depot/core/src/main/net/dpml/depot/DepotHandler.java
===================================================================
--- trunk/main/depot/core/src/main/net/dpml/depot/DepotHandler.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/depot/core/src/main/net/dpml/depot/DepotHandler.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,8 +23,8 @@
import java.util.logging.Handler;
import java.util.logging.LogRecord;

-import net.dpml.transit.PID;
-import net.dpml.transit.LoggingService;
+import net.dpml.lang.PID;
+import net.dpml.lang.LoggingService;

/**
* Logging message handler that redirects log messages from a subprocess to

Modified: trunk/main/depot/core/src/main/net/dpml/depot/Main.java
===================================================================
--- trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-03-15
19:07:04 UTC (rev 1192)
+++ trunk/main/depot/core/src/main/net/dpml/depot/Main.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -30,7 +30,6 @@
import net.dpml.transit.TransitError;
import net.dpml.transit.Repository;
import net.dpml.transit.RepositoryException;
-import net.dpml.transit.Logger;
import net.dpml.transit.DefaultTransitModel;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.monitor.Adapter;
@@ -38,8 +37,10 @@
import net.dpml.transit.monitor.RepositoryMonitorAdapter;
import net.dpml.transit.monitor.CacheMonitorAdapter;
import net.dpml.transit.monitor.NetworkMonitorAdapter;
+
import net.dpml.lang.Enum;
-import net.dpml.transit.PID;
+import net.dpml.lang.PID;
+import net.dpml.lang.Logger;

/**
* CLI hander for the depot package.

Modified:
trunk/main/depot/install/src/main/net/dpml/depot/install/DepotInstaller.java
===================================================================
---
trunk/main/depot/install/src/main/net/dpml/depot/install/DepotInstaller.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/install/src/main/net/dpml/depot/install/DepotInstaller.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -16,7 +16,7 @@

package net.dpml.depot.install;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

import net.dpml.station.Station;


Modified:
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
===================================================================
---
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -39,7 +39,7 @@
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.model.TransitRegistryModel;
import net.dpml.transit.model.DefaultTransitRegistryModel;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.store.TransitStorageHome;
import net.dpml.transit.util.CLIHelper;


Modified:
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
===================================================================
---
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -36,7 +36,7 @@
import net.dpml.transit.Repository;
import net.dpml.transit.Artifact;
import net.dpml.transit.artifact.ArtifactNotFoundException;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.model.TransitRegistryModel;
import net.dpml.transit.util.StreamUtils;

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultLibrary.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -41,7 +41,7 @@
import net.dpml.library.model.ResourceNotFoundException;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

/**
* Utility class used for construction of a module model from an XML source.

Modified:
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
===================================================================
---
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/library/src/test/net/dpml/library/impl/AbstractTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -36,7 +36,7 @@
import net.dpml.library.model.Resource;
import net.dpml.library.info.Scope;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.monitor.LoggingAdapter;

/**

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/StandardBuilder.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/StandardBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/impl/StandardBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,7 +31,7 @@
import net.dpml.tools.model.Context;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.model.TransitModel;
import net.dpml.transit.tools.MainTask;


Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/process/PluginProcess.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -32,7 +32,7 @@

import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.util.ExceptionHelper;

import net.dpml.part.Part;

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/GenericTask.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -28,7 +28,7 @@
import net.dpml.library.model.Resource;
import net.dpml.library.impl.DefaultLibrary;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.monitor.LoggingAdapter;

import org.apache.tools.ant.BuildException;

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -32,7 +32,7 @@

import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

import net.dpml.part.Part;
import net.dpml.part.Strategy;

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/ReactorTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/ReactorTask.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/ReactorTask.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -24,7 +24,7 @@
import net.dpml.library.impl.DefaultLibrary;
import net.dpml.tools.impl.StandardBuilder;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.monitor.LoggingAdapter;

import org.apache.tools.ant.BuildException;

Modified:
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentBuilder.java
===================================================================
---
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -54,7 +54,7 @@
import net.dpml.metro.info.Type;

import net.dpml.transit.util.ElementHelper;
-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

Modified:
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyBuilder.java
===================================================================
---
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -25,8 +25,8 @@

import net.dpml.metro.data.ComponentDirective;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import net.dpml.part.Strategy;

Modified:
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyWriter.java
===================================================================
---
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyWriter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentStrategyWriter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -37,8 +37,8 @@
import net.dpml.metro.info.CollectionPolicy;
import net.dpml.metro.info.PartReference;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import net.dpml.part.Strategy;

Modified:
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentWriter.java
===================================================================
---
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentWriter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/builder/src/main/net/dpml/metro/builder/ComponentWriter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -40,8 +40,8 @@
import net.dpml.metro.info.PartReference;
import net.dpml.metro.info.Priority;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import net.dpml.part.Strategy;

Modified:
trunk/main/metro/builder/src/test/net/dpml/metro/builder/LookupTestCase.java
===================================================================
---
trunk/main/metro/builder/src/test/net/dpml/metro/builder/LookupTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/builder/src/test/net/dpml/metro/builder/LookupTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -26,7 +26,7 @@
import java.net.URI;

import net.dpml.part.Directive;
-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

import net.dpml.metro.info.PartReference;
import net.dpml.metro.data.ContextDirective;

Modified:
trunk/main/metro/builder/src/test/net/dpml/metro/builder/PartsTestCase.java
===================================================================
---
trunk/main/metro/builder/src/test/net/dpml/metro/builder/PartsTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/builder/src/test/net/dpml/metro/builder/PartsTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -26,7 +26,7 @@
import java.net.URI;

import net.dpml.part.Directive;
-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

import net.dpml.metro.info.PartReference;
import net.dpml.metro.data.ContextDirective;
@@ -82,10 +82,10 @@
String method = value.getMethodName();
String target = value.getTargetExpression();
Value[] values = value.getValues();
- System.out.println( "# TARGET: " + target );
- System.out.println( "# METHOD: " + method );
- System.out.println( "# BASE: " + base );
- System.out.println( "# VALUES: " + values.length );
+ //System.out.println( "# TARGET: " + target );
+ //System.out.println( "# METHOD: " + method );
+ //System.out.println( "# BASE: " + base );
+ //System.out.println( "# VALUES: " + values.length );
}
else
{

Modified:
trunk/main/metro/exec/src/main/net/dpml/metro/exec/AbstractAdapter.java
===================================================================
--- trunk/main/metro/exec/src/main/net/dpml/metro/exec/AbstractAdapter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/exec/src/main/net/dpml/metro/exec/AbstractAdapter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -29,7 +29,7 @@
import net.dpml.part.ServiceNotFoundException;
import net.dpml.part.ActivationPolicy;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

/**
* The AbstractAdapter class is a minimalistic implementation of a part

Modified:
trunk/main/metro/exec/src/main/net/dpml/metro/exec/ApplicationHandler.java
===================================================================
---
trunk/main/metro/exec/src/main/net/dpml/metro/exec/ApplicationHandler.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/exec/src/main/net/dpml/metro/exec/ApplicationHandler.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -33,8 +33,8 @@
import net.dpml.station.ApplicationException;

import net.dpml.transit.Artifact;
-import net.dpml.transit.PID;
-import net.dpml.transit.Logger;
+import net.dpml.lang.PID;
+import net.dpml.lang.Logger;

import net.dpml.cli.Option;
import net.dpml.cli.Group;

Modified:
trunk/main/metro/exec/src/main/net/dpml/metro/exec/ComponentAdapter.java
===================================================================
--- trunk/main/metro/exec/src/main/net/dpml/metro/exec/ComponentAdapter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/exec/src/main/net/dpml/metro/exec/ComponentAdapter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -50,7 +50,7 @@
import net.dpml.configuration.Configuration;
import net.dpml.configuration.impl.DefaultConfigurationBuilder;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.Repository;
import net.dpml.transit.Transit;


Modified:
trunk/main/metro/install/src/main/net/dpml/metro/central/MetroInstaller.java
===================================================================
---
trunk/main/metro/install/src/main/net/dpml/metro/central/MetroInstaller.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/install/src/main/net/dpml/metro/central/MetroInstaller.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,7 +20,7 @@

import java.net.URI;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.model.ContentModel;
import net.dpml.transit.model.ContentRegistryModel;
import net.dpml.transit.model.TransitModel;

Modified:
trunk/main/metro/model/src/main/net/dpml/metro/data/ValueDirective.java
===================================================================
--- trunk/main/metro/model/src/main/net/dpml/metro/data/ValueDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/model/src/main/net/dpml/metro/data/ValueDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -21,8 +21,8 @@
import java.net.URI;
import java.net.URISyntaxException;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;

import net.dpml.part.Directive;


Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/ControllerContext.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/ControllerContext.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/ControllerContext.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,7 +20,7 @@

import java.io.File;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

/**
* The ControllerContext declares the runtime context that a controller

Modified: trunk/main/metro/part/api/src/main/net/dpml/part/InitialContext.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/InitialContext.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/InitialContext.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -27,7 +27,7 @@
import java.util.EventObject;
import java.util.EventListener;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.Transit;
import net.dpml.transit.Repository;
import net.dpml.transit.monitor.LoggingAdapter;

Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/LocalEventProducer.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/LocalEventProducer.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/LocalEventProducer.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.WeakHashMap;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

/**
* A abstract base class that established an event queue and handles event
dispatch

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/ComponentController.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -58,7 +58,7 @@
import net.dpml.lang.Classpath;
import net.dpml.lang.UnknownKeyException;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;


/**

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/StandardLogger.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/StandardLogger.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/StandardLogger.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,7 +18,7 @@

package net.dpml.metro.runtime;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.monitor.LoggingAdapter;

/**

Modified:
trunk/main/metro/station/api/src/main/net/dpml/station/Application.java
===================================================================
--- trunk/main/metro/station/api/src/main/net/dpml/station/Application.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/station/api/src/main/net/dpml/station/Application.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,7 +23,7 @@

import net.dpml.part.Provider;

-import net.dpml.transit.PID;
+import net.dpml.lang.PID;

import net.dpml.station.info.ApplicationDescriptor;


Modified: trunk/main/metro/station/api/src/main/net/dpml/station/Callback.java
===================================================================
--- trunk/main/metro/station/api/src/main/net/dpml/station/Callback.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/station/api/src/main/net/dpml/station/Callback.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,7 +23,7 @@

import net.dpml.part.Component;

-import net.dpml.transit.PID;
+import net.dpml.lang.PID;

/**
* The Callback interface defines a service provider to a process through

Modified:
trunk/main/metro/station/api/src/main/net/dpml/station/info/ApplicationDescriptor.java
===================================================================
---
trunk/main/metro/station/api/src/main/net/dpml/station/info/ApplicationDescriptor.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/api/src/main/net/dpml/station/info/ApplicationDescriptor.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,7 +23,7 @@
import java.net.URISyntaxException;

import net.dpml.transit.info.CodeBaseDirective;
-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;

/**
* The ApplicationDescriptor is immutable datastructure used to

Modified:
trunk/main/metro/station/api/src/test/net/dpml/station/info/ApplicationDescriptorTestCase.java
===================================================================
---
trunk/main/metro/station/api/src/test/net/dpml/station/info/ApplicationDescriptorTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/api/src/test/net/dpml/station/info/ApplicationDescriptorTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -21,7 +21,7 @@
import java.util.Properties;
import java.net.URI;

-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;

/**
* Test ApplicationDescriptor class.

Modified:
trunk/main/metro/station/api/src/test/net/dpml/station/info/RegistryDescriptorTestCase.java
===================================================================
---
trunk/main/metro/station/api/src/test/net/dpml/station/info/RegistryDescriptorTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/api/src/test/net/dpml/station/info/RegistryDescriptorTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -21,7 +21,7 @@
import java.util.Arrays;
import java.util.Properties;

-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;
import net.dpml.station.info.RegistryDescriptor.Entry;

/**

Modified:
trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
===================================================================
---
trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,7 +31,7 @@
import net.dpml.lang.BuilderException;
import net.dpml.lang.Builder;

-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;
import net.dpml.transit.util.ElementHelper;

import org.w3c.dom.Document;

Modified:
trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryWriter.java
===================================================================
---
trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryWriter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/builder/src/main/net/dpml/station/builder/RegistryWriter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -35,7 +35,7 @@
import net.dpml.lang.BuilderException;
import net.dpml.lang.Builder;

-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;
import net.dpml.transit.util.ElementHelper;

import org.w3c.dom.Document;

Modified:
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
===================================================================
---
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -53,10 +53,10 @@
import net.dpml.state.Interface;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Logger;
-import net.dpml.transit.PID;
+import net.dpml.lang.Logger;
+import net.dpml.lang.PID;
import net.dpml.transit.Disposable;
-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;
import net.dpml.transit.util.ExceptionHelper;
import net.dpml.transit.util.PropertyResolver;


Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/DefaultModel.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/DefaultModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/DefaultModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -27,7 +27,7 @@
import java.util.Map;
import java.util.WeakHashMap;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.monitor.LoggingAdapter;

/**

Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/LoggingServer.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/LoggingServer.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/LoggingServer.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,8 +23,8 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;

-import net.dpml.transit.PID;
-import net.dpml.transit.LoggingService;
+import net.dpml.lang.PID;
+import net.dpml.lang.LoggingService;

/**
* The LoggingServer is a remote service that handles the aggregation of

Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplication.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -43,8 +43,8 @@
import net.dpml.station.ApplicationListener;
import net.dpml.station.ApplicationEvent;

-import net.dpml.transit.Logger;
-import net.dpml.transit.PID;
+import net.dpml.lang.Logger;
+import net.dpml.lang.PID;

/**
* The RemoteApplication is the default implementation of a remotely

Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteApplicationRegistry.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -50,7 +50,7 @@
import net.dpml.station.info.ApplicationRegistryRuntimeException;

import net.dpml.transit.util.StreamUtils;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.DuplicateKeyException;

Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteStation.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteStation.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/RemoteStation.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -41,9 +41,9 @@
import net.dpml.station.info.StartupPolicy;
import net.dpml.station.ApplicationRegistry;

-import net.dpml.transit.Logger;
-import net.dpml.transit.LoggingService;
-import net.dpml.transit.PID;
+import net.dpml.lang.Logger;
+import net.dpml.lang.LoggingService;
+import net.dpml.lang.PID;
import net.dpml.transit.monitor.LoggingAdapter;

import net.dpml.lang.UnknownKeyException;

Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/StationServerPlugin.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -36,7 +36,7 @@
import net.dpml.station.ApplicationRegistry;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

/**
* The RemoteStation is responsible for the establishment of

Modified:
trunk/main/metro/station/server/src/main/net/dpml/station/server/UnicastEventSource.java
===================================================================
---
trunk/main/metro/station/server/src/main/net/dpml/station/server/UnicastEventSource.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/main/net/dpml/station/server/UnicastEventSource.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,7 +23,7 @@
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;


/**

Modified:
trunk/main/metro/station/server/src/test/net/dpml/station/server/RemoteApplicationRegistryTestCase.java
===================================================================
---
trunk/main/metro/station/server/src/test/net/dpml/station/server/RemoteApplicationRegistryTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/metro/station/server/src/test/net/dpml/station/server/RemoteApplicationRegistryTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,8 +31,8 @@

import net.dpml.transit.Artifact;
import net.dpml.transit.Transit;
-import net.dpml.transit.Logger;
-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.Logger;
+import net.dpml.lang.ValueDirective;
import net.dpml.transit.monitor.LoggingAdapter;

import net.dpml.lang.UnknownKeyException;

Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -30,7 +30,7 @@
import net.dpml.metro.info.EntryDescriptor;
import net.dpml.metro.info.Type;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

import org.apache.tools.ant.BuildException;


Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -19,7 +19,7 @@

package net.dpml.metro.tools;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

/**
* The contract for builders that create value datatypes.

Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/ValueDataType.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,7 +23,7 @@

import net.dpml.metro.data.ValueDirective;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

import org.apache.tools.ant.BuildException;


Modified:
trunk/main/transit/console/src/main/net/dpml/transit/console/ContentDirectiveBuilder.java
===================================================================
---
trunk/main/transit/console/src/main/net/dpml/transit/console/ContentDirectiveBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/console/src/main/net/dpml/transit/console/ContentDirectiveBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -22,7 +22,7 @@
import java.net.URISyntaxException;

import net.dpml.transit.info.ContentDirective;
-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;

/**
* Utility class supporting mutation of a content directive.

Modified:
trunk/main/transit/console/src/main/net/dpml/transit/console/LayoutDirectiveBuilder.java
===================================================================
---
trunk/main/transit/console/src/main/net/dpml/transit/console/LayoutDirectiveBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/console/src/main/net/dpml/transit/console/LayoutDirectiveBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -22,7 +22,7 @@
import java.net.URISyntaxException;

import net.dpml.transit.info.LayoutDirective;
-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;

/**
* Utility class supporting mutation of a layout directive.

Modified:
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
===================================================================
---
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/console/src/main/net/dpml/transit/console/TransitConsoleHandler.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -51,7 +51,7 @@
import net.dpml.cli.validation.NumberValidator;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.Transit;
import net.dpml.transit.TransitBuilder;
import net.dpml.transit.RepositoryException;
@@ -62,7 +62,7 @@
import net.dpml.transit.info.HostDirective;
import net.dpml.transit.info.LayoutDirective;
import net.dpml.transit.info.ContentDirective;
-import net.dpml.transit.info.ValueDirective;
+import net.dpml.lang.ValueDirective;
import net.dpml.transit.util.ExceptionHelper;

import net.dpml.lang.UnknownKeyException;

Copied: trunk/main/transit/core/src/main/net/dpml/lang/AbstractDirective.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/transit/info/AbstractDirective.java)
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/AbstractDirective.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/AbstractDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,115 @@
+/*
+ * 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.lang;
+
+import java.io.Serializable;
+
+/**
+ * Abstract directive base class.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public abstract class AbstractDirective implements Serializable
+{
+ /**
+ * Compare this object to the supplied object for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( null == other )
+ {
+ return false;
+ }
+ else
+ {
+ return ( other instanceof AbstractDirective );
+ }
+ }
+
+ /**
+ * Calculate the hashcode.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ return getClass().hashCode();
+ }
+
+ /**
+ * Utility to hash an array.
+ * @param array the array
+ * @return the hash value
+ */
+ protected int hashArray( Object[] array )
+ {
+ if( null == array )
+ {
+ return 0;
+ }
+ int hash = 0;
+ for( int i=0; i<array.length; i++ )
+ {
+ Object object = array[i];
+ hash ^= hashValue( object );
+ }
+ return hash;
+ }
+
+ /**
+ * Utility to hash an object.
+ * @param value the object
+ * @return the hash value
+ */
+ protected int hashValue( Object value )
+ {
+ if( null == value )
+ {
+ return 0;
+ }
+ else if( value instanceof Object[] )
+ {
+ return hashArray( (Object[]) value );
+ }
+ else
+ {
+ return value.hashCode();
+ }
+ }
+
+ /**
+ * Utility to compare two object for equality.
+ * @param a the first object
+ * @param b the second object
+ * @return true if the objects are equal
+ */
+ protected boolean equals( Object a, Object b )
+ {
+ if( null == a )
+ {
+ return ( null == b );
+ }
+ else
+ {
+ return a.equals( b );
+ }
+ }
+}

Deleted: trunk/main/transit/core/src/main/net/dpml/lang/CategoryBeanInfo.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/CategoryBeanInfo.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/lang/CategoryBeanInfo.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,71 +0,0 @@
-/*
- * 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.lang;
-
-import java.beans.Expression;
-import java.beans.BeanDescriptor;
-import java.beans.DefaultPersistenceDelegate;
-import java.beans.SimpleBeanInfo;
-import java.beans.Encoder;
-
-/**
- * Bean info for state encoding of the Lifestyle policy enumeration.
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public final class CategoryBeanInfo extends SimpleBeanInfo
-{
- private static final BeanDescriptor BEAN_DESCRIPTOR =
setupBeanDescriptor();
-
- /**
- * Creation of a bean descriptor.
- * @return the bean descriptor
- */
- public BeanDescriptor getBeanDescriptor()
- {
- return BEAN_DESCRIPTOR;
- }
-
- private static BeanDescriptor setupBeanDescriptor()
- {
- BeanDescriptor descriptor = new BeanDescriptor( Category.class );
- descriptor.setValue(
- "persistenceDelegate",
- new ScopePersistenceDelegate() );
- return descriptor;
- }
-
- /**
- * Persistence delegate.
- */
- private static class ScopePersistenceDelegate extends
DefaultPersistenceDelegate
- {
- /**
- * Instantiate an expression.
- * @param old the old value
- * @param encoder the encoder
- * @return the expression
- */
- public Expression instantiate( Object old, Encoder encoder )
- {
- Category category = (Category) old;
- return new Expression( category, Category.class, "parse", new
Object[]{category.getName()} );
- }
- }
-}

Copied: trunk/main/transit/core/src/main/net/dpml/lang/Construct.java (from
rev 1183, trunk/main/transit/core/src/main/net/dpml/transit/Construct.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Construct.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,1138 @@
+/*
+ * 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.lang;
+
+import java.beans.Expression;
+import java.io.Serializable;
+import java.lang.reflect.Field;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Map;
+
+import net.dpml.part.Strategy;
+import net.dpml.part.PartDirective;
+import net.dpml.part.AbstractBuilder;
+
+import net.dpml.transit.util.PropertyResolver;
+
+/**
+ * A object resolvable from primitive arguments.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Construct implements Value, Serializable
+{
+ /**
+ * Serial version identifier.
+ */
+ static final long serialVersionUID = 1L;
+
+ /**
+ * Utility operation that consolidates an array of values and
supplimentary
+ * arguments to an array of objects.
+ *
+ * @param map a map of keys and values used in symbolic target resolution
+ * @param params the value array
+ * @param args supplimentary arguments
+ * @return the consolidated argument array
+ * @exception Exception if an error occurs in argument resolution
+ */
+ public static Object[] getArgs( Map map, Value[] params, Object[] args )
throws Exception
+ {
+ ArrayList list = new ArrayList();
+ for( int i=0; i < params.length; i++ )
+ {
+ Value value = params[i];
+ Object object = value.resolve( map );
+ if( null != object )
+ {
+ list.add( object );
+ }
+ }
+ for( int i=0; i < args.length; i++ )
+ {
+ Object value = args[i];
+ if( null != value )
+ {
+ list.add( value );
+ }
+ }
+ return list.toArray();
+ }
+
+ private final String m_method;
+ private final String m_target;
+ private final String m_value;
+ private final Value[] m_args;
+ private final boolean m_compound;
+
+ /**
+ * Create a new construct using the default java.lang.String class as the
base type.
+ * @param value the construct value
+ */
+ public Construct( String value )
+ {
+ this( null, null, value );
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it resolved relative to a context map supplied by
the
+ * application resolving construct values.
+ *
+ * @param target a classname or symbolic reference
+ * @param value the construct value
+ */
+ public Construct( String target, String value )
+ {
+ this( target, null, value );
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it is resolved relative to a context map supplied
by the
+ * application resolving construct values. If the construct value is
symbolic
+ * the implementation will attempt to expand the reference relative to a
context
+ * map (if supplied) otherwise the implementation will attempt to expand
the value
+ * using system properties.
+ *
+ * @param target a classname or symbolic reference
+ * @param method the method to invoke on the target
+ * @param value the construct value
+ */
+ public Construct( String target, String method, String value )
+ {
+ m_target = target;
+ m_method = method;
+ m_value = value;
+ m_args = new Value[0];
+ m_compound = false;
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it is resolved relative to a context map supplied
by the
+ * application resolving construct values. Instance values resolved from
the
+ * supplied Value[] will be used as constructor arguments when resolving
the target.
+ *
+ * @param target the construct classname
+ * @param args an array of unresolved parameter values
+ */
+ public Construct( String target, Value[] args )
+ {
+ this( target, null, args );
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it is resolved relative to a context map supplied
by the
+ * application resolving construct values. Instance values resolved from
the
+ * supplied Value[] will be used as method arguments when resolving the
target.
+ *
+ * @param target the construct classname
+ * @param method the method to invoke on the target
+ * @param args an array of unresolved parameter values
+ */
+ public Construct( String target, String method, Value[] args )
+ {
+ if( null == args )
+ {
+ m_args = new Value[0];
+ }
+ else
+ {
+ m_args = args;
+ }
+ m_value = null;
+ m_target = target;
+ m_method = method;
+ m_compound = true;
+ }
+
+ /**
+ * Creation of a new construct using a value directive.
+ * @param directive the value directive
+ */
+ public Construct( ValueDirective directive )
+ {
+ m_value = directive.getBaseValue();
+ m_target = directive.getTargetExpression();
+ m_method = directive.getMethodName();
+ m_compound = directive.isCompound();
+ ValueDirective[] values = directive.getValueDirectives();
+ int n = values.length;
+ m_args = new Value[ n ];
+ for( int i=0; i<n; i++ )
+ {
+ ValueDirective value = values[i];
+ m_args[i] = new Construct( value );
+ }
+ }
+
+ /**
+ * Return TRUE if this construct is a compund construct else FALSE.
+ * @return TRUE if this ia a compound construct
+ */
+ public boolean isCompound()
+ {
+ return m_compound;
+ }
+
+ /**
+ * Return the method name to be applied to the target object.
+ * @return the method name
+ */
+ public String getMethodName()
+ {
+ return m_method;
+ }
+
+ /**
+ * Return the set of nested values within this value.
+ * @return the nested values array
+ */
+ public Value[] getValues()
+ {
+ return m_args;
+ }
+
+ /**
+ * Return the classname of the resolved value.
+ * @return the classname
+ */
+ public String getBaseValue()
+ {
+ return m_value;
+ }
+
+ /**
+ * Return the classname of the resolved value.
+ * @return the classname
+ */
+ public String getTargetExpression()
+ {
+ return m_target;
+ }
+
+ /**
+ * Resolve an instance from the value using the context classloader.
+ * @return the resolved instance
+ * @exception Exception if an error occurs during value resolution
+ */
+ public Object resolve() throws Exception
+ {
+ return resolve( null );
+ }
+
+ /**
+ * Resolve an instance from the value using a supplied map.
+ * @param map the context map
+ * @return the resolved instance
+ * @exception Exception if an error occurs during value resolution
+ */
+ public Object resolve( Map map ) throws Exception
+ {
+ return resolve( map, false );
+ }
+
+ /**
+ * Resolve an instance from the value using a supplied isolation policy.
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if an error occurs during value resolution
+ */
+ public Object resolve( boolean isolate ) throws Exception
+ {
+ return resolve( null, isolate );
+ }
+
+ /**
+ * Resolve an instance from the value using a supplied context map. If
any
+ * target expressions in immediate or nested values contain a symbolic
+ * expression the value will be resolved using the supplied map.
+ *
+ * @param map the context map
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ public Object resolve( Map map, boolean isolate ) throws Exception
+ {
+ return resolve( null, map, null, isolate );
+ }
+
+ /**
+ * Resolve an instance from the value using a supplied context map. If
any
+ * target expressions in immediate or nested values contain a symbolic
+ * expression the value will be resolved using the supplied map.
+ *
+ * @param classname the default classname
+ * @param map the context map
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ public Object resolve( String classname, Map map, boolean isolate )
throws Exception
+ {
+ return resolve( classname, map, null, isolate );
+ }
+
+ /**
+ * Resolve an instance from the value.
+ * @param map the context map
+ * @param classloader the classloader to use
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if an error occurs during value resolution
+ */
+ private Object resolve( String classname, Map map, ClassLoader
classloader, boolean isolate ) throws Exception
+ {
+ ClassLoader loader = resolveClassLoader( classloader );
+ Object target = getTargetObject( classname, map, loader );
+ if( isCompound() )
+ {
+ if( null == target )
+ {
+ throw new NullPointerException( "target" );
+ }
+ else
+ {
+ return resolveCompoundExpression( target, map, loader );
+ }
+ }
+ else
+ {
+ Object value = resolveBaseValue( map );
+ if( null == target )
+ {
+ return value;
+ }
+ else
+ {
+ return resolveSimpleExpression( target, map, loader );
+ }
+ }
+ }
+
+ private Object resolveBaseValue( Map map )
+ {
+ return expandSymbols( map, m_value );
+ }
+
+ private Object resolveSimpleExpression( Object target, Map map,
ClassLoader classloader ) throws Exception
+ {
+ String method = getMethodName();
+ Object value = expandSymbols( map, m_value );
+ boolean isaClass = ( target.getClass() == Class.class );
+ if( null == method )
+ {
+ if( isaClass )
+ {
+ method = "new";
+ }
+ else
+ {
+ final String error =
+ "Target expression '"
+ + m_target
+ + "' resolving to an instance of the class ["
+ + target.getClass()
+ + "] canot be resolved due to missing method declaration.";
+ throw new ValueException( error );
+ }
+ }
+ else
+ {
+ if( isaClass && ( null == value ) )
+ {
+ // check if the method name is a static field
+ Class c = (Class) target;
+ try
+ {
+ Field field = c.getField( method );
+ return field.get( c );
+ }
+ catch( NoSuchFieldException e )
+ {
+ // assume its a method
+ }
+ }
+ }
+
+ if( value == null )
+ {
+ Expression expression = new Expression( target, method, new
Object[0] );
+ try
+ {
+ return expression.getValue();
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Internal error while evalating simple expression using:"
+ + "\n target: "
+ + m_target
+ + " ("
+ + target
+ + ")"
+ + "\n method: "
+ + m_method
+ + " ("
+ + method
+ + ")";
+ throw new ValueException( error, e );
+ }
+ }
+ else
+ {
+ Expression expression = new Expression( target, method, new
Object[]{value} );
+ try
+ {
+ return expression.getValue();
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Internal error while evaluating expression using:"
+ + "\n target: " + m_target + " (" + target + ")"
+ + "\n method: " + m_method + " (" + method + ")"
+ + "\n value: " + m_value + " (" +
value.getClass().getName() + ")";
+ throw new ValueException( error, e );
+ }
+ }
+ }
+
+ private Object resolveCompoundExpression( Object target, Map map,
ClassLoader classloader ) throws Exception
+ {
+ Value[] args = getValues();
+ Object[] instances = getInstanceValues( map, classloader, args );
+ String method = getMethodName();
+ boolean isaClass = ( target.getClass() == Class.class );
+
+ //
+ // check if we are dealing with an array class and if so return and
+ // array created from the array of nested values
+ //
+
+ if( isaClass )
+ {
+ Class c = (Class) target;
+ if( c.isArray() )
+ {
+ Class type = c.getComponentType();
+ if( type.isPrimitive() )
+ {
+ return buildPrimitiveArray( type, instances );
+ }
+ else
+ {
+ Object[] result =
+ (Object[]) Array.newInstance( type, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( type.isAssignableFrom( instance.getClass() ) )
+ {
+ result[i] = instances[i];
+ }
+ else
+ {
+ final String error =
+ "Array ["
+ + type.getName()
+ + "] contains an invalid element ["
+ + instance.getClass().getName()
+ + "].";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+ }
+ }
+
+ // otherwise its a regular expression
+
+ if( null == method )
+ {
+ if( isaClass )
+ {
+ method = "new";
+ }
+ else
+ {
+ final String error =
+ "Missing method declaration in a composite value
construct."
+ + "\nTarget: "
+ + target
+ + " (" + target.getClass().getName()
+ + ")";
+ throw new ValueException( error );
+ }
+ }
+ else
+ {
+ if( isaClass && ( instances.length == 0 ) )
+ {
+ // check if the method name is a static field
+ Class c = (Class) target;
+ try
+ {
+ Field field = c.getField( method );
+ return field.get( c );
+ }
+ catch( NoSuchFieldException e )
+ {
+ // assume its a method
+ }
+ }
+ }
+ Expression expression = new Expression( target, method, instances );
+ try
+ {
+ return expression.getValue();
+ }
+ catch( Throwable e )
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append( "Internal error while evaluating compound
expression." );
+ buffer.append( "\n target: " + m_target + " (" + target + ")" );
+ buffer.append( "\n method: " + m_method + " (" + method + ")" );
+ for( int i=0; i<instances.length; i++ )
+ {
+ buffer.append(
+ "\n param "
+ + ( i+1 )
+ + ": "
+ + instances[i].getClass().getName()
+ );
+ }
+ String error = buffer.toString();
+ throw new ValueException( error, e );
+ }
+ }
+
+ private Object buildPrimitiveArray( Class type, Object[] instances )
throws ValueException
+ {
+ Object result = Array.newInstance( type, instances.length );
+ if( Integer.TYPE == type )
+ {
+ return buildIntArray( instances );
+ }
+ else if( Short.TYPE == type )
+ {
+ return buildShortArray( instances );
+ }
+ else if( Long.TYPE == type )
+ {
+ return buildLongArray( instances );
+ }
+ else if( Byte.TYPE == type )
+ {
+ return buildByteArray( instances );
+ }
+ else if( Double.TYPE == type )
+ {
+ return buildDoubleArray( instances );
+ }
+ else if( Float.TYPE == type )
+ {
+ return buildFloatArray( instances );
+ }
+ else if( Character.TYPE == type )
+ {
+ return buildCharacterArray( instances );
+ }
+ else if( Boolean.TYPE == type )
+ {
+ return buildBooleanArray( instances );
+ }
+ else
+ {
+ final String error =
+ "Primitive array class ["
+ + type.getName()
+ + "] is not recognized.";
+ throw new UnsupportedOperationException( error );
+ }
+ }
+
+ private Object buildIntArray( Object[] instances ) throws ValueException
+ {
+ Object result = Array.newInstance( Integer.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Integer )
+ {
+ Integer integer = (Integer) instance;
+ int v = integer.intValue();
+ Array.setInt( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied int array argument class ["
+ + instance.getClass().getName()
+ + "] is not an Integer.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildShortArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Short.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Short )
+ {
+ Short primitive = (Short) instance;
+ short v = primitive.shortValue();
+ Array.setShort( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied short array argument class ["
+ + instance.getClass().getName()
+ + "] is not an Short.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildLongArray( Object[] instances ) throws ValueException
+ {
+ Object result = Array.newInstance( Long.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Long )
+ {
+ Long primitive = (Long) instance;
+ long v = primitive.longValue();
+ Array.setLong( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied long array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Long.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildByteArray( Object[] instances ) throws ValueException
+ {
+ Object result = Array.newInstance( Byte.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Byte )
+ {
+ Byte primitive = (Byte) instance;
+ byte v = primitive.byteValue();
+ Array.setByte( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied byte array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Byte.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildDoubleArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Double.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Double )
+ {
+ Double primitive = (Double) instance;
+ double v = primitive.doubleValue();
+ Array.setDouble( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied double array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Double.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildFloatArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Float.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Float )
+ {
+ Float primitive = (Float) instance;
+ float v = primitive.floatValue();
+ Array.setFloat( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied float array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Float.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildCharacterArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Character.TYPE, instances.length
);
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Character )
+ {
+ Character primitive = (Character) instance;
+ char v = primitive.charValue();
+ Array.setChar( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied char array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Character.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object buildBooleanArray( Object[] instances ) throws
ValueException
+ {
+ Object result = Array.newInstance( Boolean.TYPE, instances.length );
+ for( int i=0; i<instances.length; i++ )
+ {
+ Object instance = instances[i];
+ if( instance instanceof Boolean )
+ {
+ Boolean primitive = (Boolean) instance;
+ boolean v = primitive.booleanValue();
+ Array.setBoolean( result, i, v );
+ }
+ else
+ {
+ final String error =
+ "Supplied boolean array argument class ["
+ + instance.getClass().getName()
+ + "] is not an instance of Boolean.";
+ throw new ValueException( error );
+ }
+ }
+ return result;
+ }
+
+ private Object[] getInstanceValues(
+ Map map, ClassLoader classloader, Value[] args ) throws Exception
+ {
+ Object[] instances = new Object[ args.length ];
+ for( int i=0; i < args.length; i++ )
+ {
+ Value value = args[i];
+ if( value instanceof Construct )
+ {
+ Construct construct = (Construct) value;
+ instances[i] = construct.resolve( null, map, classloader,
false );
+ }
+ else
+ {
+ instances[i] = value.resolve( map );
+ }
+ }
+ return instances;
+ }
+
+ private Object expandSymbols( Map map, String value )
+ {
+ if( null == value )
+ {
+ return null;
+ }
+ else
+ {
+ return parseSymbolicValue( map, value );
+ }
+ }
+
+ private Object parseSymbolicValue( Map map, String value )
+ {
+ if( null == map )
+ {
+ return PropertyResolver.resolve( value );
+ }
+ if( value.startsWith( "${" ) && value.endsWith( "}" ) )
+ {
+ String pre = value.substring( 2 );
+ String key = pre.substring( 0, pre.length() -1 );
+ if( map.containsKey( key ) )
+ {
+ return map.get( key );
+ }
+ else
+ {
+ return PropertyResolver.resolve( value );
+ }
+ }
+ else
+ {
+ return PropertyResolver.resolve( value );
+ }
+ }
+
+ /**
+ * Return the instance class using the context classloader.
+ * @return the target object or class
+ * @exception ValueException if target related error occurs
+ */
+ private Object getTargetObject( String classname, Map map, ClassLoader
loader ) throws ValueException
+ {
+ if( null == m_target )
+ {
+ return getTargetObject( map, loader, classname );
+ }
+ else
+ {
+ return getTargetObject( map, loader, m_target );
+ }
+ }
+
+ /**
+ * Return the instance class using the context classloader.
+ * @return the target object or class
+ * @exception ValueException if target related error occurs
+ */
+ private Object getTargetObject( Map map, ClassLoader loader, String
target ) throws ValueException
+ {
+ if( null == target )
+ {
+ return null;
+ }
+ else if( target.startsWith( "${" ) )
+ {
+ if( null != map )
+ {
+ String pre = target.substring( 2 );
+ String key = pre.substring( 0, pre.length() -1 );
+ if( map.containsKey( key ) )
+ {
+ return map.get( key );
+ }
+ else
+ {
+ final String error =
+ "Unresolvable target symbolic expression ["
+ + target
+ + "].";
+ throw new ValueException( error );
+ }
+ }
+ else
+ {
+ String resolved = PropertyResolver.resolve( target );
+ return getTargetObject( map, loader, resolved );
+ }
+ }
+ else
+ {
+ if( target.endsWith( "[]" ) )
+ {
+ int n = target.length() - 2;
+ String componentClassname = target.substring( 0, n );
+ Class componentClass = resolveType( loader,
componentClassname );
+ return Array.newInstance( componentClass, 0 ).getClass();
+ }
+ else
+ {
+ return resolveClass( loader, target );
+ }
+ }
+ }
+
+ /**
+ * Return the instance class using the context classloader.
+ * @return the class
+ * @exception ComponentException if the parameter class cannot be
resolved
+ */
+ private Class resolveClass( ClassLoader loader, String classname )
throws ValueException
+ {
+ try
+ {
+ return loader.loadClass( classname );
+ }
+ catch( final ClassNotFoundException e )
+ {
+ if( classname.equals( "int" ) )
+ {
+ return Integer.class;
+ }
+ else if( classname.equals( "short" ) )
+ {
+ return Short.class;
+ }
+ else if( classname.equals( "long" ) )
+ {
+ return Long.class;
+ }
+ else if( classname.equals( "byte" ) )
+ {
+ return Byte.class;
+ }
+ else if( classname.equals( "double" ) )
+ {
+ return Double.class;
+ }
+ else if( classname.equals( "float" ) )
+ {
+ return Float.class;
+ }
+ else if( classname.equals( "char" ) )
+ {
+ return Character.class;
+ }
+ else if( classname.equals( "boolean" ) )
+ {
+ return Boolean.class;
+ }
+ else
+ {
+ final String error =
+ "Class not found ["
+ + classname
+ + "].";
+ throw new ValueException( error, e );
+ }
+ }
+ }
+
+ /**
+ * Return the instance class using the context classloader.
+ * @return the class
+ * @exception ComponentException if the parameter class cannot be
resolved
+ */
+ private Class resolveType( ClassLoader loader, String classname ) throws
ValueException
+ {
+ try
+ {
+ return loader.loadClass( classname );
+ }
+ catch( final ClassNotFoundException e )
+ {
+ if( classname.equals( "int" ) )
+ {
+ return Integer.TYPE;
+ }
+ else if( classname.equals( "short" ) )
+ {
+ return Short.TYPE;
+ }
+ else if( classname.equals( "long" ) )
+ {
+ return Long.TYPE;
+ }
+ else if( classname.equals( "byte" ) )
+ {
+ return Byte.TYPE;
+ }
+ else if( classname.equals( "double" ) )
+ {
+ return Double.TYPE;
+ }
+ else if( classname.equals( "float" ) )
+ {
+ return Float.TYPE;
+ }
+ else if( classname.equals( "char" ) )
+ {
+ return Character.TYPE;
+ }
+ else if( classname.equals( "boolean" ) )
+ {
+ return Boolean.TYPE;
+ }
+ else
+ {
+ final String error =
+ "Class not found ["
+ + classname
+ + "].";
+ throw new ValueException( error, e );
+ }
+ }
+ }
+
+ private ClassLoader resolveClassLoader( ClassLoader classloader )
+ {
+ if( null != classloader )
+ {
+ return classloader;
+ }
+ else
+ {
+ ClassLoader loader =
Thread.currentThread().getContextClassLoader();
+ if( null == loader )
+ {
+ return Construct.class.getClassLoader();
+ }
+ else
+ {
+ return loader;
+ }
+ }
+ }
+
+ /**
+ * Return a string representation of the construct.
+ * @return the string value
+ */
+ public String toString()
+ {
+ if( !m_compound )
+ {
+ return "construct "
+ + " target: " + m_target
+ + " method: " + m_method
+ + " value: " + m_value;
+ }
+ else
+ {
+ return "construct "
+ + " target: " + m_target
+ + " method: " + m_method
+ + " values: " + m_args.length;
+ }
+ }
+
+ /**
+ * Compare this instance with a supplied object for equality.
+ * @param other the other object
+ * @return true if the supplied instance is equal to this instance
+ */
+ public boolean equals( Object other )
+ {
+ if( null == other )
+ {
+ return false;
+ }
+ if( other instanceof Construct )
+ {
+ Construct construct = (Construct) other;
+ if( !equals( m_target, construct.m_target ) )
+ {
+ return false;
+ }
+ if( m_compound != construct.m_compound )
+ {
+ return false;
+ }
+ if( !equals( m_method, construct.m_method ) )
+ {
+ return false;
+ }
+ if( m_compound )
+ {
+ return Arrays.equals( m_args, construct.m_args );
+ }
+ else
+ {
+ return equals( m_value, construct.m_value );
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the instance hashcode value.
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ int hash = 0;
+ if( null != m_target )
+ {
+ hash ^= m_target.hashCode();
+ }
+ if( null != m_method )
+ {
+ hash ^= m_method.hashCode();
+ }
+ if( m_compound )
+ {
+ for( int i=0; i<m_args.length; i++ )
+ {
+ hash ^= m_args[i].hashCode();
+ }
+ }
+ else
+ {
+ if( m_value != null )
+ {
+ hash ^= m_value.hashCode();
+ }
+ }
+ return hash;
+ }
+
+ private boolean equals( Object a, Object b )
+ {
+ if( null == a )
+ {
+ return ( null == b );
+ }
+ else
+ {
+ return a.equals( b );
+ }
+ }
+}

Deleted: trunk/main/transit/core/src/main/net/dpml/lang/DTD.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/DTD.java 2006-03-15
19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/lang/DTD.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -1,78 +0,0 @@
-/*
- * Copyright 2006 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.lang;
-
-import java.net.URI;
-
-/**
- * DTD reference.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class DTD
-{
- /**
- * Public identifier.
- */
- private final String m_public;
-
- /**
- * The system identifier.
- */
- private final String m_system;
-
- /**
- * Local resource.
- */
- private final String m_resource;
-
- /**
- * Factory uri.
- */
- private final URI m_factory;
-
- public DTD( final String publicId, final String systemId, final String
resource, URI factory )
- {
- m_public = publicId;
- m_system = systemId;
- m_resource = resource;
- m_factory = factory;
- }
-
- public String getPublicId()
- {
- return m_public;
- }
-
- public String getSystemId()
- {
- return m_system;
- }
-
- public String getResource()
- {
- return m_resource;
- }
-
- public URI getFactory()
- {
- return m_factory;
- }
-}

Deleted: trunk/main/transit/core/src/main/net/dpml/lang/DTDResolver.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/DTDResolver.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/lang/DTDResolver.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,104 +0,0 @@
-/*
- * Copyright 2004-2006 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.lang;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * A Class to help to resolve Entitys for items such as DTDs or
- * Schemas.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class DTDResolver implements EntityResolver
-{
- /**
- * The list of DTDs that can be resolved by this class.
- */
- private final DTD[] m_dtds;
-
- /**
- * The ClassLoader to use when loading resources for DTDs.
- */
- private final ClassLoader m_classLoader;
-
- /**
- * Construct a resolver using specified DTDInfos where resources are
loaded
- * from specified ClassLoader.
- */
- public DTDResolver( final DTD[] dtds, final ClassLoader classLoader )
- {
- m_dtds = dtds;
- m_classLoader = classLoader;
- }
-
- /**
- * Resolve an entity in the XML file.
- * Called by parser to resolve DTDs.
- */
- public InputSource resolveEntity( final String publicId, final String
systemId )
- throws IOException, SAXException
- {
- for( int i=0; i<m_dtds.length; i++ )
- {
- final DTD info = m_dtds[i];
-
- if( ( publicId != null && publicId.equals( info.getPublicId() )
)
- || ( systemId != null && systemId.equals( info.getSystemId()
) ) )
- {
- final ClassLoader classLoader = getClassLoader();
- final InputStream inputStream =
- classLoader.getResourceAsStream( info.getResource() );
- if( null == inputStream )
- {
- String path = "resource:" + info.getResource();
- throw new NullPointerException( path );
- }
- return new InputSource( inputStream );
- }
- }
- return null;
- }
-
- /**
- * Return CLassLoader to load resource from.
- * If a ClassLoader is specified in the constructor use that,
- * else use ContextClassLoader unless that is null in which case
- * use the current classes ClassLoader.
- */
- private ClassLoader getClassLoader()
- {
- ClassLoader classLoader = m_classLoader;
- if( null == classLoader )
- {
- classLoader = Thread.currentThread().getContextClassLoader();
- }
- if( null == classLoader )
- {
- classLoader = getClass().getClassLoader();
- }
- return classLoader;
- }
-}

Copied: trunk/main/transit/core/src/main/net/dpml/lang/Logger.java (from rev
1183, trunk/main/transit/core/src/main/net/dpml/transit/Logger.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Logger.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Logger.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2004-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.lang;
+
+/**
+ * Transit Logger is a interface through which different logging solutions
+ * can be provided.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Logger
+{
+ /**
+ * Return TRUE is debug level logging is enabled.
+ * @return the enabled state of debug logging
+ */
+ boolean isDebugEnabled();
+
+ /**
+ * Return TRUE is info level logging is enabled.
+ * @return the enabled state of info logging
+ */
+ boolean isInfoEnabled();
+
+ /**
+ * Return TRUE is warn level logging is enabled.
+ * @return the enabled state of warn level logging
+ */
+ boolean isWarnEnabled();
+
+ /**
+ * Return TRUE is error level logging is enabled.
+ * @return the enabled state of error logging
+ */
+ boolean isErrorEnabled();
+
+ /**
+ * Record a debug level message.
+ * @param message the debug message to record
+ */
+ void debug( String message );
+
+ /**
+ * Record a informative message.
+ * @param message the info message to record
+ */
+ void info( String message );
+
+ /**
+ * Record a warning message.
+ * @param message the warning message to record
+ */
+ 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
+ */
+ void error( String message );
+
+ /**
+ * Record a error level message.
+ * @param message the error message to record
+ * @param cause the causal exception
+ */
+ 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 );
+}
+
+

Copied: trunk/main/transit/core/src/main/net/dpml/lang/LoggingService.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/transit/LoggingService.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/LoggingService.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/LoggingService.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,45 @@
+/*
+ * 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.lang;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.util.logging.LogRecord;
+
+/**
+ * Interface exposed by a remote logging service to local log aggregation
handlers.
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface LoggingService extends Remote
+{
+ /**
+ * Logging service key.
+ */
+ String LOGGING_KEY = "/dpml/logging";
+
+ /**
+ * Register a log record with the log service.
+ * @param process the process identifier
+ * @param record the log record
+ * @exception RemoteException if a remote exception occurs
+ */
+ void log( PID process, LogRecord record ) throws RemoteException;
+}
+

Copied: trunk/main/transit/core/src/main/net/dpml/lang/PID.java (from rev
1183, trunk/main/transit/core/src/main/net/dpml/transit/PID.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/PID.java 2006-03-14
19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/PID.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -0,0 +1,117 @@
+/*
+ * 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.lang;
+
+import java.io.Serializable;
+
+import java.util.Random;
+
+/**
+ * The PID class is a process identifer.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class PID implements Serializable
+{
+ private final int m_id;
+
+ /**
+ * Creation of a new process identifier.
+ */
+ public PID()
+ {
+ m_id = setupInitialValue();
+ }
+
+ /**
+ * Creation of a new process identifier.
+ * @param pid the process identity
+ */
+ public PID( int pid )
+ {
+ m_id = pid;
+ }
+
+ private static int setupInitialValue()
+ {
+ String id = System.getProperty( "process.id" );
+ if( null == id )
+ {
+ return Math.abs( new Random().nextInt() );
+ }
+ else
+ {
+ try
+ {
+ return Integer.parseInt( id );
+ }
+ catch( NumberFormatException e )
+ {
+ return Math.abs( new Random().nextInt() );
+ }
+ }
+ }
+
+ /**
+ * Return the process identifier int value.
+ * @return the process id value
+ */
+ public int getValue()
+ {
+ return m_id;
+ }
+
+ /**
+ * Return the string representation of this process identifier.
+ * @return the process identifier as a string
+ */
+ public String toString()
+ {
+ return "[" + m_id + "]";
+ }
+
+ /**
+ * Test if a supplied object is equal to this process identifier.
+ * @param other the object to compare with this object
+ * @return TRUE if the objects are equivalent
+ */
+ public boolean equals( Object other )
+ {
+ if( other instanceof PID )
+ {
+ PID pid = (PID) other;
+ return getValue() == pid.getValue();
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Return the hashcode for this PID instance.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ return getValue();
+ }
+}
+

Deleted: trunk/main/transit/core/src/main/net/dpml/lang/SaxMonitor.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/SaxMonitor.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/lang/SaxMonitor.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,73 +0,0 @@
-/*
- * Copyright 2006 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.lang;
-
-import java.net.URL;
-
-import net.dpml.transit.Logger;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * Utility class supporting the reading and writing of standard plugins
definitions.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public final class SaxMonitor implements ErrorHandler
-{
- private Logger m_logger;
-
- public SaxMonitor( Logger logger )
- {
- if( null == logger )
- {
- throw new NullPointerException( "logger" );
- }
- m_logger = logger;
- }
-
- public void error( SAXParseException e ) throws SAXException
- {
- final String message = getMessage( e );
- m_logger.warn( message );
- }
-
- public void fatalError( SAXParseException e ) throws SAXException
- {
- final String message = getMessage( e );
- m_logger.error( message );
- }
-
- public void warning( SAXParseException e ) throws SAXException
- {
- final String message = getMessage( e );
- m_logger.warn( message );
- }
-
- private String getMessage( SAXParseException e )
- {
- return e.getMessage()
- + "(" + e.getLineNumber()
- + "," + e.getColumnNumber()
- + ")";
- }
-}

Copied: trunk/main/transit/core/src/main/net/dpml/lang/Value.java (from rev
1183, trunk/main/transit/core/src/main/net/dpml/transit/Value.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Value.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Value.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -0,0 +1,83 @@
+/*
+ * 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.lang;
+
+import java.util.Map;
+
+/**
+ * A object resolvable from primitive and symbolic arguments.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Value
+{
+ /**
+ * Resolve an instance from the value using the context classloader.
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ Object resolve() throws Exception;
+
+ /**
+ * Resolve an instance from the value using a supplied context map. If
any
+ * target expressions in immediate or nested values contain a symbolic
+ * expression the value will be resolved using the supplied map.
+ *
+ * @param map the context map
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ Object resolve( Map map ) throws Exception;
+
+ /**
+ * Resolve an instance from the value using a supplied isolation policy.
+ *
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ Object resolve( boolean isolate ) throws Exception;
+
+ /**
+ * Resolve an instance from the value using a supplied context map. If
any
+ * target expressions in immediate or nested values contain a symbolic
+ * expression the value will be resolved using the supplied map.
+ *
+ * @param map the context map
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ Object resolve( Map map, boolean isolate ) throws Exception;
+
+ /**
+ * Resolve an instance from the value using a supplied context map. If
any
+ * target expressions in immediate or nested values contain a symbolic
+ * expression the value will be resolved using the supplied map.
+ *
+ * @param classname the default classname
+ * @param map the context map
+ * @param isolate the isolation policy
+ * @return the resolved instance
+ * @exception Exception if error occurs during instance resolution
+ */
+ Object resolve( String classname, Map map, boolean isolate ) throws
Exception;
+
+}

Copied: trunk/main/transit/core/src/main/net/dpml/lang/ValueDirective.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/transit/info/ValueDirective.java)
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/ValueDirective.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/ValueDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,241 @@
+/*
+ * 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.lang;
+
+import java.util.Arrays;
+
+/**
+ * A object resolvable from primitive arguments.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class ValueDirective extends AbstractDirective
+{
+ private final String m_method;
+ private final String m_target;
+ private final String m_value;
+ private final ValueDirective[] m_args;
+ private final boolean m_compound;
+
+ /**
+ * Create a new value descriptor using the default java.lang.String class
as the base type.
+ * @param value the construct value
+ */
+ public ValueDirective( String value )
+ {
+ this( null, null, value );
+ }
+
+ /**
+ * Create a new construct using a supplied target definition. The target
argument
+ * may be either a classname or a symbolic object reference in the form
${[key]}.
+ *
+ * @param target a classname or symbolic object reference
+ * @param value the construct value
+ */
+ public ValueDirective( String target, String value )
+ {
+ this( target, null, value );
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it is resolved relative to a context map supplied
by the
+ * application resolving construct values. If the construct value is
symbolic
+ * the implementation will attempt to expand the reference relative to a
context
+ * map (if supplied) otherwise the implementation will attempt to expand
the value
+ * using system properties.
+ *
+ * @param target a classname or symbolic reference
+ * @param method the method to invoke on the target
+ * @param value the construct value
+ */
+ public ValueDirective( String target, String method, String value )
+ {
+ super();
+ m_target = target;
+ m_method = method;
+ m_value = value;
+ m_args = new ValueDirective[0];
+ m_compound = false;
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it is resolved relative to a context map supplied
by the
+ * application resolving construct values. Instance values resolved from
the
+ * supplied Value[] will be used as constructor arguments when resolving
the target.
+ *
+ * @param target the construct classname
+ * @param args an array of unresolved parameter values
+ */
+ public ValueDirective( String target, ValueDirective[] args )
+ {
+ this( target, null, args );
+ }
+
+ /**
+ * Create a new construct using a supplied target defintion. The target
argument
+ * may be either a classname or a symbolic reference in the form
${[key]}. If the
+ * argument is symbolic it is resolved relative to a context map supplied
by the
+ * application resolving construct values. Instance values resolved from
the
+ * supplied Value[] will be used as method arguments when resolving the
target.
+ *
+ * @param target the construct classname
+ * @param method the method to invoke on the target
+ * @param args an array of unresolved parameter values
+ */
+ public ValueDirective( String target, String method, ValueDirective[]
args )
+ {
+ super();
+ if( null == args )
+ {
+ m_args = new ValueDirective[0];
+ }
+ else
+ {
+ m_args = args;
+ }
+ m_value = null;
+ m_target = target;
+ m_method = method;
+ m_compound = true;
+ }
+
+ /**
+ * Return TRUE if this construct is a compund construct else FALSE.
+ * @return TRUE if this ia a compound construct
+ */
+ public boolean isCompound()
+ {
+ return m_compound;
+ }
+
+ /**
+ * Return the method name to be applied to the target object.
+ * @return the method name
+ */
+ public String getMethodName()
+ {
+ return m_method;
+ }
+
+ /**
+ * Return the set of nested values within this value.
+ * @return the nested values array
+ */
+ public ValueDirective[] getValueDirectives()
+ {
+ return m_args;
+ }
+
+ /**
+ * Return the base value of the resolved value.
+ * @return the base value
+ */
+ public String getBaseValue()
+ {
+ return m_value;
+ }
+
+ /**
+ * Return the classname of the resolved value.
+ * @return the classname
+ */
+ public String getTargetExpression()
+ {
+ return m_target;
+ }
+
+ /**
+ * Return a string representation of the construct.
+ * @return the string value
+ */
+ public String toString()
+ {
+ if( !m_compound )
+ {
+ return "value "
+ + " target: " + m_target
+ + " method: " + m_method
+ + " value: " + m_value;
+ }
+ else
+ {
+ return "value "
+ + " target: " + m_target
+ + " method: " + m_method
+ + " values: " + m_args.length;
+ }
+ }
+
+ /**
+ * Compare this instance with a supplied object for equality.
+ * @param other the other object
+ * @return true if the supplied instance is equal to this instance
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof ValueDirective ) )
+ {
+ ValueDirective construct = (ValueDirective) other;
+ if( !equals( m_target, construct.m_target ) )
+ {
+ return false;
+ }
+ if( m_compound != construct.m_compound )
+ {
+ return false;
+ }
+ if( !equals( m_method, construct.m_method ) )
+ {
+ return false;
+ }
+ if( m_compound )
+ {
+ return Arrays.equals( m_args, construct.m_args );
+ }
+ else
+ {
+ return equals( m_value, construct.m_value );
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the instance hashcode value.
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ int hash = 0;
+ hash ^= hashValue( m_target );
+ hash ^= hashValue( m_method );
+ hash ^= hashArray( m_args );
+ hash ^= hashValue( m_value );
+ return hash;
+ }
+}

Copied: trunk/main/transit/core/src/main/net/dpml/lang/ValueException.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/transit/ValueException.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/ValueException.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/ValueException.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,55 @@
+/*
+ * 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.lang;
+
+/**
+ * Exception to indicate an error arrising from a value type.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class ValueException extends Exception
+{
+ /**
+ * Serial version identifier.
+ */
+ static final long serialVersionUID = 1L;
+
+ /**
+ * Construct a new <code>ValueException</code> instance.
+ *
+ * @param message the exception message
+ */
+ public ValueException( final String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Construct a new <code>ValueException</code> instance.
+ *
+ * @param message the exception message
+ * @param cause the causal exception
+ */
+ public ValueException( final String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
+

Copied:
trunk/main/transit/core/src/main/net/dpml/lang/ValueRuntimeException.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/transit/ValueRuntimeException.java)
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/ValueRuntimeException.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/lang/ValueRuntimeException.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,55 @@
+/*
+ * 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.lang;
+
+/**
+ * Exception to indicate an error arrising from a value type.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class ValueRuntimeException extends RuntimeException
+{
+ /**
+ * Serial version identifier.
+ */
+ static final long serialVersionUID = 1L;
+
+ /**
+ * Construct a new <code>ValueRuntimeException</code> instance.
+ *
+ * @param message the exception message
+ */
+ public ValueRuntimeException( final String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Construct a new <code>ValueRuntimeException</code> instance.
+ *
+ * @param message the exception message
+ * @param cause the causal exception
+ */
+ public ValueRuntimeException( final String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
+

Modified: trunk/main/transit/core/src/main/net/dpml/part/AbstractBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/AbstractBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/AbstractBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -61,7 +61,7 @@

static final URI LOCAL_URI = createURI( "local:dpml" );

- private final Map m_map; // maps namespace uris to a builders
+ private final Map m_map; // maps namespace uris to builders

public AbstractBuilder( Map map )
{
@@ -133,7 +133,7 @@
{
if( StrategyBuilder.class.isAssignableFrom( clazz ) )
{
- return new PartStrategyBuilder(m_map );
+ return new PartStrategyBuilder( m_map );
}
else
{
@@ -143,12 +143,12 @@
throw new IllegalArgumentException( error );
}
}
- ClassLoader classloader = getClassLoader();
+ ClassLoader classloader = getClassLoader();
Repository repository = Transit.getInstance().getRepository();
- Object handler = repository.getPlugin( classloader, uri, new
Object[0] );
- if( clazz.isAssignableFrom( handler.getClass() ) )
+ Object object = repository.getPlugin( classloader, uri, new
Object[0] );
+ if( clazz.isAssignableFrom( object.getClass() ) )
{
- return handler;
+ return object;
}
else
{
@@ -188,43 +188,6 @@
"Unable to resolve part builder."
+ "\nNamespace: " + namespace;
throw new BuilderException( element, error );
- /*
- try
- {
- URI uri = new URI( namespace );
- if( Artifact.isRecognized( uri ) )
- {
- Artifact artifact = Artifact.createArtifact( uri );
- String group = artifact.getGroup();
- String artifactName = artifact.getName();
- String spec = group + "/" + artifactName;
- if( m_map.containsKey( spec ) )
- {
- return (URI) m_map.get( spec );
- }
- else
- {
- return getBuilderFromNamespaceURI( namespace );
- }
- }
- else
- {
- final String error =
- "Namespace format is not a recognized artifact ["
- + namespace
- + "].";
- throw new IllegalArgumentException( error );
- }
- }
- catch( URISyntaxException e )
- {
- final String error =
- "Namespace format is not recognized ["
- + namespace
- + "].";
- throw new BuilderException( element, error );
- }
- */
}
}
}
@@ -255,42 +218,6 @@
throw new UnsupportedOperationException( error );
}
}
-
- /*
- public String getID()
- {
- Object delegate = getDelegate();
- if( delegate instanceof TypeBuilder )
- {
- TypeBuilder builder = (TypeBuilder) delegate;
- return builder.getID();
- }
- else
- {
- final String error =
- "Builder delegate does not implement type builder
operations."
- + "\nURI: " + m_uri;
- throw new UnsupportedOperationException( error );
- }
- }
-
- public Type buildType( ClassLoader classloader, Element element )
throws Exception
- {
- Object delegate = getDelegate();
- if( delegate instanceof TypeBuilder )
- {
- TypeBuilder builder = (TypeBuilder) delegate;
- return builder.buildType( classloader, element );
- }
- else
- {
- final String error =
- "Builder delegate does not implement type builder
operations."
- + "\nURI: " + m_uri;
- throw new UnsupportedOperationException( error );
- }
- }
- */

private Object getDelegate()
{
@@ -356,35 +283,6 @@
String path = "link:part:" + group + "/" + name;
Artifact link = Artifact.createArtifact( path );
return link.toURI();
-
- /*
- try
- {
- String path = "link:part:" + group + "/" + name;
- Artifact link = Artifact.createArtifact( path );
- URL linkUrl = link.toURL();
- linkUrl.getContent( new Class[]{File.class} ); // test for
existance
- return link.toURI();
- }
- catch( ArtifactNotFoundException e )
- {
- Artifact result = Artifact.createArtifact( group, name, version,
"part" );
- try
- {
- URL url = result.toURL();
- url.getContent( new Class[]{File.class} );
- return result.toURI();
- }
- catch( ArtifactNotFoundException anfe )
- {
- final String error =
- "Unable to locate a builder for the urn ["
- + urn
- + "].";
- throw new UnresolvableHandlerException( error,
result.toURI() );
- }
- }
- */
}

private static URI createURI( String spec )

Modified:
trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/DOM3DocumentBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -41,7 +41,7 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;
import net.dpml.transit.Artifact;
import net.dpml.transit.util.ExceptionHelper;


Deleted:
trunk/main/transit/core/src/main/net/dpml/part/DOMDocumentBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/DOMDocumentBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/DOMDocumentBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,190 +0,0 @@
-/*
- * Copyright 2006 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.part;
-
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-
-import javax.xml.validation.Validator;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import net.dpml.transit.Logger;
-import net.dpml.transit.Artifact;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-
-import org.w3c.dom.Document;
-
-public class DOMDocumentBuilder
-{
- private static final String FEATURE_SECURE_PROCESSING =
- "http://javax.xml.XMLConstants/feature/secure-processing";;
-
- private static final String W3C_XML_SCHEMA_NS_URI =
- "http://www.w3.org/2001/XMLSchema";;
-
- //
- // implementation
- //
-
- public Document parse( String source ) throws Exception
- {
- DocumentBuilder db = getDocumentBuilder();
- return db.parse( source );
- }
-
- public Document parse( URI uri ) throws Exception
- {
- DocumentBuilder db = getDocumentBuilder();
- return db.parse( uri.toASCIIString() );
- }
-
- private DocumentBuilder getDocumentBuilder() throws Exception
- {
- DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware( true );
- setupBuilderForSchemaValidation( factory );
- DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setErrorHandler( new InternalErrorHandler() );
- return builder;
- }
-
- private void setupBuilderForSchemaValidation( DocumentBuilderFactory dbf
)
- {
- try
- {
- SchemaFactory schemaFactory = SchemaFactory.newInstance(
W3C_XML_SCHEMA_NS_URI );
- Schema schema = schemaFactory.newSchema();
- dbf.setSchema( schema );
- }
- catch( Exception e )
- {
- final String error =
- "Unexpected error while configuring XML parser for schema
validation.";
- throw new RuntimeException( error, e );
- }
- }
-
- private URL getURL( URI uri ) throws Exception
- {
- if( Artifact.isRecognized( uri ) )
- {
- return Artifact.createArtifact( uri ).toURL();
- }
- else
- {
- return uri.toURL();
- }
- }
-
- private static final class InternalErrorHandler implements ErrorHandler
- {
- private final ArrayList m_errors = new ArrayList();
- //private Logger m_logger;
-
- public InternalErrorHandler()
- {
- //if( null == logger )
- //{
- // throw new NullPointerException( "logger" );
- //}
- //m_logger = logger;
- }
-
- public void error( SAXParseException e ) throws SAXException
- {
- final String message = getMessage( e );
- if( !m_errors.contains( message ) )
- {
- m_errors.add( message );
- System.out.println( message );
- }
- //final String message = getMessage( e );
- //m_logger.warn( message );
- //System.out.println( message );
- }
-
- public void fatalError( SAXParseException e ) throws SAXException
- {
- final String message = getMessage( e );
- if( !m_errors.contains( message ) )
- {
- m_errors.add( message );
- System.out.println( message );
- }
- //final String message = getMessage( e );
- //m_logger.error( message );
- //System.out.println( message );
- }
-
- public void warning( SAXParseException e ) throws SAXException
- {
- final String message = getMessage( e );
- if( !m_errors.contains( message ) )
- {
- m_errors.add( message );
- System.out.println( message );
- }
- //final String message = getMessage( e );
- //m_logger.warn( message );
- //System.out.println( message );
- }
-
- private String getMessage( SAXParseException e )
- {
- StringBuffer buffer = new StringBuffer();
- String systemId = e.getSystemId();
- if( systemId != null )
- {
- int index = systemId.lastIndexOf( '/' );
- if( index != -1 )
- {
- systemId = systemId.substring( index + 1 );
- }
- buffer.append( systemId );
- }
- buffer.append(':');
- buffer.append( e.getLineNumber() );
- buffer.append(':');
- buffer.append( e.getColumnNumber() );
- buffer.append(" ");
- buffer.append( e.getMessage() );
- return buffer.toString();
- }
- }
-
- private static class ParseError
- {
- }
-
-}

Modified: trunk/main/transit/core/src/main/net/dpml/part/PartDirective.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -21,7 +21,7 @@
import java.io.Serializable;
import java.net.URI;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

/**
* Immutable part creation directive.

Modified: trunk/main/transit/core/src/main/net/dpml/part/PartHandler.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartHandler.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartHandler.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -45,4 +45,5 @@
* @exception Exception if a deployment error occurs
*/
Object getInstance( ClassLoader anchor, Classpath classpath, Object
data, Object[] args ) throws Exception;
+
}

Modified:
trunk/main/transit/core/src/main/net/dpml/part/PartHandlerFactory.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartHandlerFactory.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartHandlerFactory.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -30,8 +30,8 @@

import net.dpml.transit.Transit;
import net.dpml.transit.Repository;
-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;


/**

Modified:
trunk/main/transit/core/src/main/net/dpml/part/PartStrategyBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartStrategyBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartStrategyBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -24,8 +24,8 @@
import java.net.URI;
import java.util.Map;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import net.dpml.lang.Type;

Modified:
trunk/main/transit/core/src/main/net/dpml/part/PartStrategyWriter.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/PartStrategyWriter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/PartStrategyWriter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -24,8 +24,8 @@
import java.net.URI;
import java.util.Map;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import org.w3c.dom.TypeInfo;

Modified: trunk/main/transit/core/src/main/net/dpml/part/Plugin.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/Plugin.java 2006-03-15
19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/Plugin.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -21,7 +21,7 @@
import java.io.Serializable;
import java.util.Arrays;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

public class Plugin implements Serializable
{

Modified:
trunk/main/transit/core/src/main/net/dpml/part/StandardPartHandler.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/StandardPartHandler.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/StandardPartHandler.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -26,12 +26,12 @@

import net.dpml.lang.Category;
import net.dpml.lang.Classpath;
+import net.dpml.lang.Construct;
+import net.dpml.lang.Value;

import net.dpml.transit.Artifact;
-import net.dpml.transit.Construct;
import net.dpml.transit.StandardClassLoader;
import net.dpml.transit.Transit;
-import net.dpml.transit.Value;

/**
* Construct a part.

Modified: trunk/main/transit/core/src/main/net/dpml/part/ValueBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/ValueBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/ValueBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -24,8 +24,8 @@
import java.net.URI;
import java.util.Map;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import org.w3c.dom.TypeInfo;

Modified: trunk/main/transit/core/src/main/net/dpml/part/ValueWriter.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/part/ValueWriter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/part/ValueWriter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -24,8 +24,8 @@
import java.net.URI;
import java.util.Map;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.transit.util.ElementHelper;

import org.w3c.dom.TypeInfo;

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Construct.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,1139 +0,0 @@
-/*
- * 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;
-
-import java.beans.Expression;
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Map;
-
-import net.dpml.part.Strategy;
-import net.dpml.part.PartDirective;
-import net.dpml.part.AbstractBuilder;
-
-import net.dpml.transit.info.ValueDirective;
-import net.dpml.transit.util.PropertyResolver;
-
-/**
- * A object resolvable from primitive arguments.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class Construct implements Value, Serializable
-{
- /**
- * Serial version identifier.
- */
- static final long serialVersionUID = 1L;
-
- /**
- * Utility operation that consolidates an array of values and
supplimentary
- * arguments to an array of objects.
- *
- * @param map a map of keys and values used in symbolic target resolution
- * @param params the value array
- * @param args supplimentary arguments
- * @return the consolidated argument array
- * @exception Exception if an error occurs in argument resolution
- */
- public static Object[] getArgs( Map map, Value[] params, Object[] args )
throws Exception
- {
- ArrayList list = new ArrayList();
- for( int i=0; i < params.length; i++ )
- {
- Value value = params[i];
- Object object = value.resolve( map );
- if( null != object )
- {
- list.add( object );
- }
- }
- for( int i=0; i < args.length; i++ )
- {
- Object value = args[i];
- if( null != value )
- {
- list.add( value );
- }
- }
- return list.toArray();
- }
-
- private final String m_method;
- private final String m_target;
- private final String m_value;
- private final Value[] m_args;
- private final boolean m_compound;
-
- /**
- * Create a new construct using the default java.lang.String class as the
base type.
- * @param value the construct value
- */
- public Construct( String value )
- {
- this( null, null, value );
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it resolved relative to a context map supplied by
the
- * application resolving construct values.
- *
- * @param target a classname or symbolic reference
- * @param value the construct value
- */
- public Construct( String target, String value )
- {
- this( target, null, value );
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it is resolved relative to a context map supplied
by the
- * application resolving construct values. If the construct value is
symbolic
- * the implementation will attempt to expand the reference relative to a
context
- * map (if supplied) otherwise the implementation will attempt to expand
the value
- * using system properties.
- *
- * @param target a classname or symbolic reference
- * @param method the method to invoke on the target
- * @param value the construct value
- */
- public Construct( String target, String method, String value )
- {
- m_target = target;
- m_method = method;
- m_value = value;
- m_args = new Value[0];
- m_compound = false;
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it is resolved relative to a context map supplied
by the
- * application resolving construct values. Instance values resolved from
the
- * supplied Value[] will be used as constructor arguments when resolving
the target.
- *
- * @param target the construct classname
- * @param args an array of unresolved parameter values
- */
- public Construct( String target, Value[] args )
- {
- this( target, null, args );
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it is resolved relative to a context map supplied
by the
- * application resolving construct values. Instance values resolved from
the
- * supplied Value[] will be used as method arguments when resolving the
target.
- *
- * @param target the construct classname
- * @param method the method to invoke on the target
- * @param args an array of unresolved parameter values
- */
- public Construct( String target, String method, Value[] args )
- {
- if( null == args )
- {
- m_args = new Value[0];
- }
- else
- {
- m_args = args;
- }
- m_value = null;
- m_target = target;
- m_method = method;
- m_compound = true;
- }
-
- /**
- * Creation of a new construct using a value directive.
- * @param directive the value directive
- */
- public Construct( ValueDirective directive )
- {
- m_value = directive.getBaseValue();
- m_target = directive.getTargetExpression();
- m_method = directive.getMethodName();
- m_compound = directive.isCompound();
- ValueDirective[] values = directive.getValueDirectives();
- int n = values.length;
- m_args = new Value[ n ];
- for( int i=0; i<n; i++ )
- {
- ValueDirective value = values[i];
- m_args[i] = new Construct( value );
- }
- }
-
- /**
- * Return TRUE if this construct is a compund construct else FALSE.
- * @return TRUE if this ia a compound construct
- */
- public boolean isCompound()
- {
- return m_compound;
- }
-
- /**
- * Return the method name to be applied to the target object.
- * @return the method name
- */
- public String getMethodName()
- {
- return m_method;
- }
-
- /**
- * Return the set of nested values within this value.
- * @return the nested values array
- */
- public Value[] getValues()
- {
- return m_args;
- }
-
- /**
- * Return the classname of the resolved value.
- * @return the classname
- */
- public String getBaseValue()
- {
- return m_value;
- }
-
- /**
- * Return the classname of the resolved value.
- * @return the classname
- */
- public String getTargetExpression()
- {
- return m_target;
- }
-
- /**
- * Resolve an instance from the value using the context classloader.
- * @return the resolved instance
- * @exception Exception if an error occurs during value resolution
- */
- public Object resolve() throws Exception
- {
- return resolve( null );
- }
-
- /**
- * Resolve an instance from the value using a supplied map.
- * @param map the context map
- * @return the resolved instance
- * @exception Exception if an error occurs during value resolution
- */
- public Object resolve( Map map ) throws Exception
- {
- return resolve( map, false );
- }
-
- /**
- * Resolve an instance from the value using a supplied isolation policy.
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if an error occurs during value resolution
- */
- public Object resolve( boolean isolate ) throws Exception
- {
- return resolve( null, isolate );
- }
-
- /**
- * Resolve an instance from the value using a supplied context map. If
any
- * target expressions in immediate or nested values contain a symbolic
- * expression the value will be resolved using the supplied map.
- *
- * @param map the context map
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- public Object resolve( Map map, boolean isolate ) throws Exception
- {
- return resolve( null, map, null, isolate );
- }
-
- /**
- * Resolve an instance from the value using a supplied context map. If
any
- * target expressions in immediate or nested values contain a symbolic
- * expression the value will be resolved using the supplied map.
- *
- * @param classname the default classname
- * @param map the context map
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- public Object resolve( String classname, Map map, boolean isolate )
throws Exception
- {
- return resolve( classname, map, null, isolate );
- }
-
- /**
- * Resolve an instance from the value.
- * @param map the context map
- * @param classloader the classloader to use
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if an error occurs during value resolution
- */
- private Object resolve( String classname, Map map, ClassLoader
classloader, boolean isolate ) throws Exception
- {
- ClassLoader loader = resolveClassLoader( classloader );
- Object target = getTargetObject( classname, map, loader );
- if( isCompound() )
- {
- if( null == target )
- {
- throw new NullPointerException( "target" );
- }
- else
- {
- return resolveCompoundExpression( target, map, loader );
- }
- }
- else
- {
- Object value = resolveBaseValue( map );
- if( null == target )
- {
- return value;
- }
- else
- {
- return resolveSimpleExpression( target, map, loader );
- }
- }
- }
-
- private Object resolveBaseValue( Map map )
- {
- return expandSymbols( map, m_value );
- }
-
- private Object resolveSimpleExpression( Object target, Map map,
ClassLoader classloader ) throws Exception
- {
- String method = getMethodName();
- Object value = expandSymbols( map, m_value );
- boolean isaClass = ( target.getClass() == Class.class );
- if( null == method )
- {
- if( isaClass )
- {
- method = "new";
- }
- else
- {
- final String error =
- "Target expression '"
- + m_target
- + "' resolving to an instance of the class ["
- + target.getClass()
- + "] canot be resolved due to missing method declaration.";
- throw new ValueException( error );
- }
- }
- else
- {
- if( isaClass && ( null == value ) )
- {
- // check if the method name is a static field
- Class c = (Class) target;
- try
- {
- Field field = c.getField( method );
- return field.get( c );
- }
- catch( NoSuchFieldException e )
- {
- // assume its a method
- }
- }
- }
-
- if( value == null )
- {
- Expression expression = new Expression( target, method, new
Object[0] );
- try
- {
- return expression.getValue();
- }
- catch( Throwable e )
- {
- final String error =
- "Internal error while evalating simple expression using:"
- + "\n target: "
- + m_target
- + " ("
- + target
- + ")"
- + "\n method: "
- + m_method
- + " ("
- + method
- + ")";
- throw new ValueException( error, e );
- }
- }
- else
- {
- Expression expression = new Expression( target, method, new
Object[]{value} );
- try
- {
- return expression.getValue();
- }
- catch( Throwable e )
- {
- final String error =
- "Internal error while evaluating expression using:"
- + "\n target: " + m_target + " (" + target + ")"
- + "\n method: " + m_method + " (" + method + ")"
- + "\n value: " + m_value + " (" +
value.getClass().getName() + ")";
- throw new ValueException( error, e );
- }
- }
- }
-
- private Object resolveCompoundExpression( Object target, Map map,
ClassLoader classloader ) throws Exception
- {
- Value[] args = getValues();
- Object[] instances = getInstanceValues( map, classloader, args );
- String method = getMethodName();
- boolean isaClass = ( target.getClass() == Class.class );
-
- //
- // check if we are dealing with an array class and if so return and
- // array created from the array of nested values
- //
-
- if( isaClass )
- {
- Class c = (Class) target;
- if( c.isArray() )
- {
- Class type = c.getComponentType();
- if( type.isPrimitive() )
- {
- return buildPrimitiveArray( type, instances );
- }
- else
- {
- Object[] result =
- (Object[]) Array.newInstance( type, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( type.isAssignableFrom( instance.getClass() ) )
- {
- result[i] = instances[i];
- }
- else
- {
- final String error =
- "Array ["
- + type.getName()
- + "] contains an invalid element ["
- + instance.getClass().getName()
- + "].";
- throw new ValueException( error );
- }
- }
- return result;
- }
- }
- }
-
- // otherwise its a regular expression
-
- if( null == method )
- {
- if( isaClass )
- {
- method = "new";
- }
- else
- {
- final String error =
- "Missing method declaration in a composite value
construct."
- + "\nTarget: "
- + target
- + " (" + target.getClass().getName()
- + ")";
- throw new ValueException( error );
- }
- }
- else
- {
- if( isaClass && ( instances.length == 0 ) )
- {
- // check if the method name is a static field
- Class c = (Class) target;
- try
- {
- Field field = c.getField( method );
- return field.get( c );
- }
- catch( NoSuchFieldException e )
- {
- // assume its a method
- }
- }
- }
- Expression expression = new Expression( target, method, instances );
- try
- {
- return expression.getValue();
- }
- catch( Throwable e )
- {
- StringBuffer buffer = new StringBuffer();
- buffer.append( "Internal error while evaluating compound
expression." );
- buffer.append( "\n target: " + m_target + " (" + target + ")" );
- buffer.append( "\n method: " + m_method + " (" + method + ")" );
- for( int i=0; i<instances.length; i++ )
- {
- buffer.append(
- "\n param "
- + ( i+1 )
- + ": "
- + instances[i].getClass().getName()
- );
- }
- String error = buffer.toString();
- throw new ValueException( error, e );
- }
- }
-
- private Object buildPrimitiveArray( Class type, Object[] instances )
throws ValueException
- {
- Object result = Array.newInstance( type, instances.length );
- if( Integer.TYPE == type )
- {
- return buildIntArray( instances );
- }
- else if( Short.TYPE == type )
- {
- return buildShortArray( instances );
- }
- else if( Long.TYPE == type )
- {
- return buildLongArray( instances );
- }
- else if( Byte.TYPE == type )
- {
- return buildByteArray( instances );
- }
- else if( Double.TYPE == type )
- {
- return buildDoubleArray( instances );
- }
- else if( Float.TYPE == type )
- {
- return buildFloatArray( instances );
- }
- else if( Character.TYPE == type )
- {
- return buildCharacterArray( instances );
- }
- else if( Boolean.TYPE == type )
- {
- return buildBooleanArray( instances );
- }
- else
- {
- final String error =
- "Primitive array class ["
- + type.getName()
- + "] is not recognized.";
- throw new UnsupportedOperationException( error );
- }
- }
-
- private Object buildIntArray( Object[] instances ) throws ValueException
- {
- Object result = Array.newInstance( Integer.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Integer )
- {
- Integer integer = (Integer) instance;
- int v = integer.intValue();
- Array.setInt( result, i, v );
- }
- else
- {
- final String error =
- "Supplied int array argument class ["
- + instance.getClass().getName()
- + "] is not an Integer.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildShortArray( Object[] instances ) throws
ValueException
- {
- Object result = Array.newInstance( Short.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Short )
- {
- Short primitive = (Short) instance;
- short v = primitive.shortValue();
- Array.setShort( result, i, v );
- }
- else
- {
- final String error =
- "Supplied short array argument class ["
- + instance.getClass().getName()
- + "] is not an Short.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildLongArray( Object[] instances ) throws ValueException
- {
- Object result = Array.newInstance( Long.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Long )
- {
- Long primitive = (Long) instance;
- long v = primitive.longValue();
- Array.setLong( result, i, v );
- }
- else
- {
- final String error =
- "Supplied long array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Long.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildByteArray( Object[] instances ) throws ValueException
- {
- Object result = Array.newInstance( Byte.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Byte )
- {
- Byte primitive = (Byte) instance;
- byte v = primitive.byteValue();
- Array.setByte( result, i, v );
- }
- else
- {
- final String error =
- "Supplied byte array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Byte.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildDoubleArray( Object[] instances ) throws
ValueException
- {
- Object result = Array.newInstance( Double.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Double )
- {
- Double primitive = (Double) instance;
- double v = primitive.doubleValue();
- Array.setDouble( result, i, v );
- }
- else
- {
- final String error =
- "Supplied double array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Double.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildFloatArray( Object[] instances ) throws
ValueException
- {
- Object result = Array.newInstance( Float.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Float )
- {
- Float primitive = (Float) instance;
- float v = primitive.floatValue();
- Array.setFloat( result, i, v );
- }
- else
- {
- final String error =
- "Supplied float array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Float.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildCharacterArray( Object[] instances ) throws
ValueException
- {
- Object result = Array.newInstance( Character.TYPE, instances.length
);
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Character )
- {
- Character primitive = (Character) instance;
- char v = primitive.charValue();
- Array.setChar( result, i, v );
- }
- else
- {
- final String error =
- "Supplied char array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Character.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object buildBooleanArray( Object[] instances ) throws
ValueException
- {
- Object result = Array.newInstance( Boolean.TYPE, instances.length );
- for( int i=0; i<instances.length; i++ )
- {
- Object instance = instances[i];
- if( instance instanceof Boolean )
- {
- Boolean primitive = (Boolean) instance;
- boolean v = primitive.booleanValue();
- Array.setBoolean( result, i, v );
- }
- else
- {
- final String error =
- "Supplied boolean array argument class ["
- + instance.getClass().getName()
- + "] is not an instance of Boolean.";
- throw new ValueException( error );
- }
- }
- return result;
- }
-
- private Object[] getInstanceValues(
- Map map, ClassLoader classloader, Value[] args ) throws Exception
- {
- Object[] instances = new Object[ args.length ];
- for( int i=0; i < args.length; i++ )
- {
- Value value = args[i];
- if( value instanceof Construct )
- {
- Construct construct = (Construct) value;
- instances[i] = construct.resolve( null, map, classloader,
false );
- }
- else
- {
- instances[i] = value.resolve( map );
- }
- }
- return instances;
- }
-
- private Object expandSymbols( Map map, String value )
- {
- if( null == value )
- {
- return null;
- }
- else
- {
- return parseSymbolicValue( map, value );
- }
- }
-
- private Object parseSymbolicValue( Map map, String value )
- {
- if( null == map )
- {
- return PropertyResolver.resolve( value );
- }
- if( value.startsWith( "${" ) && value.endsWith( "}" ) )
- {
- String pre = value.substring( 2 );
- String key = pre.substring( 0, pre.length() -1 );
- if( map.containsKey( key ) )
- {
- return map.get( key );
- }
- else
- {
- return PropertyResolver.resolve( value );
- }
- }
- else
- {
- return PropertyResolver.resolve( value );
- }
- }
-
- /**
- * Return the instance class using the context classloader.
- * @return the target object or class
- * @exception ValueException if target related error occurs
- */
- private Object getTargetObject( String classname, Map map, ClassLoader
loader ) throws ValueException
- {
- if( null == m_target )
- {
- return getTargetObject( map, loader, classname );
- }
- else
- {
- return getTargetObject( map, loader, m_target );
- }
- }
-
- /**
- * Return the instance class using the context classloader.
- * @return the target object or class
- * @exception ValueException if target related error occurs
- */
- private Object getTargetObject( Map map, ClassLoader loader, String
target ) throws ValueException
- {
- if( null == target )
- {
- return null;
- }
- else if( target.startsWith( "${" ) )
- {
- if( null != map )
- {
- String pre = target.substring( 2 );
- String key = pre.substring( 0, pre.length() -1 );
- if( map.containsKey( key ) )
- {
- return map.get( key );
- }
- else
- {
- final String error =
- "Unresolvable target symbolic expression ["
- + target
- + "].";
- throw new ValueException( error );
- }
- }
- else
- {
- String resolved = PropertyResolver.resolve( target );
- return getTargetObject( map, loader, resolved );
- }
- }
- else
- {
- if( target.endsWith( "[]" ) )
- {
- int n = target.length() - 2;
- String componentClassname = target.substring( 0, n );
- Class componentClass = resolveType( loader,
componentClassname );
- return Array.newInstance( componentClass, 0 ).getClass();
- }
- else
- {
- return resolveClass( loader, target );
- }
- }
- }
-
- /**
- * Return the instance class using the context classloader.
- * @return the class
- * @exception ComponentException if the parameter class cannot be
resolved
- */
- private Class resolveClass( ClassLoader loader, String classname )
throws ValueException
- {
- try
- {
- return loader.loadClass( classname );
- }
- catch( final ClassNotFoundException e )
- {
- if( classname.equals( "int" ) )
- {
- return Integer.class;
- }
- else if( classname.equals( "short" ) )
- {
- return Short.class;
- }
- else if( classname.equals( "long" ) )
- {
- return Long.class;
- }
- else if( classname.equals( "byte" ) )
- {
- return Byte.class;
- }
- else if( classname.equals( "double" ) )
- {
- return Double.class;
- }
- else if( classname.equals( "float" ) )
- {
- return Float.class;
- }
- else if( classname.equals( "char" ) )
- {
- return Character.class;
- }
- else if( classname.equals( "boolean" ) )
- {
- return Boolean.class;
- }
- else
- {
- final String error =
- "Class not found ["
- + classname
- + "].";
- throw new ValueException( error, e );
- }
- }
- }
-
- /**
- * Return the instance class using the context classloader.
- * @return the class
- * @exception ComponentException if the parameter class cannot be
resolved
- */
- private Class resolveType( ClassLoader loader, String classname ) throws
ValueException
- {
- try
- {
- return loader.loadClass( classname );
- }
- catch( final ClassNotFoundException e )
- {
- if( classname.equals( "int" ) )
- {
- return Integer.TYPE;
- }
- else if( classname.equals( "short" ) )
- {
- return Short.TYPE;
- }
- else if( classname.equals( "long" ) )
- {
- return Long.TYPE;
- }
- else if( classname.equals( "byte" ) )
- {
- return Byte.TYPE;
- }
- else if( classname.equals( "double" ) )
- {
- return Double.TYPE;
- }
- else if( classname.equals( "float" ) )
- {
- return Float.TYPE;
- }
- else if( classname.equals( "char" ) )
- {
- return Character.TYPE;
- }
- else if( classname.equals( "boolean" ) )
- {
- return Boolean.TYPE;
- }
- else
- {
- final String error =
- "Class not found ["
- + classname
- + "].";
- throw new ValueException( error, e );
- }
- }
- }
-
- private ClassLoader resolveClassLoader( ClassLoader classloader )
- {
- if( null != classloader )
- {
- return classloader;
- }
- else
- {
- ClassLoader loader =
Thread.currentThread().getContextClassLoader();
- if( null == loader )
- {
- return Construct.class.getClassLoader();
- }
- else
- {
- return loader;
- }
- }
- }
-
- /**
- * Return a string representation of the construct.
- * @return the string value
- */
- public String toString()
- {
- if( !m_compound )
- {
- return "construct "
- + " target: " + m_target
- + " method: " + m_method
- + " value: " + m_value;
- }
- else
- {
- return "construct "
- + " target: " + m_target
- + " method: " + m_method
- + " values: " + m_args.length;
- }
- }
-
- /**
- * Compare this instance with a supplied object for equality.
- * @param other the other object
- * @return true if the supplied instance is equal to this instance
- */
- public boolean equals( Object other )
- {
- if( null == other )
- {
- return false;
- }
- if( other instanceof Construct )
- {
- Construct construct = (Construct) other;
- if( !equals( m_target, construct.m_target ) )
- {
- return false;
- }
- if( m_compound != construct.m_compound )
- {
- return false;
- }
- if( !equals( m_method, construct.m_method ) )
- {
- return false;
- }
- if( m_compound )
- {
- return Arrays.equals( m_args, construct.m_args );
- }
- else
- {
- return equals( m_value, construct.m_value );
- }
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the instance hashcode value.
- * @return the hashcode
- */
- public int hashCode()
- {
- int hash = 0;
- if( null != m_target )
- {
- hash ^= m_target.hashCode();
- }
- if( null != m_method )
- {
- hash ^= m_method.hashCode();
- }
- if( m_compound )
- {
- for( int i=0; i<m_args.length; i++ )
- {
- hash ^= m_args[i].hashCode();
- }
- }
- else
- {
- if( m_value != null )
- {
- hash ^= m_value.hashCode();
- }
- }
- return hash;
- }
-
- private boolean equals( Object a, Object b )
- {
- if( null == a )
- {
- return ( null == b );
- }
- else
- {
- return a.equals( b );
- }
- }
-}

Copied: trunk/main/transit/core/src/main/net/dpml/transit/DTD.java (from rev
1183, trunk/main/transit/core/src/main/net/dpml/lang/DTD.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/DTD.java 2006-03-14
19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DTD.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2006 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;
+
+import java.net.URI;
+
+/**
+ * DTD reference.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+class DTD
+{
+ /**
+ * Public identifier.
+ */
+ private final String m_public;
+
+ /**
+ * The system identifier.
+ */
+ private final String m_system;
+
+ /**
+ * Local resource.
+ */
+ private final String m_resource;
+
+ /**
+ * Factory uri.
+ */
+ private final URI m_factory;
+
+ public DTD( final String publicId, final String systemId, final String
resource, URI factory )
+ {
+ m_public = publicId;
+ m_system = systemId;
+ m_resource = resource;
+ m_factory = factory;
+ }
+
+ public String getPublicId()
+ {
+ return m_public;
+ }
+
+ public String getSystemId()
+ {
+ return m_system;
+ }
+
+ public String getResource()
+ {
+ return m_resource;
+ }
+
+ public URI getFactory()
+ {
+ return m_factory;
+ }
+}

Copied: trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/lang/DTDResolver.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/DTDResolver.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DTDResolver.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2004-2006 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;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * A Class to help to resolve Entitys for items such as DTDs or
+ * Schemas.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+class DTDResolver implements EntityResolver
+{
+ /**
+ * The list of DTDs that can be resolved by this class.
+ */
+ private final DTD[] m_dtds;
+
+ /**
+ * The ClassLoader to use when loading resources for DTDs.
+ */
+ private final ClassLoader m_classLoader;
+
+ /**
+ * Construct a resolver using specified DTDInfos where resources are
loaded
+ * from specified ClassLoader.
+ */
+ public DTDResolver( final DTD[] dtds, final ClassLoader classLoader )
+ {
+ m_dtds = dtds;
+ m_classLoader = classLoader;
+ }
+
+ /**
+ * Resolve an entity in the XML file.
+ * Called by parser to resolve DTDs.
+ */
+ public InputSource resolveEntity( final String publicId, final String
systemId )
+ throws IOException, SAXException
+ {
+ for( int i=0; i<m_dtds.length; i++ )
+ {
+ final DTD info = m_dtds[i];
+
+ if( ( publicId != null && publicId.equals( info.getPublicId() )
)
+ || ( systemId != null && systemId.equals( info.getSystemId()
) ) )
+ {
+ final ClassLoader classLoader = getClassLoader();
+ final InputStream inputStream =
+ classLoader.getResourceAsStream( info.getResource() );
+ if( null == inputStream )
+ {
+ String path = "resource:" + info.getResource();
+ throw new NullPointerException( path );
+ }
+ return new InputSource( inputStream );
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return CLassLoader to load resource from.
+ * If a ClassLoader is specified in the constructor use that,
+ * else use ContextClassLoader unless that is null in which case
+ * use the current classes ClassLoader.
+ */
+ private ClassLoader getClassLoader()
+ {
+ ClassLoader classLoader = m_classLoader;
+ if( null == classLoader )
+ {
+ classLoader = Thread.currentThread().getContextClassLoader();
+ }
+ if( null == classLoader )
+ {
+ classLoader = getClass().getClassLoader();
+ }
+ return classLoader;
+ }
+}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheHandler.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -39,6 +39,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

+import net.dpml.lang.Logger;
+
import net.dpml.transit.artifact.ArtifactNotFoundException;
import net.dpml.transit.artifact.ArtifactAlreadyExistsException;
import net.dpml.transit.model.CacheModel;

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultCacheModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,6 +31,8 @@
import java.util.Set;
import java.util.TreeSet;

+import net.dpml.lang.Logger;
+
import net.dpml.transit.info.LayoutDirective;
import net.dpml.transit.info.CacheDirective;
import net.dpml.transit.info.HostDirective;

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCodeBaseModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCodeBaseModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultCodeBaseModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,8 +23,12 @@
import java.util.EventObject;
import java.util.EventListener;

+import net.dpml.lang.Value;
+import net.dpml.lang.ValueDirective;
+import net.dpml.lang.Construct;
+import net.dpml.lang.Logger;
+
import net.dpml.transit.info.CodeBaseDirective;
-import net.dpml.transit.info.ValueDirective;
import net.dpml.transit.model.CodeBaseModel;
import net.dpml.transit.model.CodeBaseListener;
import net.dpml.transit.model.CodeBaseEvent;

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -27,6 +27,8 @@
import net.dpml.transit.model.ContentListener;
import net.dpml.transit.model.ContentEvent;

+import net.dpml.lang.Logger;
+
/**
* Default implementation of a content model that maintains an active
* configuration of a pluggable content handler.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistry.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -32,7 +32,10 @@
import net.dpml.transit.model.ContentRegistryEvent;
import net.dpml.transit.model.ContentModel;

+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.Logger;

/**
* A registry of descriptions of plugable content handlers.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistryModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistryModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultContentRegistryModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -36,6 +36,7 @@

import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.DuplicateKeyException;
+import net.dpml.lang.Logger;

/**
* Default implementation of a content model registry manager that maitains

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultHostModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -39,6 +39,7 @@
import net.dpml.transit.util.PropertyResolver;

import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.Logger;

/**
* Default implementation of a host manager.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -27,6 +27,8 @@
import net.dpml.transit.model.LayoutListener;
import net.dpml.transit.model.LayoutEvent;

+import net.dpml.lang.Logger;
+
/**
* The DefaultLayoutModel is a model supplied to a layout strategy handler.
It
* provides two mdes of construction - one dealing with local layout handlers

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistry.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,6 +31,7 @@
import net.dpml.transit.model.LayoutModel;

import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.Logger;

/**
* A registry of descriptions of plugable layout models.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistryModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistryModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultLayoutRegistryModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -35,6 +35,7 @@

import net.dpml.lang.UnknownKeyException;
import net.dpml.lang.DuplicateKeyException;
+import net.dpml.lang.Logger;

/**
* Default implementation of a layout registry model that maitains

Modified: trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -29,6 +29,8 @@

import net.dpml.transit.monitor.LoggingAdapter;

+import net.dpml.lang.Logger;
+
/**
* A abstract base class that established an event queue and handles event
dispatch
* operations for listeners declared in classes extending this base class.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultProxyModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultProxyModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultProxyModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,6 +31,8 @@
import net.dpml.transit.model.ProxyEvent;
import net.dpml.transit.model.RequestIdentifier;

+import net.dpml.lang.Logger;
+
/**
* The ProxyModel class maintains an active configuration model of the
* Transit proxy configuration.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultResourceHost.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -54,6 +54,7 @@
import net.dpml.transit.util.Util;

import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.Logger;

/**
* This class represents a single host where resources are stored at.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -41,6 +41,8 @@
import net.dpml.transit.model.DisposalListener;
import net.dpml.transit.monitor.LoggingAdapter;

+import net.dpml.lang.Logger;
+
/**
* The DefaultTransitModel class maintains an active configuration of the
* Transit system.

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/Logger.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Logger.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Logger.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,100 +0,0 @@
-/*
- * Copyright 2004-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;
-
-/**
- * Transit Logger is a interface through which different logging solutions
- * can be provided.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public interface Logger
-{
- /**
- * Return TRUE is debug level logging is enabled.
- * @return the enabled state of debug logging
- */
- boolean isDebugEnabled();
-
- /**
- * Return TRUE is info level logging is enabled.
- * @return the enabled state of info logging
- */
- boolean isInfoEnabled();
-
- /**
- * Return TRUE is warn level logging is enabled.
- * @return the enabled state of warn level logging
- */
- boolean isWarnEnabled();
-
- /**
- * Return TRUE is error level logging is enabled.
- * @return the enabled state of error logging
- */
- boolean isErrorEnabled();
-
- /**
- * Record a debug level message.
- * @param message the debug message to record
- */
- void debug( String message );
-
- /**
- * Record a informative message.
- * @param message the info message to record
- */
- void info( String message );
-
- /**
- * Record a warning message.
- * @param message the warning message to record
- */
- 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
- */
- void error( String message );
-
- /**
- * Record a error level message.
- * @param message the error message to record
- * @param cause the causal exception
- */
- 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 );
-}
-
-

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/LoggingService.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/LoggingService.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/LoggingService.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,45 +0,0 @@
-/*
- * 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;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.util.logging.LogRecord;
-
-/**
- * Interface exposed by a remote logging service to local log aggregation
handlers.
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public interface LoggingService extends Remote
-{
- /**
- * Logging service key.
- */
- String LOGGING_KEY = "/dpml/logging";
-
- /**
- * Register a log record with the log service.
- * @param process the process identifier
- * @param record the log record
- * @exception RemoteException if a remote exception occurs
- */
- void log( PID process, LogRecord record ) throws RemoteException;
-}
-

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/PID.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/PID.java 2006-03-15
19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/PID.java 2006-03-16
17:35:47 UTC (rev 1193)
@@ -1,117 +0,0 @@
-/*
- * 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;
-
-import java.io.Serializable;
-
-import java.util.Random;
-
-/**
- * The PID class is a process identifer.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class PID implements Serializable
-{
- private final int m_id;
-
- /**
- * Creation of a new process identifier.
- */
- public PID()
- {
- m_id = setupInitialValue();
- }
-
- /**
- * Creation of a new process identifier.
- * @param pid the process identity
- */
- public PID( int pid )
- {
- m_id = pid;
- }
-
- private static int setupInitialValue()
- {
- String id = System.getProperty( "process.id" );
- if( null == id )
- {
- return Math.abs( new Random().nextInt() );
- }
- else
- {
- try
- {
- return Integer.parseInt( id );
- }
- catch( NumberFormatException e )
- {
- return Math.abs( new Random().nextInt() );
- }
- }
- }
-
- /**
- * Return the process identifier int value.
- * @return the process id value
- */
- public int getValue()
- {
- return m_id;
- }
-
- /**
- * Return the string representation of this process identifier.
- * @return the process identifier as a string
- */
- public String toString()
- {
- return "[" + m_id + "]";
- }
-
- /**
- * Test if a supplied object is equal to this process identifier.
- * @param other the object to compare with this object
- * @return TRUE if the objects are equivalent
- */
- public boolean equals( Object other )
- {
- if( other instanceof PID )
- {
- PID pid = (PID) other;
- return getValue() == pid.getValue();
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Return the hashcode for this PID instance.
- * @return the hashcode value
- */
- public int hashCode()
- {
- return getValue();
- }
-}
-

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Repository.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -44,7 +44,6 @@
* @return the plugin descriptor
* @exception IOException if a factory creation error occurs
*/
- //Plugin getPluginDescriptor( URI uri ) throws IOException;
Part getPart( URI uri ) throws IOException;

/**

Copied: trunk/main/transit/core/src/main/net/dpml/transit/SaxMonitor.java
(from rev 1183,
trunk/main/transit/core/src/main/net/dpml/lang/SaxMonitor.java)
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/SaxMonitor.java
2006-03-14 19:40:35 UTC (rev 1183)
+++ trunk/main/transit/core/src/main/net/dpml/transit/SaxMonitor.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2006 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;
+
+import java.net.URL;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import net.dpml.lang.Logger;
+
+/**
+ * Utility class supporting the reading and writing of standard plugins
definitions.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+final class SaxMonitor implements ErrorHandler
+{
+ private Logger m_logger;
+
+ public SaxMonitor( Logger logger )
+ {
+ if( null == logger )
+ {
+ throw new NullPointerException( "logger" );
+ }
+ m_logger = logger;
+ }
+
+ public void error( SAXParseException e ) throws SAXException
+ {
+ final String message = getMessage( e );
+ m_logger.warn( message );
+ }
+
+ public void fatalError( SAXParseException e ) throws SAXException
+ {
+ final String message = getMessage( e );
+ m_logger.error( message );
+ }
+
+ public void warning( SAXParseException e ) throws SAXException
+ {
+ final String message = getMessage( e );
+ m_logger.warn( message );
+ }
+
+ private String getMessage( SAXParseException e )
+ {
+ return e.getMessage()
+ + "(" + e.getLineNumber()
+ + "," + e.getColumnNumber()
+ + ")";
+ }
+}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/SecuredTransitContext.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -41,9 +41,8 @@
import net.dpml.transit.monitor.LoggingAdapter;

import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.Logger;

-import net.dpml.part.PartBuilder;
-
/**
* The initial context of the transit system.
*
@@ -299,7 +298,7 @@
{
m_linkManager = new ArtifactLinkManager();
Logger logger = getLogger().getChildLogger( "cache" );
- m_repository = new StandardLoader( logger, new PartBuilder( null )
); // this needs to be configured
+ m_repository = new StandardLoader( logger ); // this needs to be
configured
initializeCache();
}


Modified:
trunk/main/transit/core/src/main/net/dpml/transit/StandardLayoutModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/StandardLayoutModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/StandardLayoutModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -23,6 +23,9 @@
import java.util.EventObject;
import java.util.EventListener;

+import net.dpml.lang.Value;
+import net.dpml.lang.Logger;
+
import net.dpml.transit.model.LayoutModel;
import net.dpml.transit.model.LayoutListener;
import net.dpml.transit.model.LayoutEvent;

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/StandardLoader.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -38,6 +38,7 @@

import net.dpml.lang.Classpath;
import net.dpml.lang.Category;
+import net.dpml.lang.Logger;

import net.dpml.part.Part;
import net.dpml.part.PartDirective;
@@ -57,7 +58,7 @@
class StandardLoader implements Repository
{
private final Logger m_logger;
- private final PartBuilder m_builder;
+ private final PartBuilder m_builder = new PartBuilder( null );

private static final PartHandlerFactory FACTORY =
PartHandlerFactory.getInstance();

@@ -65,10 +66,9 @@
* Creation of a new repository handler.
* @param logger the assigned logging channel
*/
- StandardLoader( Logger logger, PartBuilder builder )
+ StandardLoader( Logger logger )
{
m_logger = logger;
- m_builder = builder;
}

//
------------------------------------------------------------------------
@@ -290,19 +290,19 @@
* @exception InvocationTargetException if a plugin constructor
invocation error occurs
* @exception NullArgumentException if the class or args argument is null
*/
- private Object createPlugin( Class clazz, Object[] args )
- throws IOException, NullArgumentException, InvocationTargetException
- {
- if( null == clazz )
- {
- throw new NullArgumentException( "clazz" );
- }
- if( null == args )
- {
- throw new NullArgumentException( "args" );
- }
- return instantiate( clazz, args );
- }
+ //private Object createPlugin( Class clazz, Object[] args )
+ // throws IOException, NullArgumentException,
InvocationTargetException
+ //{
+ // if( null == clazz )
+ // {
+ // throw new NullArgumentException( "clazz" );
+ // }
+ // if( null == args )
+ // {
+ // throw new NullArgumentException( "args" );
+ // }
+ // return instantiate( clazz, args );
+ //}

public Object instantiate( Class clazz, Object[] args ) throws
RepositoryException, InvocationTargetException
{
@@ -503,7 +503,7 @@
throw new RepositoryException( error, e );
}
}
-
+
private Constructor getSingleConstructor( Class clazz ) throws
RepositoryException
{
if( null == clazz )
@@ -594,7 +594,7 @@
URI[] impArtifacts = classpath.getDependencies( Category.PRIVATE );
URL[] imps = getURLs( impArtifacts );
ClassLoader classloader = buildClassLoader( plugin,
Category.PRIVATE, spi, imps );
-
+
return classloader;
}

@@ -725,6 +725,7 @@
* @exception NullArgumentException if the supplied classloader or
classname is null
* @exception ClassNotFoundException if the plugin class is not found in
the supplied classloader
*/
+ /*
protected Class loadPluginClass( ClassLoader classloader, String
classname )
throws RepositoryException, NullArgumentException,
ClassNotFoundException
{
@@ -754,6 +755,7 @@
throw new RepositoryException( error, e );
}
}
+ */

/**
* Convert a uri to an artifact.
@@ -777,12 +779,6 @@
}
}

- private String appendFragment( URI base, String fragment )
- {
- String path = base.toString();
- return "[" + path + "] (" + fragment + ")";
- }
-
private RepositoryMonitorRouter getMonitor()
{
return Transit.getInstance().getRepositoryMonitorRouter();
@@ -792,6 +788,4 @@
{
return m_logger;
}
-
- private static final int THREE = 3;
}

Modified: trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Transit.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -31,7 +31,9 @@
import net.dpml.transit.monitor.CacheMonitorRouter;
import net.dpml.transit.monitor.NetworkMonitorRouter;
import net.dpml.transit.model.TransitModel;
+
import net.dpml.lang.UnknownKeyException;
+import net.dpml.lang.Logger;

/**
* The Transit class manages the establishment of a singleton transit
instance

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/TransitBuilder.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -37,11 +37,10 @@
import net.dpml.transit.info.HostDirective;
import net.dpml.transit.info.ProxyDirective;
import net.dpml.transit.info.LayoutDirective;
-import net.dpml.transit.info.ValueDirective;

-import net.dpml.lang.DTD;
-import net.dpml.lang.DTDResolver;
-import net.dpml.lang.SaxMonitor;
+import net.dpml.lang.Value;
+import net.dpml.lang.ValueDirective;
+import net.dpml.lang.Logger;

import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
@@ -124,8 +123,6 @@
builder.setErrorHandler( errors );

final Document document = builder.parse( input );
- //final DocumentType docType = document.getDoctype();
- // TODO check doctype name and version
final Element root = document.getDocumentElement();
return build( root );
}

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/Value.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/Value.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/Value.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,83 +0,0 @@
-/*
- * 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;
-
-import java.util.Map;
-
-/**
- * A object resolvable from primitive and symbolic arguments.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public interface Value
-{
- /**
- * Resolve an instance from the value using the context classloader.
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- Object resolve() throws Exception;
-
- /**
- * Resolve an instance from the value using a supplied context map. If
any
- * target expressions in immediate or nested values contain a symbolic
- * expression the value will be resolved using the supplied map.
- *
- * @param map the context map
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- Object resolve( Map map ) throws Exception;
-
- /**
- * Resolve an instance from the value using a supplied isolation policy.
- *
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- Object resolve( boolean isolate ) throws Exception;
-
- /**
- * Resolve an instance from the value using a supplied context map. If
any
- * target expressions in immediate or nested values contain a symbolic
- * expression the value will be resolved using the supplied map.
- *
- * @param map the context map
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- Object resolve( Map map, boolean isolate ) throws Exception;
-
- /**
- * Resolve an instance from the value using a supplied context map. If
any
- * target expressions in immediate or nested values contain a symbolic
- * expression the value will be resolved using the supplied map.
- *
- * @param classname the default classname
- * @param map the context map
- * @param isolate the isolation policy
- * @return the resolved instance
- * @exception Exception if error occurs during instance resolution
- */
- Object resolve( String classname, Map map, boolean isolate ) throws
Exception;
-
-}

Deleted: trunk/main/transit/core/src/main/net/dpml/transit/ValueException.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/ValueException.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/ValueException.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,55 +0,0 @@
-/*
- * 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;
-
-/**
- * Exception to indicate an error arrising from a value type.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class ValueException extends Exception
-{
- /**
- * Serial version identifier.
- */
- static final long serialVersionUID = 1L;
-
- /**
- * Construct a new <code>ValueException</code> instance.
- *
- * @param message the exception message
- */
- public ValueException( final String message )
- {
- super( message );
- }
-
- /**
- * Construct a new <code>ValueException</code> instance.
- *
- * @param message the exception message
- * @param cause the causal exception
- */
- public ValueException( final String message, Throwable cause )
- {
- super( message, cause );
- }
-}
-

Deleted:
trunk/main/transit/core/src/main/net/dpml/transit/ValueRuntimeException.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/ValueRuntimeException.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/ValueRuntimeException.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,55 +0,0 @@
-/*
- * 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;
-
-/**
- * Exception to indicate an error arrising from a value type.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class ValueRuntimeException extends RuntimeException
-{
- /**
- * Serial version identifier.
- */
- static final long serialVersionUID = 1L;
-
- /**
- * Construct a new <code>ValueRuntimeException</code> instance.
- *
- * @param message the exception message
- */
- public ValueRuntimeException( final String message )
- {
- super( message );
- }
-
- /**
- * Construct a new <code>ValueRuntimeException</code> instance.
- *
- * @param message the exception message
- * @param cause the causal exception
- */
- public ValueRuntimeException( final String message, Throwable cause )
- {
- super( message, cause );
- }
-}
-

Deleted:
trunk/main/transit/core/src/main/net/dpml/transit/info/AbstractDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/AbstractDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/AbstractDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,115 +0,0 @@
-/*
- * 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.info;
-
-import java.io.Serializable;
-
-/**
- * Abstract directive base class.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public abstract class AbstractDirective implements Serializable
-{
- /**
- * Compare this object to the supplied object for equality.
- * @param other the other object
- * @return true if equal
- */
- public boolean equals( Object other )
- {
- if( null == other )
- {
- return false;
- }
- else
- {
- return ( other instanceof AbstractDirective );
- }
- }
-
- /**
- * Calculate the hashcode.
- * @return the hashcode value
- */
- public int hashCode()
- {
- return getClass().hashCode();
- }
-
- /**
- * Utility to hash an array.
- * @param array the array
- * @return the hash value
- */
- protected int hashArray( Object[] array )
- {
- if( null == array )
- {
- return 0;
- }
- int hash = 0;
- for( int i=0; i<array.length; i++ )
- {
- Object object = array[i];
- hash ^= hashValue( object );
- }
- return hash;
- }
-
- /**
- * Utility to hash an object.
- * @param value the object
- * @return the hash value
- */
- protected int hashValue( Object value )
- {
- if( null == value )
- {
- return 0;
- }
- else if( value instanceof Object[] )
- {
- return hashArray( (Object[]) value );
- }
- else
- {
- return value.hashCode();
- }
- }
-
- /**
- * Utility to compare two object for equality.
- * @param a the first object
- * @param b the second object
- * @return true if the objects are equal
- */
- protected boolean equals( Object a, Object b )
- {
- if( null == a )
- {
- return ( null == b );
- }
- else
- {
- return a.equals( b );
- }
- }
-}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/CacheDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/CacheDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/CacheDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,6 +20,8 @@

import java.util.Arrays;

+import net.dpml.lang.AbstractDirective;
+
/**
* Description of the Transit cache configuration.
*

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/CodeBaseDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/CodeBaseDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/CodeBaseDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -22,6 +22,9 @@
import java.net.URISyntaxException;
import java.util.Arrays;

+import net.dpml.lang.AbstractDirective;
+import net.dpml.lang.ValueDirective;
+
/**
* The CodeBaseDirective is immutable datastructure used to
* describe a codebase.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/ContentDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/ContentDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/ContentDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,6 +20,8 @@

import java.net.URISyntaxException;

+import net.dpml.lang.ValueDirective;
+
/**
* The CodeBaseDirective is immutable datastructure used to
* describe a codebase.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/HostDirective.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/info/HostDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/info/HostDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,6 +18,8 @@

package net.dpml.transit.info;

+import net.dpml.lang.AbstractDirective;
+
/**
* Description of a host configuration within Transit.
*

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/LayoutDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/LayoutDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/LayoutDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,6 +20,9 @@

import java.net.URISyntaxException;

+import net.dpml.lang.AbstractDirective;
+import net.dpml.lang.ValueDirective;
+
/**
* The CodeBaseDirective is immutable datastructure used to
* describe a codebase.

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/ProxyDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/ProxyDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/ProxyDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,6 +20,8 @@

import java.util.Arrays;

+import net.dpml.lang.AbstractDirective;
+
/**
* Description of the proxy configuration of a Transit system.
*

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/info/TransitDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/TransitDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/TransitDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,6 +18,8 @@

package net.dpml.transit.info;

+import net.dpml.lang.AbstractDirective;
+
/**
* The CodeBaseDirective is immutable datastructure used to
* describe a codebase.

Deleted:
trunk/main/transit/core/src/main/net/dpml/transit/info/ValueDirective.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/info/ValueDirective.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/info/ValueDirective.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -1,241 +0,0 @@
-/*
- * 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.info;
-
-import java.util.Arrays;
-
-/**
- * A object resolvable from primitive arguments.
- *
- * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
- * @version @PROJECT-VERSION@
- */
-public class ValueDirective extends AbstractDirective
-{
- private final String m_method;
- private final String m_target;
- private final String m_value;
- private final ValueDirective[] m_args;
- private final boolean m_compound;
-
- /**
- * Create a new value descriptor using the default java.lang.String class
as the base type.
- * @param value the construct value
- */
- public ValueDirective( String value )
- {
- this( null, null, value );
- }
-
- /**
- * Create a new construct using a supplied target definition. The target
argument
- * may be either a classname or a symbolic object reference in the form
${[key]}.
- *
- * @param target a classname or symbolic object reference
- * @param value the construct value
- */
- public ValueDirective( String target, String value )
- {
- this( target, null, value );
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it is resolved relative to a context map supplied
by the
- * application resolving construct values. If the construct value is
symbolic
- * the implementation will attempt to expand the reference relative to a
context
- * map (if supplied) otherwise the implementation will attempt to expand
the value
- * using system properties.
- *
- * @param target a classname or symbolic reference
- * @param method the method to invoke on the target
- * @param value the construct value
- */
- public ValueDirective( String target, String method, String value )
- {
- super();
- m_target = target;
- m_method = method;
- m_value = value;
- m_args = new ValueDirective[0];
- m_compound = false;
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it is resolved relative to a context map supplied
by the
- * application resolving construct values. Instance values resolved from
the
- * supplied Value[] will be used as constructor arguments when resolving
the target.
- *
- * @param target the construct classname
- * @param args an array of unresolved parameter values
- */
- public ValueDirective( String target, ValueDirective[] args )
- {
- this( target, null, args );
- }
-
- /**
- * Create a new construct using a supplied target defintion. The target
argument
- * may be either a classname or a symbolic reference in the form
${[key]}. If the
- * argument is symbolic it is resolved relative to a context map supplied
by the
- * application resolving construct values. Instance values resolved from
the
- * supplied Value[] will be used as method arguments when resolving the
target.
- *
- * @param target the construct classname
- * @param method the method to invoke on the target
- * @param args an array of unresolved parameter values
- */
- public ValueDirective( String target, String method, ValueDirective[]
args )
- {
- super();
- if( null == args )
- {
- m_args = new ValueDirective[0];
- }
- else
- {
- m_args = args;
- }
- m_value = null;
- m_target = target;
- m_method = method;
- m_compound = true;
- }
-
- /**
- * Return TRUE if this construct is a compund construct else FALSE.
- * @return TRUE if this ia a compound construct
- */
- public boolean isCompound()
- {
- return m_compound;
- }
-
- /**
- * Return the method name to be applied to the target object.
- * @return the method name
- */
- public String getMethodName()
- {
- return m_method;
- }
-
- /**
- * Return the set of nested values within this value.
- * @return the nested values array
- */
- public ValueDirective[] getValueDirectives()
- {
- return m_args;
- }
-
- /**
- * Return the base value of the resolved value.
- * @return the base value
- */
- public String getBaseValue()
- {
- return m_value;
- }
-
- /**
- * Return the classname of the resolved value.
- * @return the classname
- */
- public String getTargetExpression()
- {
- return m_target;
- }
-
- /**
- * Return a string representation of the construct.
- * @return the string value
- */
- public String toString()
- {
- if( !m_compound )
- {
- return "value "
- + " target: " + m_target
- + " method: " + m_method
- + " value: " + m_value;
- }
- else
- {
- return "value "
- + " target: " + m_target
- + " method: " + m_method
- + " values: " + m_args.length;
- }
- }
-
- /**
- * Compare this instance with a supplied object for equality.
- * @param other the other object
- * @return true if the supplied instance is equal to this instance
- */
- public boolean equals( Object other )
- {
- if( super.equals( other ) && ( other instanceof ValueDirective ) )
- {
- ValueDirective construct = (ValueDirective) other;
- if( !equals( m_target, construct.m_target ) )
- {
- return false;
- }
- if( m_compound != construct.m_compound )
- {
- return false;
- }
- if( !equals( m_method, construct.m_method ) )
- {
- return false;
- }
- if( m_compound )
- {
- return Arrays.equals( m_args, construct.m_args );
- }
- else
- {
- return equals( m_value, construct.m_value );
- }
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Compute the instance hashcode value.
- * @return the hashcode
- */
- public int hashCode()
- {
- int hash = 0;
- hash ^= hashValue( m_target );
- hash ^= hashValue( m_method );
- hash ^= hashArray( m_args );
- hash ^= hashValue( m_value );
- return hash;
- }
-}

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/model/CodeBaseModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/model/CodeBaseModel.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/model/CodeBaseModel.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -22,7 +22,7 @@
import java.rmi.Remote;
import java.rmi.RemoteException;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

/**
* A CodeBaseModel maintains information about the configuration of

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/model/ParametersEvent.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/model/ParametersEvent.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/model/ParametersEvent.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,7 +18,7 @@

package net.dpml.transit.model;

-import net.dpml.transit.Value;
+import net.dpml.lang.Value;

/**
* An event pertaining to a change in a plugin uri assigned to

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/monitor/Adapter.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/monitor/Adapter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/core/src/main/net/dpml/transit/monitor/Adapter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,7 +20,7 @@

import java.net.URL;

-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

/**
* Utility interface defining a monitor adapter. The contract defines a set
of operations

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/monitor/LoggingAdapter.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/monitor/LoggingAdapter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/monitor/LoggingAdapter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -22,7 +22,7 @@
import java.util.logging.Logger;
import java.util.logging.Level;

-import net.dpml.transit.PID;
+import net.dpml.lang.PID;

/**
* Generic adapter that redirects monitor events to a logging channel.
@@ -206,7 +206,7 @@
* @param category the sub-category name.
* @return the child logging channel
*/
- public net.dpml.transit.Logger getChildLogger( String category )
+ public net.dpml.lang.Logger getChildLogger( String category )
{
if( ( null == category ) || "".equals( category ) )
{

Modified:
trunk/main/transit/core/src/main/net/dpml/transit/util/StandardFormatter.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/util/StandardFormatter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/main/net/dpml/transit/util/StandardFormatter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,7 +18,7 @@

package net.dpml.transit.util;

-import net.dpml.transit.PID;
+import net.dpml.lang.PID;

import java.util.logging.Formatter;
import java.util.logging.LogRecord;

Modified:
trunk/main/transit/core/src/test/net/dpml/transit/info/CodeBaseDirectiveTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/info/CodeBaseDirectiveTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/test/net/dpml/transit/info/CodeBaseDirectiveTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,6 +20,10 @@

import java.net.URI;

+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
+import net.dpml.lang.ValueDirective;
+
/**
* Testing the CodeBaseDirective class.
*

Modified:
trunk/main/transit/core/src/test/net/dpml/transit/info/ContentDirectiveTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/info/ContentDirectiveTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/test/net/dpml/transit/info/ContentDirectiveTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,6 +18,10 @@

package net.dpml.transit.info;

+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
+import net.dpml.lang.ValueDirective;
+
/**
* Testing the CodeBaseDirective class.
*

Modified:
trunk/main/transit/core/src/test/net/dpml/transit/info/LayoutDirectiveTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/info/LayoutDirectiveTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/test/net/dpml/transit/info/LayoutDirectiveTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -18,6 +18,10 @@

package net.dpml.transit.info;

+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
+import net.dpml.lang.ValueDirective;
+
/**
* Testing the CodeBaseDirective class.
*

Modified:
trunk/main/transit/core/src/test/net/dpml/transit/info/ValueDirectiveTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/info/ValueDirectiveTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/test/net/dpml/transit/info/ValueDirectiveTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -20,7 +20,9 @@

import java.io.File;

-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;
+import net.dpml.lang.ValueDirective;

/**
* Testing the ValueDirective class.

Modified:
trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
2006-03-15 19:07:04 UTC (rev 1192)
+++
trunk/main/transit/core/src/test/net/dpml/transit/test/ConstructTestCase.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -25,8 +25,8 @@
import java.util.Hashtable;
import java.util.Arrays;

-import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
+import net.dpml.lang.Value;
+import net.dpml.lang.Construct;

/**
* Construct testcase.

Modified:
trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
===================================================================
--- trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
2006-03-15 19:07:04 UTC (rev 1192)
+++ trunk/main/transit/tools/src/main/net/dpml/transit/tools/AntAdapter.java
2006-03-16 17:35:47 UTC (rev 1193)
@@ -22,7 +22,7 @@

import net.dpml.transit.monitor.Adapter;
import net.dpml.transit.util.ExceptionHelper;
-import net.dpml.transit.Logger;
+import net.dpml.lang.Logger;

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




  • r1193 - in trunk/main: depot/build/src/main/net/dpml/library/console depot/core/src/main/net/dpml/depot depot/install/src/main/net/dpml/depot/install depot/library/src/main/net/dpml/library/impl depot/library/src/test/net/dpml/library/impl depot/tools/builder/src/main/net/dpml/tools/impl depot/tools/builder/src/main/net/dpml/tools/process depot/tools/builder/src/main/net/dpml/tools/tasks metro/builder/src/main/net/dpml/metro/builder metro/builder/src/test/net/dpml/metro/builder metro/exec/src/main/net/dpml/metro/exec metro/install/src/main/net/dpml/metro/central metro/model/src/main/net/dpml/metro/data metro/part/api/src/main/net/dpml/part metro/runtime/src/main/net/dpml/metro/runtime metro/station/api/src/main/net/dpml/station metro/station/api/src/main/net/dpml/station/info metro/station/api/src/test/net/dpml/station/info metro/station/builder/src/main/net/dpml/station/builder metro/station/console/src/main/net/dpml/station/console metro/station/server/src/main/ne! t/dpml/station/server metro/station/server/src/test/net/dpml/station/server metro/tools/src/main/net/dpml/metro/tools transit/console/src/main/net/dpml/transit/console transit/core/src/main/net/dpml/lang transit/core/src/main/net/dpml/part transit/core/src/main/net/dpml/transit transit/core/src/main/net/dpml/transit/info transit/core/src/main/net/dpml/transit/model transit/core/src/main/net/dpml/transit/monitor transit/core/src/main/net/dpml/transit/util transit/core/src/test/net/dpml/transit/info transit/core/src/test/net/dpml/transit/test transit/tools/src/main/net/dpml/transit/tools, mcconnell at BerliOS, 03/16/2006

Archive powered by MHonArc 2.6.24.

Top of Page