Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2897 - in development/main: depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/profile depot/station/src/main/net/dpml/depot/station metro metro/main metro/main/src metro/main/src/main metro/main/src/main/net metro/main/src/main/net/dpml metro/main/src/main/net/dpml/metro

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: r2897 - in development/main: depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/profile depot/station/src/main/net/dpml/depot/station metro metro/main metro/main/src metro/main/src/main metro/main/src/main/net metro/main/src/main/net/dpml metro/main/src/main/net/dpml/metro
  • Date: Mon, 20 Jun 2005 13:32:06 -0400

Author: mcconnell AT dpml.net
Date: Mon Jun 20 13:32:05 2005
New Revision: 2897

Added:
development/main/metro/main/ (props changed)
development/main/metro/main/build.xml
development/main/metro/main/src/
development/main/metro/main/src/main/
development/main/metro/main/src/main/net/
development/main/metro/main/src/main/net/dpml/
development/main/metro/main/src/main/net/dpml/metro/
development/main/metro/main/src/main/net/dpml/metro/Metro.java
Modified:
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/DefaultApplicationProfile.java

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

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

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

development/main/depot/station/src/main/net/dpml/depot/station/ActivationStorage.java
development/main/metro/index.xml
Log:
working on metro model publication

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 Mon
Jun 20 13:32:05 2005
@@ -250,9 +250,10 @@
try
{
String id = profile.getID();
+ Properties params = profile.getProperties();
Logger log = logger.getChildLogger( id );

- Object object = resolveTargetObject( system, uri, args,
manager, model, log );
+ Object object = resolveTargetObject( system, uri, args,
manager, model, log, profile );

Connection connection = profile.getConnection();
if( null != connection )
@@ -327,7 +328,8 @@
}

private static Object resolveTargetObject(
- ClassLoader parent, URI uri, String[] args, DepotModel manager,
TransitModel model, Logger logger )
+ ClassLoader parent, URI uri, String[] args, DepotModel manager,
TransitModel model,
+ Logger logger, ApplicationProfile profile )
throws HandledError
{
try
@@ -339,7 +341,8 @@
String type = artifact.getType();
if( "plugin".equals( type ) )
{
- return loader.getPlugin( parent, uri, new Object[]{ args,
manager, model, logger } );
+ Properties props = profile.getProperties();
+ return loader.getPlugin( parent, uri, new Object[]{ args,
manager, model, logger, props } );
}
else
{
@@ -420,7 +423,9 @@
URI uri = new URI( "@DEPOT-PREFS-URI@" );
String title = "Depot Preferences";
boolean command = false;
- return new DefaultApplicationProfile( log, creation, id, title,
null, command, null, uri );
+ Properties args = new Properties();
+ return new DefaultApplicationProfile(
+ log, creation, id, title, null, command, null, uri, args );
}
catch( Exception e )
{
@@ -443,7 +448,9 @@
String title = "Depot Station";
boolean command = false;
Connection connection = new Connection();
- return new DefaultApplicationProfile( log, creation, id, title,
null, command, connection, uri );
+ Properties args = new Properties();
+ return new DefaultApplicationProfile(
+ log, creation, id, title, null, command, connection, uri, args
);
}
catch( Exception e )
{

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
Mon Jun 20 13:32:05 2005
@@ -44,5 +44,9 @@

void setConnection( Connection connection ) throws RemoteException;

+ Properties getProperties() throws RemoteException;
+
+ void setProperties( Properties properties ) throws RemoteException;
+
}


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
Mon Jun 20 13:32:05 2005
@@ -55,15 +55,16 @@

String id = getID();
String title = getTitle();
- Properties properties = getProperties();
+ Properties properties = getSystemProperties();
Connection connection = getConnection();
boolean command = getCommandPolicy();
boolean enabled = getEnabled();
URI uri = getCodeBaseURI();
-
+ Properties args = getProperties();
+
m_profile =
new DefaultApplicationProfile(
- logger, creation, this, id, title, properties, command,
connection, uri, enabled );
+ logger, creation, this, id, title, properties, command,
connection, uri, enabled, args );
}

//
------------------------------------------------------------------------
@@ -113,4 +114,10 @@
throw new ProfileException( error, e );
}
}
+
+ protected Properties getProperties() throws ProfileException
+ {
+ Preferences prefs = getPreferences().node( "properties" );
+ return getProperties( prefs );
+ }
}

Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java
Mon Jun 20 13:32:05 2005
@@ -36,18 +36,20 @@
private boolean m_enabled;
private boolean m_command;
private Connection m_connection;
+ private Properties m_params;

