Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2849 - in development/main: depot/console depot/console/etc/bin depot/console/etc/bin/dpml depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/profile depot/station/src/main/net/dpml/depot/station transit/core/handler/src/main/net/dpml/transit/model

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2849 - in development/main: depot/console depot/console/etc/bin depot/console/etc/bin/dpml depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/profile depot/station/src/main/net/dpml/depot/station transit/core/handler/src/main/net/dpml/transit/model
  • Date: Tue, 14 Jun 2005 01:09:45 -0400

Author: mcconnell AT dpml.net
Date: Tue Jun 14 01:09:43 2005
New Revision: 2849

Added:
development/main/depot/console/etc/bin/dpml/
development/main/depot/console/etc/bin/dpml/depot.exe (contents, props
changed)
Modified:
development/main/depot/console/build.xml
development/main/depot/console/etc/bin/install-depot.bat
development/main/depot/console/etc/bin/uninstall-depot.bat
development/main/depot/console/src/main/net/dpml/depot/Main.java

development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java

development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfileStorage.java

development/main/depot/console/src/main/net/dpml/depot/profile/DepotModel.java

development/main/depot/console/src/main/net/dpml/depot/profile/DepotStorage.java
development/main/depot/console/src/main/net/dpml/depot/profile/Profile.java

development/main/depot/station/src/main/net/dpml/depot/station/StationProfile.java

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

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

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

development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultTransitModel.java
Log:
Continued work on aplication profiles.

Modified: development/main/depot/console/build.xml
==============================================================================
--- development/main/depot/console/build.xml (original)
+++ development/main/depot/console/build.xml Tue Jun 14 01:09:43 2005
@@ -4,7 +4,7 @@
xmlns:transit="antlib:net.dpml.transit"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

- <available property="depot.exe.available"
file="${dpml.system}/bin/dpml-depot.exe"/>
+ <available property="depot.exe.available"
file="${dpml.system}/bin/dpml/depot.exe"/>

<transit:import uri="artifact:template:dpml/magic/standard"/>

@@ -48,7 +48,7 @@
<copy todir="${dpml.system}" preservelastmodified="true"
overwrite="true">
<fileset dir="target">
<include name="bin/**"/>
- <exclude name="bin/*.exe"/>
+ <exclude name="bin/dpml/**"/>
</fileset>
</copy>
<chmod perm="755">
@@ -62,7 +62,7 @@
<target name="win32-exe-install" depends="standard.install"
unless="depot.exe.available">
<copy todir="${dpml.system}" preservelastmodified="true">
<fileset dir="target">
- <include name="bin/*.exe"/>
+ <include name="bin/dpml/**"/>
</fileset>
</copy>
</target>

Added: development/main/depot/console/etc/bin/dpml/depot.exe
==============================================================================
Binary file. No diff available.

Modified: development/main/depot/console/etc/bin/install-depot.bat
==============================================================================
--- development/main/depot/console/etc/bin/install-depot.bat (original)
+++ development/main/depot/console/etc/bin/install-depot.bat Tue Jun 14
01:09:43 2005
@@ -1,5 +1,8 @@
@echo on

