Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1798 - in development/main: . home/transit/handler/src/main/net/dpml/transit/artifact home/transit/handler/src/main/net/dpml/transit/monitors home/transit/plugin home/transit/plugin/etc/bin

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1798 - in development/main: . home/transit/handler/src/main/net/dpml/transit/artifact home/transit/handler/src/main/net/dpml/transit/monitors home/transit/plugin home/transit/plugin/etc/bin
  • Date: Thu, 17 Feb 2005 09:09:38 +0100

Author: mcconnell
Date: Thu Feb 17 09:09:37 2005
New Revision: 1798

Modified:
development/main/build.bat

development/main/home/transit/handler/src/main/net/dpml/transit/artifact/CacheHandler.java

development/main/home/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java

development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java

development/main/home/transit/handler/src/main/net/dpml/transit/monitors/SystemMonitor.java
development/main/home/transit/plugin/build.xml
development/main/home/transit/plugin/etc/bin/transit
development/main/home/transit/plugin/etc/bin/transit.bat
development/main/home/transit/plugin/etc/bin/transit.sh
Log:
improvements to the system trace stuff and improvements to the way the path
to the transit main jar is supplied (nix scripts not currently operational)

Modified: development/main/build.bat
==============================================================================
--- development/main/build.bat (original)
+++ development/main/build.bat Thu Feb 17 09:09:37 2005
@@ -16,7 +16,9 @@
) ELSE IF %TARGET% == all (
CALL :all
} ELSE (
- ECHO Invalid target - 'all', 'transit', 'magic', or 'metro'.
+ ECHO Invalid target [%TARGET%]
+ ECHO Recognized target include: 'all', 'transit', 'magic', and 'metro'.
+ GOTO end
)
GOTO end


Modified:
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/CacheHandler.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/CacheHandler.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/CacheHandler.java
Thu Feb 17 09:09:37 2005
@@ -21,6 +21,7 @@

import java.io.File;
import java.io.IOException;
+import java.util.Map;

import net.dpml.transit.TransitException;

@@ -50,6 +51,14 @@
static final String CACHE_CLASS_KEY = DOMAIN + ".cache.class";

/**
+ * Return a set of features describing the implementation. Keys
+ * and values may be implementation dependent.
+ *
+ * @return the feature collection
+ */
+ Map getCacheHandlerFeatures();
+
+ /**
* Attempts to download and cache a remote artifact using a set of remote
* repositories. The operation is not fail fast and so it keeps trying
if
* the first repository does not have the artifact in question.
@@ -61,4 +70,5 @@
*/
File getResource( Artifact artifact )
throws IOException, TransitException;
+
}

Modified:
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
Thu Feb 17 09:09:37 2005
@@ -22,6 +22,7 @@
import java.io.File;
import java.io.IOException;

+import java.util.Map;
import java.util.Iterator;
import java.util.Properties;
import java.util.TreeMap;
@@ -47,33 +48,32 @@
/**
* The base directory of the cache.
*/
- private File m_cacheDir;
+ private File m_cacheDir;

/**
* The resource hosts.
*/
private TreeMap m_resourceHosts;

- private Monitor m_monitor;
-
//
------------------------------------------------------------------------
// constructor
//
------------------------------------------------------------------------

/**
* Creation of a new file based cache handler.
+ * @param monitor the assigned monitor
* @param hosts the assigned hosts
* @param props the properties against which this instance will be
configured
*/
public FileCacheHandler( Monitor monitor, ResourceHost[] hosts,
Properties props )
{
- m_monitor = monitor;
m_resourceHosts = new TreeMap();
for( int i=0; i < hosts.length; i++ )
{
// We need to ensure that no other host already have the same
// priority, in which case we increase the priority until we find
// an available spot.
+
int priority = hosts[i].getPriority();
Integer key;
while ( true )
@@ -88,9 +88,23 @@
m_resourceHosts.put( key, hosts[i] );
}
m_cacheDir = createCacheDirectory( props );
- m_monitor.trace( "created file based cache on: " + m_cacheDir );
+ monitor.trace( "created file based cache on: " + m_cacheDir );
}

