Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2925 - in development/laboratory/users/niclas/osgi/metro: activation/impl/src/main/net/dpml/activation/impl composition/impl/src/main/net/dpml/composition/model/impl main main/src/main/net/dpml/metro/commands

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT hedhman.org
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2925 - in development/laboratory/users/niclas/osgi/metro: activation/impl/src/main/net/dpml/activation/impl composition/impl/src/main/net/dpml/composition/model/impl main main/src/main/net/dpml/metro/commands
  • Date: Mon, 27 Jun 2005 01:16:31 -0400

Author: niclas AT hedhman.org
Date: Mon Jun 27 01:16:31 2005
New Revision: 2925

Modified:

development/laboratory/users/niclas/osgi/metro/activation/impl/src/main/net/dpml/activation/impl/DefaultRuntime.java

development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java

development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
development/laboratory/users/niclas/osgi/metro/main/build.xml

development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/DeployCommand.java

development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ListCommand.java

development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ShowCommand.java

development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/UndeployCommand.java
Log:
Need to commit a known state, so I can experiment with the removal of
DefaultRuntime, since it seems not used as intended anyway.

Modified:
development/laboratory/users/niclas/osgi/metro/activation/impl/src/main/net/dpml/activation/impl/DefaultRuntime.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/activation/impl/src/main/net/dpml/activation/impl/DefaultRuntime.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/activation/impl/src/main/net/dpml/activation/impl/DefaultRuntime.java
Mon Jun 27 01:16:31 2005
@@ -164,6 +164,9 @@
}
else
{
+ // THIS CODE NEVER WORKED!!!!!
+ // The Plugin exported is of type Runtime, but is here casted to
RuntimeFactory.
+ // Don't ask me how this was supposed to work.
try
{
ClassLoader classloader = Appliance.class.getClassLoader();
@@ -171,7 +174,13 @@
Object[] params = new Object[]{};

Repository repository = new StandardLoader();
- m_metro = (RuntimeFactory) repository.getPlugin(
classloader, uri, params );
+ System.out.println( "NICLAS: Plugin URI = " + uri );
+ for( int i=0 ; i < params.length; i++ )
+ System.out.println( " params[ " + i + " ] = " +
params[i] );
+ Object plugin = repository.getPlugin( classloader, uri,
params );
+ System.out.println( "NICLAS: Plugin = " + plugin );
+ System.out.println( "NICLAS: Plugin " + plugin.getClass() );
+ m_metro = (RuntimeFactory) plugin;
return m_metro;
}
catch( Throwable e )

Modified:
development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModelAssemblyHelper.java
Mon Jun 27 01:16:31 2005
@@ -253,10 +253,7 @@
DeploymentModel model = m_model.getModel( path );
if( null == model )
{
- final String error =
- "The supplied dependency path ["
- + path
- + "] does not reference a known component.";
+ final String error = "The supplied dependency path [" + path
+ "] does not reference a known component.";
throw new AssemblyException( error );
}
assembleModel( model, subjects );

Modified:
development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDependencyModel.java
Mon Jun 27 01:16:31 2005
@@ -44,8 +44,7 @@
// static
//--------------------------------------------------------------

- private static final Resources REZ =
- ResourceManager.getPackageResources(
DefaultDependencyModel.class );
+ private static final Resources REZ =
ResourceManager.getPackageResources( DefaultDependencyModel.class );

//--------------------------------------------------------------
// immutable state
@@ -76,8 +75,7 @@
* @exception NullArgumentException if either the logger argument or the
* descriptor argument is null.
*/
- public DefaultDependencyModel( Logger logger, String partition,
- DependencyDescriptor descriptor,
DependencyDirective directive )
+ public DefaultDependencyModel( Logger logger, String partition,
DependencyDescriptor descriptor, DependencyDirective directive )
throws NullArgumentException
{
if( descriptor == null )
@@ -269,7 +267,9 @@
}
else
{
- return partition + path;
+ System.out.println( "Niclas: Partition:" + partition );
+ System.out.println( "NICLAS: Path:" + path );
+ return path;
}
}

@@ -290,8 +290,7 @@
}
else
{
- final String error =
- "Illegal attempt to reference a containment context above the
root context.";
+ final String error = "Illegal attempt to reference a containment
context above the root context.";
throw new IllegalArgumentException( error );
}
}

Modified: development/laboratory/users/niclas/osgi/metro/main/build.xml
==============================================================================
--- development/laboratory/users/niclas/osgi/metro/main/build.xml
(original)
+++ development/laboratory/users/niclas/osgi/metro/main/build.xml Mon
Jun 27 01:16:31 2005
@@ -53,7 +53,7 @@
<attribute name="Bundle-UpdateLocation"
value="http://repository.dpml.net/classic/dpml/metro/tools/jars/dpml-metro-main.jar"/>
<attribute name="Bundle-Vendor" value="DPML"/>
<attribute name="Bundle-Version" value="${version}"/>
- <attribute name="Import-Package" value="org.osgi.service.log,
org.osgi.service.cm"/>
+ <attribute name="Import-Package" value="org.osgi.service.log,
org.osgi.service.cm, org.knopflerfish.service.console"/>
</manifest>
</target>