-win32\depot.exe -install DEPOT %JAVA_HOME%\jre\bin\server\jvm.dll
-Djava.class.path=%DPML_SYSTEM%\bin
-Djava.system.class.loader=net.dpml.depot.lang.DepotClassLoader
-Djava.security.policy=%DPML_SYSTEM%\bin\security.policy
-Djava.class.path=%DPML_HOME%\Data\lib\dpml-transit-main-SNAPSHOT.jar;%DPML_HOME%\Data\lib\dpml-depot-console-SNAPSHOT.jar
-start net.dpml.depot.Main -params start -stop net.dpml.depot.Main -method
stop -out %DPML_HOME%\Data\logs\depot-stdout.log -err
%DPML_HOME%\Data\logs\depot-stderr.log -current ;%DPML_HOME%\Data\work -manual
+mkdir %DPML_HOME%\Data\work
+mkdir %DPML_HOME%\Data\logs\depot
+
+dpml\depot.exe -install DEPOT %JAVA_HOME%\jre\bin\server\jvm.dll
-Djava.class.path=%DPML_SYSTEM%\bin
-Djava.system.class.loader=net.dpml.depot.lang.DepotClassLoader
-Djava.security.policy=%DPML_SYSTEM%\bin\security.policy
-Djava.class.path=%DPML_HOME%\Data\lib\dpml-transit-main-SNAPSHOT.jar;%DPML_HOME%\Data\lib\dpml-depot-console-SNAPSHOT.jar
-start net.dpml.depot.Main -params start -stop net.dpml.depot.Main -method
stop -out %DPML_HOME%\Data\logs\depot\stdout.log -err
%DPML_HOME%\Data\logs\depot\stderr.log -current ;%DPML_HOME%\Data\work -manual

@pause

Modified: development/main/depot/console/etc/bin/uninstall-depot.bat
==============================================================================
--- development/main/depot/console/etc/bin/uninstall-depot.bat (original)
+++ development/main/depot/console/etc/bin/uninstall-depot.bat Tue Jun 14
01:09:43 2005
@@ -1,4 +1,4 @@
@echo off
@echo on
-w32\depot.exe -uninstall DEPOT
+dpml\depot.exe -uninstall DEPOT
@pause

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 Tue
Jun 14 01:09:43 2005
@@ -66,6 +66,7 @@
public static void start( final String[] args )
throws Exception
{
+ System.out.println( "starting station" );
Main.main( new String[]{ "-station" } );
}

@@ -166,63 +167,6 @@
}
}

- //
- // establish the target application profile to run
- //
-
- String target = null;
- for( int i=0; i < args.length; i++ )
- {
- String arg = args[i];
- if( arg.equals( "-prefs" ) )
- {
- if( null == target )
- {
- target = "prefs";
- }
- else
- {
- final String message =
- "Invalid command combination."
- + "Selected option '-" + target
- + " cannot be executed in conjunction with the -prefs
option.";
- logger.error( message );
- System.exit( -1 );
- }
- }
- else if( arg.equals( "-station" ) )
- {
- if( null == target )
- {
- target = "station";
- }
- else
- {
- final String message =
- "Invalid command combination."
- + "Selected option '-" + target
- + " cannot be executed in conjunction with the
-station option.";
- logger.error( message );
- System.exit( -1 );
- }
- }
- }
-
- if( null == target )
- {
- target = getTargetProfile( args );
- }
-
- //
- // if we don't have a target declared then print out help and exit
- //
-
- if( null == target )
- {
- handleHelp( logger );
- return;
- }
-
try
{
//
@@ -234,7 +178,42 @@
Preferences prefs = getRootPreferences();
DepotStorage store = new DepotStorage( prefs, logger, creation,
false );
DepotModel manager = store.getDepotModel();
- ApplicationProfile profile = getApplicationProfile( manager,
target );
+
+ //
+ // check for the prefs or station option
+ //
+
+ ApplicationProfile profile = null;
+ for( int i=0; i < args.length; i++ )
+ {
+ String arg = args[i];
+ if( arg.equals( "-prefs" ) )
+ {
+ profile = createPrefsProfile( logger );
+ break;
+ }
+ else if( arg.equals( "-station" ) )
+ {
+ profile = createStationProfile( logger );
+ break;
+ }
+ else if( arg.equals( "-profile" ) )
+ {
+ String target = getTargetProfile( args );
+ if( null != target )
+ {
+ profile = getApplicationProfile( manager, target );
+ break;
+ }
+ }
+ }
+
+ if( null == profile )
+ {
+ handleHelp( logger );
+ return;
+ }
+
termination = profile.getCommandPolicy();
for( int i=0; i < args.length; i++ )
{
@@ -246,7 +225,7 @@
}
}
Properties properties = profile.getSystemProperties();
- setSystemProperties( properties );
+ applySystemProperties( properties );
DepotClassLoader system = getSystemClassLoader();
Connection connection = profile.getConnection();
Registry registry = getRegistry( connection );
@@ -256,7 +235,7 @@
{
TransitModel model = loadTransitModel( args, logger );
Transit transit = Transit.getInstance( model );
- Logger log = logger.getChildLogger( target );
+ Logger log = profile.getLogger();
Repository loader = transit.getRepository();
Object object = loader.getPlugin( system, uri, new Object[]{
args, manager, model, log } );
if( registry != null )
@@ -378,6 +357,51 @@
}
}