public DefaultApplicationProfile(
Logger logger, Date creation, String id, String title,
- Properties properties, boolean command, Connection connection, URI uri
)
+ Properties properties, boolean command, Connection connection, URI
uri, Properties args )
throws RemoteException
{
- this( logger, creation, null, id, title, properties, command,
connection, uri, true );
+ this( logger, creation, null, id, title, properties, command,
connection, uri, true, args );
}

public DefaultApplicationProfile(
Logger logger, Date creation, ProfileHome home, String id, String
title,
- Properties properties, boolean command, Connection connection, URI
uri, boolean enabled )
+ Properties properties, boolean command, Connection connection, URI
uri,
+ boolean enabled, Properties params )
throws RemoteException
{
super( logger, creation, home, id, title, properties, uri );
@@ -55,6 +57,7 @@
m_enabled = enabled;
m_connection = connection;
m_command = command;
+ m_params = params;
}

//----------------------------------------------------------------------
@@ -91,4 +94,13 @@
m_connection = connection;
}

+ public Properties getProperties() throws RemoteException
+ {
+ return m_params;
+ }
+
+ public void setProperties( Properties args ) throws RemoteException
+ {
+ m_params = args;
+ }
}

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
Mon Jun 20 13:32:05 2005
@@ -52,6 +52,7 @@
super( prefs, logger, creation, policy );
setupTestProfile();
setupMexicoProfile();
+ setupMetroProfile();
ApplicationProfile[] profiles = getApplicationProfiles();
m_depot = new DefaultDepotModel( logger, creation, this, profiles );
}
@@ -122,4 +123,15 @@
prefs.put( "uri",
"artifact:plugin:dpml/test/dpml-test-mexico#SNAPSHOT" );
prefs.put( "title", "Depot Server Test" );
}
+
+ private void setupMetroProfile() throws ProfileException
+ {
+ String id = "metro";
+ Date creation = new Date();
+ Logger logger = getLogger().getChildLogger( id );
+ boolean policy = getStoragePolicy();
+ Preferences prefs = getPreferences().node( "profiles" ).node( id );
+ prefs.put( "uri",
"artifact:plugin:dpml/metro/dpml-metro-main#SNAPSHOT" );
+ prefs.put( "title", "Metro" );
+ }
}

Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/ProfileStorage.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/ProfileStorage.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/ProfileStorage.java
Mon Jun 20 13:32:05 2005
@@ -77,10 +77,15 @@
return getPreferences().get( "title", id );
}