Modified:
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/DeployCommand.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/DeployCommand.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/DeployCommand.java
Mon Jun 27 01:16:31 2005
@@ -60,10 +60,12 @@
} catch( ModelException e )
{
output.println( "Error: Unable to add the block " + blockUrl + "
with the override targets " + targetsUrl + " into " + container );
+ e.printStackTrace();
return null;
} catch( Exception e )
{
output.println( "Error: Unable to commission " + newContainer );
+ e.printStackTrace();
return null;
}
}
@@ -71,6 +73,10 @@
private URL resolveURL( String value )
throws IOException
{
+ if( value == null )
+ {
+ return null;
+ }
if( value.startsWith( "artifact:" ) )
{
return artifactSpecToURL( value );

Modified:
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ListCommand.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ListCommand.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ListCommand.java
Mon Jun 27 01:16:31 2005
@@ -15,7 +15,7 @@
{
output.println();
String[] selection = (String[]) opts.get("selection");
- if( selection.length == 0 )
+ if( selection == null || selection.length == 0 )
{
selection = new String[] { current.getQualifiedName() };
}
@@ -26,7 +26,7 @@
if( model instanceof ContainmentModel )
{
DeploymentModel[] models = ((ContainmentModel)
model).getModels();
- for( int j = 0; i < models.length; i++ )
+ for( int j = 0; j < models.length; j++ )
{
DeploymentModel m = models[ j ];
output.write( m.toString() );

Modified:
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ShowCommand.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ShowCommand.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/ShowCommand.java
Mon Jun 27 01:16:31 2005
@@ -30,29 +30,34 @@
{
String LINE =
"\n-----------------------------------------------------------";

+ // NOTE!! It is not semantically correct to change the print("\n") to
println(), as the latter
+ // will cause a "flush()", which indicates to some connectivity
drivers that a packet should
+ // be sent to the console.
+ //
+
public int execute( ContainmentModel current, Dictionary opts, Reader
in, PrintWriter output, Session session )
{
String path = (String) opts.get( "path" );
- output.println();
+ output.print( "\n" );
if( path == null )
path = current.getPath();
DeploymentModel model = current.getModel( path );
printModel( output, model );
- output.println();
+ output.print( "\n" );
output.flush();
return 0; // SUCCESS
}

public void printModel( PrintWriter output, DeploymentModel model )
{
- output.println( "audit report" );
- output.println( LINE );
- output.println( "\nApplication Model" );
- output.println( LINE );
- output.println( "\n" );
+ output.print( "audit report" );
+ output.print( LINE );
+ output.print( "\nApplication Model" );
+ output.print( LINE );
+ output.print( "\n" );
printModel( output, " ", model );
- output.println( "\n" );
- output.println( LINE );
+ output.print( "\n" );
+ output.print( LINE );
}

public void printModel( PrintWriter output, String lead, DeploymentModel
model )
@@ -69,12 +74,12 @@

public void printContainmentModel( PrintWriter output, String lead,
ContainmentModel model )
{
- output.println( "\n" + lead + "container:" + model + ")" );
+ output.print( "\n" + lead + "container:" + model + ")" );
printDeploymentModel( output, lead, model );
DeploymentModel[] models = model.getModels();
if( models.length > 0 )
{
- output.println( "\n" + lead + " children:" );
+ output.print( "\n" + lead + " children:" );
for( int i=0; i<models.length; i++ )
{
DeploymentModel m = models[i];
@@ -84,28 +89,28 @@
models = model.getStartupGraph();
if( models.length > 0 )
{
- output.println( "\n" + lead + " startup:" );
+ output.print( "\n" + lead + " startup:" );
for( int i=0; i<models.length; i++ )
{
DeploymentModel m = models[i];
- output.println( "\n" + " " + lead + (i+1) + ": " + m );
+ output.print( "\n" + " " + lead + (i+1) + ": " + m );
}
}
models = ((ContainmentModel)model).getShutdownGraph();
if( models.length > 0 )
{
- output.println( "\n" + lead + " shutdown:" );
+ output.print( "\n" + lead + " shutdown:" );
for( int i=0; i<models.length; i++ )
{
DeploymentModel m = models[i];
- output.println( "\n" + " " + lead + (i+1) + ": " + m );
+ output.print( "\n" + " " + lead + (i+1) + ": " + m );
}
}
}

public void printComponentModel( PrintWriter output, String lead,
ComponentModel model )
{
- output.println( "\n" + lead + "component:" + model + "(" +
model.getDeploymentTimeout() + ")" );
+ output.print( "\n" + lead + "component:" + model + "(" +
model.getDeploymentTimeout() + ")" );
printDeploymentModel( output, lead, model );
}

@@ -122,7 +127,7 @@
if( providers.length > 0 ) for( int i=0; i<providers.length; i++ )
{
DeploymentModel m = providers[i];
- output.println( "\n" + lead + " <-- consumes: " + m );
+ output.print( "\n" + lead + " <-- consumes: " + m );
}

if( consumers.length > 0 ) for( int i=0; i<consumers.length; i++ )
@@ -130,7 +135,7 @@
DeploymentModel m = consumers[i];
if( isDirectProvider( m, model ) )
{
- output.println( "\n" + lead + " --> supplies: " + m );
+ output.print( "\n" + lead + " --> supplies: " + m );
}
}
}

Modified:
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/UndeployCommand.java
==============================================================================
---
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/UndeployCommand.java
(original)
+++
development/laboratory/users/niclas/osgi/metro/main/src/main/net/dpml/metro/commands/UndeployCommand.java
Mon Jun 27 01:16:31 2005
@@ -31,8 +31,11 @@
String name = container.getName();
String path = container.getPath();
ContainmentModel parent = (ContainmentModel) root.getModel( path );
- container.decommission();
- container.disassemble();
+ if( container.isAssembled() )
+ {
+ container.decommission();
+ container.disassemble();
+ }
parent.removeModel( name );

output.println();



  • svn commit: r2925 - in development/laboratory/users/niclas/osgi/metro: activation/impl/src/main/net/dpml/activation/impl composition/impl/src/main/net/dpml/composition/model/impl main main/src/main/net/dpml/metro/commands, niclas, 06/27/2005

Archive powered by MHonArc 2.6.24.

Top of Page