notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2802 - in development/main/depot/console/src/main/net/dpml/depot: . lang profile
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2802 - in development/main/depot/console/src/main/net/dpml/depot: . lang profile
- Date: Wed, 08 Jun 2005 19:20:35 -0400
Author: mcconnell AT dpml.net
Date: Wed Jun 8 19:20:33 2005
New Revision: 2802
Removed:
development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
Modified:
development/main/depot/console/src/main/net/dpml/depot/Main.java
development/main/depot/console/src/main/net/dpml/depot/lang/DepotClassLoader.java
development/main/depot/console/src/main/net/dpml/depot/profile/Profile.java
Log:
housekeeping
Modified: development/main/depot/console/src/main/net/dpml/depot/Main.java
==============================================================================
--- development/main/depot/console/src/main/net/dpml/depot/Main.java
(original)
+++ development/main/depot/console/src/main/net/dpml/depot/Main.java Wed
Jun 8 19:20:33 2005
@@ -26,6 +26,7 @@
import java.rmi.Remote;
import java.rmi.ConnectException;
import java.rmi.RemoteException;
+import java.rmi.RMISecurityManager;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.util.Date;
@@ -62,33 +63,19 @@
*/
public final class Main
{
-
//--------------------------------------------------------------------------
- // static utilities for setup of logging manager
-
//--------------------------------------------------------------------------
-
- static
- {
- System.setProperty( "java.util.logging.manager",
"net.dpml.depot.logging.LoggingManager" );
- System.setProperty( "java.util.logging.manager.altclassloader",
"net.dpml.depot.logging.LoggingManager" );
- System.setProperty( "java.util.logging.config.class",
"net.dpml.depot.logging.ConfigurationHandler" );
-
- System.setProperty( Transit.SYSTEM_KEY,
Transit.DPML_SYSTEM.getAbsolutePath() );
- System.setProperty( Transit.HOME_KEY,
Transit.DPML_HOME.getAbsolutePath() );
- System.setProperty( Transit.DATA_KEY,
Transit.DPML_DATA.getAbsolutePath() );
- System.setProperty( Transit.PREFS_KEY,
Transit.DPML_PREFS.getAbsolutePath() );
- System.setProperty( DPML.BUILD_KEY, DPML.BUILD_ID );
- }
-
public static void main( final String[] args )
throws Exception
{
- boolean server = false;
+ long start = new Date().getTime();
+ System.setSecurityManager(new RMISecurityManager());
+
+ boolean server = true;
for( int i=0; i < args.length; i++ )
{
String arg = args[i];
- if( arg.equals( "-server" ) )
+ if( arg.equals( "-execute" ) )
{
- server = true;
+ server = false;
break;
}
}
@@ -163,7 +150,6 @@
logger.info(
"service bound to " + connection.getHost()
+ ":" + connection.getPort() + "/" + id );
- server = true;
}
else if( object instanceof Runnable )
{
@@ -176,7 +162,6 @@
thread = new Thread( (Runnable) object );
thread.start();
setShutdownHook( thread );
- server = true;
}
else
{
@@ -256,12 +241,17 @@
{
System.exit( -1 );
}
- getLogger().info( "done" );
+
+ long now = new Date().getTime();
+ long diff = ( now - start );
+ java.math.BigInteger r = new java.math.BigInteger ( "" + diff );
+ java.math.BigInteger d = new java.math.BigInteger ( "" + 1000 );
+ java.math.BigInteger[] result = r.divideAndRemainder( d );
+ getLogger().info( "startup completed in " + result[0] + "." +
result[1] + " seconds" );
if( false == server )
{
System.exit( 0 );
}
-
}
public static Registry getRegistry( Connection connection )
@@ -485,11 +475,26 @@
return LOGGER;
}
+
//--------------------------------------------------------------------------
+ // static utilities for setup of logging manager and root prefs
+
//--------------------------------------------------------------------------
+
+ static
+ {
+ System.setProperty( "java.util.logging.manager",
"net.dpml.depot.logging.LoggingManager" );
+ System.setProperty( "java.util.logging.manager.altclassloader",
"net.dpml.depot.logging.LoggingManager" );
+ System.setProperty( "java.util.logging.config.class",
"net.dpml.depot.logging.ConfigurationHandler" );
+
+ System.setProperty( Transit.SYSTEM_KEY,
Transit.DPML_SYSTEM.getAbsolutePath() );
+ System.setProperty( Transit.HOME_KEY,
Transit.DPML_HOME.getAbsolutePath() );
+ System.setProperty( Transit.DATA_KEY,
Transit.DPML_DATA.getAbsolutePath() );
+ System.setProperty( Transit.PREFS_KEY,
Transit.DPML_PREFS.getAbsolutePath() );
+ System.setProperty( DPML.BUILD_KEY, DPML.BUILD_ID );
+ }
+
private static Logger LOGGER = null;
- //new LoggingAdapter( java.util.logging.Logger.getLogger( "depot" ) );
private static final Preferences ROOT_PREFS =
Preferences.userNodeForPackage( Main.class );
-
private static class HandledError extends Error
{
}
Modified:
development/main/depot/console/src/main/net/dpml/depot/lang/DepotClassLoader.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/lang/DepotClassLoader.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/lang/DepotClassLoader.java
Wed Jun 8 19:20:33 2005
@@ -68,47 +68,11 @@
m_sealed = true;
}
- /**
- * Assignment of a preferences object to the classloader from which
- * urls shall be resolved. The implementation resolves urls values
- * by converting all attribute values in the supplied preference node to
- * URLs. On completion of the classloader is marked as sealed and no
- * further modification can be performed.
- *
- * @param prefs a preferences node describing the classpath
- * @exception IllegalStateException if the classloader is sealed
- * @exception IOException if an error occurs in the resolution of a URL
- * from an attribute value
- * @exception BackingStoreException if the backing store for the supplied
- * preferences node is not reachable
- */
- void setProfileClasspathNode( Preferences prefs ) throws
BackingStoreException, IOException
- {
- if( m_sealed )
- {
- final String error =
- "Illegal attempt to modify the bootstrap classpath.";
- throw new IllegalStateException( error );
- }
- Properties properties = System.getProperties();
- String[] keys = prefs.keys();
- for( int i=0; i<keys.length; i++ )
- {
- String key = keys[i];
- String value = prefs.get( key, null );
- if( null != value )
- {
- URL url = resolveURL( properties, value );
- addURL( url );
- }
- }
- m_sealed = true;
- }
-
private URL resolveURL( Properties properties, String value ) throws
IOException
{
String path = PropertyResolver.resolve( properties, value );
- if( path.startsWith( "file:" ) || path.startsWith( "http:" ) ||
path.startsWith( "ftp:" ) )
+ if( path.startsWith( "file:" ) || path.startsWith( "http:" )
+ || path.startsWith( "https:" ) || path.startsWith( "ftp:" ) )
{
return new URL( path );
}
Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/Profile.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/Profile.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/Profile.java
Wed Jun 8 19:20:33 2005
@@ -37,7 +37,9 @@
private Properties m_properties;
private Connection m_connection;
- public Profile( Logger logger, Date creation, Home home, String id,
String title, Properties properties, Connection connection )
+ public Profile(
+ Logger logger, Date creation, Home home, String id, String title,
+ Properties properties, Connection connection )
throws NullPointerException
{
super( logger, creation, home );
- svn commit: r2802 - in development/main/depot/console/src/main/net/dpml/depot: . lang profile, mcconnell, 06/08/2005
Archive powered by MHonArc 2.6.24.