+ /**
+ * Return a set of features describing the implementation. Keys
+ * and values may be implementation dependent.
+ *
+ * @return the feature collection
+ */
+ public Map getCacheHandlerFeatures()
+ {
+ Properties properties = new Properties();
+ properties.setProperty( "Class", getClass().getName() );
+ properties.setProperty( "Directory", m_cacheDir.toString() );
+ return properties;
+ }
+
//
------------------------------------------------------------------------
// CacheHandler
//
------------------------------------------------------------------------

Modified:
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Thu Feb 17 09:09:37 2005
@@ -195,6 +195,7 @@
ResourceHost[] hosts = rhFactory.createResourceHosts();
CacheHandlerFactory chFactory = new CacheHandlerFactory(
authorative, monitor );
CacheHandler ch = chFactory.createCacheHandler( hosts );
+ monitor.notifyCacheHandlerCreation( ch );
m_CONTEXT = new SecuredTransitContext( authorative, hosts, ch );
return m_CONTEXT;
}

Modified:
development/main/home/transit/handler/src/main/net/dpml/transit/monitors/SystemMonitor.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/transit/monitors/SystemMonitor.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/transit/monitors/SystemMonitor.java
Thu Feb 17 09:09:37 2005
@@ -21,8 +21,9 @@
import java.net.URL;
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;

-
+import net.dpml.transit.artifact.CacheHandler;
import net.dpml.transit.artifact.ResourceHost;

/**
@@ -39,6 +40,8 @@
private List m_hosts = new ArrayList();
private URL m_authority;

+ private CacheHandler m_cache;
+
/**
* Creation of a new bootstrap monitor.
*/
@@ -108,6 +111,21 @@
{
return (ResourceHost[]) m_hosts.toArray( new ResourceHost[0] );
}
+
+ /**
+ * Notification of the creation of cache handler.
+ * @param host the resource host
+ */
+ public void notifyCacheHandlerCreation( CacheHandler cache )
+ {
+ m_cache = cache;
+ trace( "cache: " + cache );
+ }
+
+ public CacheHandler getCacheHandler()
+ {
+ return m_cache;
+ }
}



Modified: development/main/home/transit/plugin/build.xml
==============================================================================
--- development/main/home/transit/plugin/build.xml (original)
+++ development/main/home/transit/plugin/build.xml Thu Feb 17 09:09:37
2005
@@ -28,13 +28,9 @@

value="artifact:plugin:dpml/transit/dpml-transit-plugin#${project.version}" />
<filter token="TRANSIT_VERSION" value="${project.version}"/>
<property name="transit.w32.main"
value="dpml\transit\jars\dpml-transit-main-${project.version}.jar"/>
- <filter token="WINDOWS-CLI-CLASSPATH"
-
value="%DPML_HOME%\cache\${transit.w32.main};%DPML_SYSTEM%\local\${transit.w32.main}"
/>
+ <filter token="TRANSIT-PATH-FOR-WINDOWS" value="${transit.w32.main}" />
<property name="transit.nix.main"
value="dpml/transit/jars/dpml-transit-main-${project.version}.jar"/>
- <filter token="UNIX-CLI-CLASSPATH"
-
value="$DPML_HOME/local/dpml/transit/jars/dpml-transit-main-${project.version}.jar"
/>
- <filter token="UNIX-CLI-CLASSPATH"
-
value="%DPML_HOME%/cache/${transit.nix.main}:%DPML_SYSTEM%/local/${transit.nix.main}"
/>
+ <filter token="TRANSIT-PATH-FOR-NIX"
value="dpml/transit/jars/dpml-transit-main-${project.version}.jar" />
</target>

<target name="setup-path" depends="init">

Modified: development/main/home/transit/plugin/etc/bin/transit
==============================================================================
--- development/main/home/transit/plugin/etc/bin/transit (original)
+++ development/main/home/transit/plugin/etc/bin/transit Thu Feb 17
09:09:37 2005
@@ -64,7 +64,7 @@
TRANSIT_SECURITY_POLICY=$TRANSIT_HOME/bin/security.policy
export TRANSIT_SECURITY_POLICY