+ private static ApplicationProfile createPrefsProfile( Logger logger )
throws HandledError
+ {
+ try
+ {
+ String id = "prefs";
+ Date creation = new Date();
+ Logger log = logger.getChildLogger( "prefs" );
+ boolean policy = true;
+ URI uri = new URI( "@DEPOT-PREFS-URI@" );
+ String title = "Depot Preferences";
+ boolean command = false;
+ return new ApplicationProfile( log, creation, id, title, null,
command, null, uri );
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Unexpected exception while attempting to construct the
preferences profile.";
+ getLogger().error( error, e );
+ throw new HandledError();
+ }
+ }
+
+ private static ApplicationProfile createStationProfile( Logger logger )
throws HandledError
+ {
+ try
+ {
+ String id = "station";
+ Date creation = new Date();
+ Logger log = logger.getChildLogger( "station" );
+ boolean policy = true;
+ URI uri = new URI( "@STATION-PLUGIN-URI@" );
+ String title = "Depot Station";
+ boolean command = false;
+ ApplicationProfile.Connection connection = new
ApplicationProfile.Connection();
+ return new ApplicationProfile( log, creation, id, title, null,
command, connection, uri );
+ }
+ catch( Exception e )
+ {
+ final String error =
+ "Unexpected exception while attempting to construct the
station profile.";
+ getLogger().error( error, e );
+ throw new HandledError();
+ }
+ }
+
public static Registry getRegistry( Connection connection )
{
if( null == connection )
@@ -482,8 +506,12 @@
* Setup the system properties for the target.
* @param prefs the profile's system properties preferences node
*/
- private static void setSystemProperties( Properties properties ) throws
BackingStoreException
+ private static void applySystemProperties( Properties properties )
throws BackingStoreException
{
+ if( null == properties )
+ {
+ return;
+ }
String[] keys = (String[]) properties.keySet().toArray( new
String[0] );
for( int i=0; i<keys.length; i++ )
{

Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java
Tue Jun 14 01:09:43 2005
@@ -38,6 +38,13 @@
private Connection m_connection;

public ApplicationProfile(
+ Logger logger, Date creation, String id, String title,
+ Properties properties, boolean command, Connection connection, URI uri
)
+ {
+ this( logger, creation, null, id, title, properties, command,
connection, uri, false );
+ }
+
+ public ApplicationProfile(
Logger logger, Date creation, ProfileHome home, String id, String
title,
Properties properties, boolean command, Connection connection, URI uri
)
{
@@ -100,6 +107,11 @@
private String m_host;
private int m_port;

+ public Connection()
+ {
+ this( null, 1099 );
+ }
+
public Connection( String host, int port )
{
m_host = host;

Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfileStorage.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfileStorage.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfileStorage.java
Tue Jun 14 01:09:43 2005
@@ -55,7 +55,7 @@
Preferences prefs, Logger logger, Date creation, boolean policy )
throws ProfileException
{
- this( prefs, logger, creation, policy, false );
+ this( prefs, logger, creation, policy, prefs.getBoolean( "system",
false ) );
}

ApplicationProfileStorage(

Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DepotModel.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DepotModel.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DepotModel.java
Tue Jun 14 01:09:43 2005
@@ -40,12 +40,16 @@
*/
public class DepotModel extends DefaultModel
{
+ private final Home m_home;
+
private final List m_list = Collections.synchronizedList( new
LinkedList() );

public DepotModel( Logger logger, Date creation, Home home,
ApplicationProfile[] profiles )
throws NullPointerException, ProfileException
{
- super( logger, creation, home );
+ super( logger, creation );
+
+ m_home = home;

for( int i=0; i<profiles.length; i++ )
{

Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DepotStorage.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DepotStorage.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DepotStorage.java
Tue Jun 14 01:09:43 2005
@@ -68,23 +68,18 @@
{
try
{
- if( false == getPreferences().node( "profiles" ).nodeExists(
"prefs" ) )
+ Preferences prefs = getPreferences().node( "profiles" );
+ prefs.node( "prefs" ).removeNode();
+ prefs.node( "station" ).removeNode();
+ String[] names = prefs.childrenNames();
+ ApplicationProfile[] profiles = new ApplicationProfile[
names.length ];
+ for( int i=0; i<names.length; i++ )
{
- return createBootstrapProfiles();
- }
- else
- {
- Preferences prefs = getPreferences().node( "profiles" );
- String[] names = prefs.childrenNames();
- ApplicationProfile[] profiles = new ApplicationProfile[
names.length ];
- for( int i=0; i<names.length; i++ )
- {
- String id = names[i];
- ApplicationProfile profile = createApplicationProfile(
id );
- profiles[i] = profile;
- }
- return profiles;
+ String id = names[i];
+ ApplicationProfile profile = createApplicationProfile( id );
+ profiles[i] = profile;
}
+ return profiles;
}
catch( BackingStoreException e )
{
@@ -105,43 +100,6 @@
return store.getApplicationProfile();
}

- private ApplicationProfile[] createBootstrapProfiles() throws
ProfileException
- {
- ApplicationProfile prefs = createPrefsProfile();
- ApplicationProfile station = createStationProfile();
- ApplicationProfile test = createTestProfile();
- return new ApplicationProfile[]{ prefs, station, test };
- }
-
- private ApplicationProfile createPrefsProfile() throws ProfileException
- {
- String id = "prefs";
- Date creation = getCreationDate();
- Logger logger = getLogger().getChildLogger( id );
- boolean policy = getStoragePolicy();
- Preferences prefs = getPreferences().node( "profiles" ).node( id );
- prefs.put( "plugin", "@DEPOT-PREFS-URI@" );
- prefs.put( "title", "Depot Preferences" );
- prefs.putBoolean( "command", false );
- ApplicationProfileStorage store = new ApplicationProfileStorage(
prefs, logger, creation, policy, true );
- return store.getApplicationProfile();
- }
-
- private ApplicationProfile createStationProfile() throws ProfileException
- {
- String id = "station";
- Date creation = getCreationDate();
- Logger logger = getLogger().getChildLogger( id );
- boolean policy = getStoragePolicy();
- Preferences prefs = getPreferences().node( "profiles" ).node( id );
- prefs.put( "plugin", "@STATION-PLUGIN-URI@" );
- prefs.put( "title", "Depot Station" );
- prefs.putBoolean( "command", false );
- prefs.node( "connection" );
- ApplicationProfileStorage store = new ApplicationProfileStorage(
prefs, logger, creation, policy, true );
- return store.getApplicationProfile();
- }
-
private ApplicationProfile createTestProfile() throws ProfileException
{
String id = "test";
@@ -152,7 +110,7 @@
prefs.put( "plugin", "@TEST-PLUGIN-URI@" );
prefs.put( "title", "Depot Station Test" );
prefs.putBoolean( "command", true );
- ApplicationProfileStorage store = new ApplicationProfileStorage(
prefs, logger, creation, policy, true );
+ ApplicationProfileStorage store = new ApplicationProfileStorage(
prefs, logger, creation, policy );
return store.getApplicationProfile();
}
}

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
Tue Jun 14 01:09:43 2005
@@ -47,7 +47,7 @@
public Profile(
Logger logger, Date creation, ProfileHome home, String id, String
title, Properties properties )
{
- super( logger, creation, home );
+ super( logger, creation );

m_id = id;
m_title = title;
@@ -108,7 +108,10 @@
enqueueEvent( veto, false );
DisposalEvent disposal = new DisposalEvent( this );
enqueueEvent( disposal, false );
- m_home.remove();
+ if( null != m_home )
+ {
+ m_home.remove();
+ }
}

protected void processEvent( EventObject event )

Modified:
development/main/depot/station/src/main/net/dpml/depot/station/StationProfile.java
==============================================================================
---
development/main/depot/station/src/main/net/dpml/depot/station/StationProfile.java
(original)
+++
development/main/depot/station/src/main/net/dpml/depot/station/StationProfile.java
Tue Jun 14 01:09:43 2005
@@ -35,14 +35,17 @@
*/
public class StationProfile extends DefaultModel
{
+ private final Home m_home;
+
private Properties m_properties;
private CodeBaseProfile[] m_profiles;

public StationProfile(
Logger logger, Date creation, Home home, Properties properties,
CodeBaseProfile[] profiles )
{
- super( logger, creation, home );
+ super( logger, creation );

+ m_home = home;
m_properties = properties;
m_profiles = profiles;
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultModel.java
Tue Jun 14 01:09:43 2005
@@ -61,13 +61,11 @@
*/
protected Date m_modification;

- private Home m_home;
-
//
------------------------------------------------------------------------
// constructor
//
------------------------------------------------------------------------

- public DefaultModel( Logger logger, Date creation, Home home )
+ public DefaultModel( Logger logger, Date creation )
throws NullPointerException
{
if( null == logger )
@@ -76,7 +74,6 @@
}
m_logger = logger;
m_creation = creation;
- m_home = home;
}

//
------------------------------------------------------------------------
@@ -137,11 +134,6 @@
// DefaultModel
//
------------------------------------------------------------------------

- protected Home getHome()
- {
- return m_home;
- }
-
protected void setModified()
{
m_modification = new Date();

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultPluginModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultPluginModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultPluginModel.java
Tue Jun 14 01:09:43 2005
@@ -44,8 +44,9 @@
// state
//
------------------------------------------------------------------------

+ private final PluginHome m_home;
+
private URI m_uri;
- private PluginHome m_home;

//
------------------------------------------------------------------------
// constructor
@@ -53,7 +54,7 @@

public DefaultPluginModel( Logger logger, Date creation, PluginHome
home, URI uri )
{
- super( logger, creation, home );
+ super( logger, creation );
m_uri = uri;
m_home = home;
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultProxyModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultProxyModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultProxyModel.java
Tue Jun 14 01:09:43 2005
@@ -58,7 +58,7 @@
URL host, PasswordAuthentication auth, String[] excludes )
throws NullPointerException
{
- super( logger, creation, home );
+ super( logger, creation );
m_host = host;
m_authentication = auth;
m_excludes = excludes;

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultTransitModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultTransitModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultTransitModel.java
Tue Jun 14 01:09:43 2005
@@ -39,6 +39,7 @@
private final ContentRegistryModel m_registry;
private final RepositoryModel m_repository;
private final ProxyModel m_proxy;
+ private final TransitHome m_home;

//
------------------------------------------------------------------------
// constructor
@@ -49,7 +50,7 @@
ContentRegistryModel content, RepositoryModel repository,
ProxyModel proxy )
{
- super( logger, creation, home );
+ super( logger, creation );

if( null == cache )
{
@@ -72,6 +73,7 @@
m_registry = content;
m_repository = repository;
m_proxy = proxy;
+ m_home = home;
}

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



  • svn commit: r2849 - in development/main: depot/console depot/console/etc/bin depot/console/etc/bin/dpml depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/profile depot/station/src/main/net/dpml/depot/station transit/core/handler/src/main/net/dpml/transit/model, mcconnell, 06/14/2005

Archive powered by MHonArc 2.6.24.

Top of Page