- protected Properties getProperties() throws ProfileException
+ protected Properties getSystemProperties() throws ProfileException
+ {
+ Preferences prefs = getPreferences().node( "system" );
+ return getProperties( prefs );
+ }
+
+ protected Properties getProperties( Preferences prefs ) throws
ProfileException
{
Properties properties = new Properties();
- Preferences prefs = getPreferences().node( "properties" );
try
{
String[] keys = prefs.keys();

Modified:
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupStorage.java
==============================================================================
---
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupStorage.java
(original)
+++
development/main/depot/station/src/main/net/dpml/depot/station/ActivationGroupStorage.java
Mon Jun 20 13:32:05 2005
@@ -55,7 +55,7 @@

String id = getID();
String title = getTitle();
- Properties properties = getProperties();
+ Properties properties = getSystemProperties();
URI uri = getCodeBaseURI();
String classname = getClassname();
CodeBaseProfile[] profiles = getCodeBaseProfiles();

Modified:
development/main/depot/station/src/main/net/dpml/depot/station/ActivationStorage.java
==============================================================================
---
development/main/depot/station/src/main/net/dpml/depot/station/ActivationStorage.java
(original)
+++
development/main/depot/station/src/main/net/dpml/depot/station/ActivationStorage.java
Mon Jun 20 13:32:05 2005
@@ -56,7 +56,7 @@

String id = getID();
String title = getTitle();
- Properties properties = getProperties();
+ Properties properties = getSystemProperties();
URI uri = getCodeBaseURI();
String classname = getClassname();
boolean restart = getRestartPolicy();

Modified: development/main/metro/index.xml
==============================================================================
--- development/main/metro/index.xml (original)
+++ development/main/metro/index.xml Mon Jun 20 13:32:05 2005
@@ -4,6 +4,7 @@

<import uri="${dpml.transit.uri}"/>
<import uri="${dpml.magic.uri}"/>
+ <import uri="${dpml.depot.uri}"/>

<!--
Metro Modules
@@ -18,6 +19,7 @@
<dependencies>
<include key="dpml-transit"/>
<include key="dpml-magic"/>
+ <include key="dpml-depot"/>
</dependencies>
</project>

@@ -127,6 +129,7 @@
<include key="dpml-activity-api" tag="api"/>
<include key="dpml-parameters-api" tag="api"/>
<include key="dpml-configuration-api" tag="api"/>
+ <include key="dpml-depot-console"/>
<include key="dpml-parameters-impl"/>
<include key="dpml-configuration-impl"/>
<include key="commons-cli"/>
@@ -182,6 +185,21 @@
</dependencies>
</project>

+ <project basedir="main">
+ <info>
+ <group>dpml/metro</group>
+ <name>dpml-metro-main</name>
+ <types>
+ <type>jar</type>
+ <type>plugin</type>
+ </types>
+ </info>
+ <dependencies>
+ <include key="dpml-composition-control"/>
+ </dependencies>
+ </project>
+
+
<!-- EXTERNAL RESOURCES -->

<resource>

Added: development/main/metro/main/build.xml
==============================================================================
--- (empty file)
+++ development/main/metro/main/build.xml Mon Jun 20 13:32:05 2005
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="dpml-metro-main" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="package" depends="standard.package">
+ <x:export class="net.dpml.metro.Metro"/>
+ </target>
+
+</project>

Added: development/main/metro/main/src/main/net/dpml/metro/Metro.java
==============================================================================
--- (empty file)
+++ development/main/metro/main/src/main/net/dpml/metro/Metro.java Mon
Jun 20 13:32:05 2005
@@ -0,0 +1,90 @@
+/*
+ * 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.metro;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Hashtable;
+import java.util.Properties;
+import java.util.Map;
+import java.util.prefs.Preferences;
+import java.util.Date;
+
+import net.dpml.composition.data.ComponentProfile;
+import net.dpml.composition.control.CompositionController;
+import net.dpml.composition.control.CompositionManager;
+import net.dpml.composition.model.CompositionModel;
+
+import net.dpml.part.control.ControllerContext;
+
+import net.dpml.transit.adapter.LoggingAdapter;
+import net.dpml.transit.repository.Repository;
+import net.dpml.transit.repository.StandardLoader;
+import net.dpml.transit.model.Logger;
+
+/**
+ * The Metro class is responsible for the establishment of a root metro model
+ * which implies the creation of the controller and initally model
+ * defininition populated in accordance with supplied properties. This
implies
+ * construction of the controller, partition, parent classloader, and initial
+ * deployment profile.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ */
+public class Metro extends CompositionModel
+{
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ public Metro( Logger logger, Properties properties ) throws Exception
+ {
+ super(
+ getController( logger, properties ),
+ getPartition( logger, properties ),
+ getClassLoader( logger, properties ),
+ getComponentProfile( logger, properties )
+ );
+ }
+
+ //------------------------------------------------------------------
+ // internal
+ //------------------------------------------------------------------
+
+ private static CompositionController getController( Logger logger,
Properties properties )
+ {
+ throw new UnsupportedOperationException( "getController/2" );
+ }
+
+ private static URI getPartition( Logger logger, Properties properties )
+ {
+ throw new UnsupportedOperationException( "getPartition/2" );
+ }
+
+ private static ClassLoader getClassLoader( Logger logger, Properties
properties )
+ {
+ throw new UnsupportedOperationException( "getClassLoader/2" );
+ }
+
+ private static ComponentProfile getComponentProfile( Logger logger,
Properties properties )
+ {
+ throw new UnsupportedOperationException( "getComponentProfile/2" );
+ }
+}



  • svn commit: r2897 - in development/main: depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/profile depot/station/src/main/net/dpml/depot/station metro metro/main metro/main/src metro/main/src/main metro/main/src/main/net metro/main/src/main/net/dpml metro/main/src/main/net/dpml/metro, mcconnell, 06/20/2005

Archive powered by MHonArc 2.6.24.

Top of Page