-TRANSIT_CLASSPATH=@UNIX-CLI-CLASSPATH@
+TRANSIT_CLASSPATH=$DPML_SYSTEM/local/@TRANSIT-PATH-FOR-NIX@
export TRANSIT_CLASSPATH

if [ `echo $PLATFORM | grep "CYGWIN"` ] ; then

Modified: development/main/home/transit/plugin/etc/bin/transit.bat
==============================================================================
--- development/main/home/transit/plugin/etc/bin/transit.bat (original)
+++ development/main/home/transit/plugin/etc/bin/transit.bat Thu Feb 17
09:09:37 2005
@@ -17,15 +17,18 @@
:SET_METRO
if "%DPML_HOME%" == "" set DPML_HOME=%APPDATA%\DPML
if "%DPML_SYSTEM%" == "" set DPML_SYSTEM=%DPML_HOME%\Shared
-if "%DPML_TRANSIT_CLASSPATH%" == "" set
DPML_TRANSIT_CLASSPATH=@WINDOWS-CLI-CLASSPATH@
if "%TRANSIT_PLUGIN%" == "" set TRANSIT_PLUGIN=@TRANSIT-PLUGIN-URI@
+if "%DPML_TRANSIT_JAR%" == "" set DPML_TRANSIT_JAR=@TRANSIT-PATH-FOR-WINDOWS@

-set CMD_LINE_ARGS=%*
-set
SECURITY_POLICY=-Djava.security.policy="%DPML_SYSTEM%\bin\security.policy"
-set
TRANSIT_CLASSPATH="%DPML_HOME%\Preferences\transit\lib";"%DPML_TRANSIT_CLASSPATH%"
+set $CACHED="%DPML_HOME%\Data\cache\%DPML_TRANSIT_JAR%"
+set $LIBRARY="%DPML_SYSTEM%\local\%DPML_TRANSIT_JAR%"
+if EXIST %$CACHED% ( set $CLASSPATH=%$CACHED% ) ELSE ( set
$CLASSPATH=%$LIBRARY% )
+set $SUPPLIMENT="%DPML_HOME%\Preferences\transit\lib"
+set $POLICY=-Djava.security.policy="%DPML_SYSTEM%\bin\security.policy"
+set $ARGS=%*

:RUN_METRO
-%JAVA% %SECURITY_POLICY% %TRANSIT_JVM_OPTS% -classpath %TRANSIT_CLASSPATH%
net.dpml.transit.Main -Xbootstrap=%TRANSIT_PLUGIN% %CMD_LINE_ARGS%
+%JAVA% %$POLICY% %TRANSIT_JVM_OPTS% -classpath %$SUPPLIMENT%;%$CLASSPATH%
net.dpml.transit.Main -Xbootstrap=%TRANSIT_PLUGIN% %$ARGS%
goto EndOfScript
:EndOfScript


Modified: development/main/home/transit/plugin/etc/bin/transit.sh
==============================================================================
--- development/main/home/transit/plugin/etc/bin/transit.sh (original)
+++ development/main/home/transit/plugin/etc/bin/transit.sh Thu Feb 17
09:09:37 2005
@@ -117,7 +117,7 @@

JVM_EXT_DIRS="$TRANSIT_HOME/ext"
JVM_OPTS="-Djava.security.policy=$TRANSIT_HOME/bin/security.policy "
-TRANSIT_CLASSPATH=@UNIX-CLI-CLASSPATH@
+TRANSIT_CLASSPATH=$DPML_SYSTEM/local/@TRANSIT-PATH-FOR-NIX@

# Get the run cmd
RUN_CMD="$JAVA_HOME/bin/java $JVM_OPTS
-Djava.protocol.handler.pkgs=net.dpml.transit $DEBUG $TRANSIT_JVM_OPTS
-classpath $TRANSIT_CLASSPATH net.dpml.transit.Main
-Xbootstrap=$TRANSIT_PLUGIN $ARGS"



  • svn commit: r1798 - in development/main: . home/transit/handler/src/main/net/dpml/transit/artifact home/transit/handler/src/main/net/dpml/transit/monitors home/transit/plugin home/transit/plugin/etc/bin, mcconnell, 02/17/2005

Archive powered by MHonArc 2.6.24.

Top of Page