Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2896 - in development/main: depot/console/etc/bin depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/lang depot/console/src/main/net/dpml/depot/logging depot/console/src/main/net/dpml/depot/profile depot/test/mexico depot/test/mexico/src/main/net/dpml/test/mexico metro metro/composition/builder/src/main/net/dpml/composition/builder/datatypes metro/composition/control metro/composition/control/src/main/net/dpml/composition/control metro/composition/control/src/main/net/dpml/composition/event metro/composition/control/src/main/net/dpml/composition/model metro/composition/part/src/main/net/dpml/composition/part metro/part/src/main/net/dpml/part/control metro/part/src/main/net/dpml/part/model metro/part/src/main/net/dpml/part/state test/unit transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/model transit/core/handler/src/main/net/dpml/transit/unit transit/core/handler/src/main/net/dpml/transit/util

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: r2896 - in development/main: depot/console/etc/bin depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/lang depot/console/src/main/net/dpml/depot/logging depot/console/src/main/net/dpml/depot/profile depot/test/mexico depot/test/mexico/src/main/net/dpml/test/mexico metro metro/composition/builder/src/main/net/dpml/composition/builder/datatypes metro/composition/control metro/composition/control/src/main/net/dpml/composition/control metro/composition/control/src/main/net/dpml/composition/event metro/composition/control/src/main/net/dpml/composition/model metro/composition/part/src/main/net/dpml/composition/part metro/part/src/main/net/dpml/part/control metro/part/src/main/net/dpml/part/model metro/part/src/main/net/dpml/part/state test/unit transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/model transit/core/handler/src/main/net/dpml/transit/unit transit/core/handler/src/main/net/dpml/transit/util
  • Date: Mon, 20 Jun 2005 11:02:59 -0400

Author: mcconnell AT dpml.net
Date: Mon Jun 20 11:02:59 2005
New Revision: 2896

Removed:
development/main/depot/console/etc/bin/dpml-depot.exe

development/main/depot/console/src/main/net/dpml/depot/logging/ExceptionHelper.java

development/main/depot/console/src/main/net/dpml/depot/logging/StationConfigurationHandler.java

development/main/metro/composition/part/src/main/net/dpml/composition/part/CompositionContentHandlerModel.java

development/main/metro/composition/part/src/main/net/dpml/composition/part/CompositionContentHandlerStorageUnit.java
Modified:
development/main/depot/console/etc/bin/depot.bat
development/main/depot/console/etc/bin/rmid-process.bat
development/main/depot/console/src/main/net/dpml/depot/Main.java

development/main/depot/console/src/main/net/dpml/depot/lang/DepotRMIClassLoaderSpi.java

development/main/depot/console/src/main/net/dpml/depot/logging/ConfigurationHandler.java

development/main/depot/console/src/main/net/dpml/depot/logging/StandardFormatter.java

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

development/main/depot/console/src/main/net/dpml/depot/profile/DepotStorage.java
development/main/depot/test/mexico/build.xml

development/main/depot/test/mexico/src/main/net/dpml/test/mexico/Server.java

development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/PartDataType.java
development/main/metro/composition/control/build.xml

development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java

development/main/metro/composition/control/src/main/net/dpml/composition/control/ValueController.java

development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/AbstractComponent.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/Appliance.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentEntry.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentTable.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/CompositionModel.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/ContextTable.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/PartsTable.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/ReferenceEntry.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueEntry.java

development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueModel.java

development/main/metro/composition/part/src/main/net/dpml/composition/part/CompositionContentHandler.java
development/main/metro/index.xml
development/main/metro/part/src/main/net/dpml/part/control/Control.java
development/main/metro/part/src/main/net/dpml/part/control/Controller.java

development/main/metro/part/src/main/net/dpml/part/control/Identifiable.java
development/main/metro/part/src/main/net/dpml/part/control/Manager.java
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java

development/main/metro/part/src/main/net/dpml/part/control/SystemManager.java
development/main/metro/part/src/main/net/dpml/part/model/Component.java
development/main/metro/part/src/main/net/dpml/part/model/Model.java
development/main/metro/part/src/main/net/dpml/part/model/Provider.java
development/main/metro/part/src/main/net/dpml/part/state/Operation.java
development/main/metro/part/src/main/net/dpml/part/state/State.java
development/main/metro/part/src/main/net/dpml/part/state/StateListener.java
development/main/metro/part/src/main/net/dpml/part/state/Transition.java
development/main/test/unit/index.xml

development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java

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

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

development/main/transit/core/handler/src/main/net/dpml/transit/unit/ContentRegistryStorageUnit.java

development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
Log:
Updates to metro to support remote access to the component model.

Modified: development/main/depot/console/etc/bin/depot.bat
==============================================================================
--- development/main/depot/console/etc/bin/depot.bat (original)
+++ development/main/depot/console/etc/bin/depot.bat Mon Jun 20 11:02:59
2005
@@ -30,3 +30,5 @@
:EndOfScript

endlocal
+
+rem
\ No newline at end of file

Modified: development/main/depot/console/etc/bin/rmid-process.bat
==============================================================================
--- development/main/depot/console/etc/bin/rmid-process.bat (original)
+++ development/main/depot/console/etc/bin/rmid-process.bat Mon Jun 20
11:02:59 2005
@@ -24,7 +24,7 @@

:RUN_RMID
@echo on
-rmid -log %DPML_HOME%\Data\logs\rmid -J%$POLICY% -J%$BOOTCLASSPATH%
-J%$TRACE% -J%$TRANSIT%
+rmid -log %DPML_HOME%\Data\logs\rmid -J%$BOOTCLASSPATH% -J%$POLICY%
-J%$TRANSIT% -J%$TRACE%
@echo off

goto EndOfScript

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 11:02:59 2005
@@ -26,6 +26,7 @@
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.rmi.Remote;
+import java.rmi.MarshalledObject;
import java.rmi.NotBoundException;
import java.rmi.activation.ActivationSystem;
import java.rmi.ConnectException;
@@ -42,6 +43,7 @@
import net.dpml.transit.TransitError;
import net.dpml.transit.TransitException;
import net.dpml.transit.adapter.LoggingAdapter;
+import net.dpml.transit.artifact.Artifact;
import net.dpml.transit.home.TransitHome;
import net.dpml.transit.model.Logger;
import net.dpml.transit.model.Connection;
@@ -91,9 +93,7 @@
String arg = args[i];
if( arg.equals( "-station" ) )
{
- System.setProperty(
- "java.util.logging.config.class",
- "net.dpml.depot.logging.StationConfigurationHandler" );
+ System.setProperty( "dpml.system.group", "station" );
break;
}
}
@@ -245,36 +245,39 @@
}
Properties properties = profile.getSystemProperties();
applySystemProperties( properties );
- DepotClassLoader system = getSystemClassLoader();
- //Connection connection = profile.getConnection();
- //Registry registry = getRegistry( connection, true );
-
+ ClassLoader system = getSystemClassLoader();
URI uri = profile.getCodeBaseURI();
try
{
String id = profile.getID();
- Transit transit = Transit.getInstance( model );
Logger log = logger.getChildLogger( id );
- Repository loader = transit.getRepository();
- Object object = loader.getPlugin( system, uri, new Object[]{
args, manager, model, log } );
- //if( registry != null )
- //{
- // registry.bind( id, (Remote) object );
- // if( null == connection.getHost() )
- // {
- // logger.info(
- // "service bound to "
- // + connection.getPort() + "/" + id );
- // }
- // else
- // {
- // logger.info(
- // "service bound to " + connection.getHost()
- // + ":" + connection.getPort() + "/" + id );
- // }
- //}
- //else
- if( object instanceof Runnable )
+
+ Object object = resolveTargetObject( system, uri, args,
manager, model, log );
+
+ Connection connection = profile.getConnection();
+ if( null != connection )
+ {
+ logger.info( "service is requesting a connection" );
+ logger.info( "host: " + connection.getHost() );
+ logger.info( "port: " + connection.getPort() );
+
+ Registry registry = getRegistry( connection, true );
+
+ registry.bind( id, (Remote) object );
+ if( null == connection.getHost() )
+ {
+ logger.info(
+ "service bound to "
+ + connection.getPort() + "/" + id );
+ }
+ else
+ {
+ logger.info(
+ "service bound to " + connection.getHost()
+ + ":" + connection.getPort() + "/" + id );
+ }
+ }
+ else if( object instanceof Runnable )
{
//
// run the plugin
@@ -298,13 +301,6 @@
getLogger().error( error, e );
throw new HandledError();
}
- catch( TransitException e )
- {
- final String error =
- "Cannot load profile to an Transit error.";
- getLogger().error( error, e );
- throw new HandledError();
- }
catch( Throwable e )
{
final String error =
@@ -330,6 +326,43 @@
}
}

+ private static Object resolveTargetObject(
+ ClassLoader parent, URI uri, String[] args, DepotModel manager,
TransitModel model, Logger logger )
+ throws HandledError
+ {
+ try
+ {
+ Transit transit = Transit.getInstance( model );
+ Repository loader = transit.getRepository();
+
+ Artifact artifact = Artifact.createArtifact( uri );
+ String type = artifact.getType();
+ if( "plugin".equals( type ) )
+ {
+ return loader.getPlugin( parent, uri, new Object[]{ args,
manager, model, logger } );
+ }
+ else
+ {
+ final String error =
+ "Artifact type [" + type + "] is not supported.";
+ getLogger().error( error );
+ throw new HandledError();
+ }
+ }
+ catch( HandledError e )
+ {
+ throw e;
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to deploy object."
+ + "\nURI: " + uri;
+ getLogger().error( error, e );
+ throw new HandledError();
+ }
+ }
+
private static void handleGet( Logger logger, String[] args, String path
) throws HandledError
{
TransitModel model = loadTransitModel( args, logger, false );
@@ -418,10 +451,11 @@
"Unexpected exception while attempting to construct the
station profile.";
getLogger().error( error, e );
throw new HandledError();
- }
+ }
}

- public static Registry getRegistry( Connection connection, boolean
create ) throws RemoteException, ConnectException
+ public static Registry getRegistry( Connection connection, boolean
create )
+ throws RemoteException, ConnectException
{
if( null == connection )
{
@@ -434,23 +468,19 @@

if( ( null == host ) || ( "localhost".equals( host ) ) )
{
-
- try
+ if( false == create )
{
return getLocalRegistry( port );
}
+ try
+ {
+ Registry registry = LocateRegistry.createRegistry( port
);
+ getLogger().info( "created local registry on port " +
port );
+ return registry;
+ }
catch( RemoteException e )
{
- if( create )
- {
- Registry registry = LocateRegistry.createRegistry(
port );
- getLogger().debug( "created local registry on port "
+ port );
- return registry;
- }
- else
- {
- throw e;
- }
+ return getLocalRegistry( port );
}
}
else
@@ -473,7 +503,7 @@
private static Registry getLocalRegistry( int port ) throws
RemoteException
{
Registry registry = LocateRegistry.getRegistry( port );
- getLogger().debug( "using local registry on port " + port );
+ getLogger().info( "using local registry on port " + port );
return registry;
}

@@ -499,22 +529,9 @@
}
}

- private static DepotClassLoader getSystemClassLoader()
+ private static ClassLoader getSystemClassLoader()
{
- try
- {
- return (DepotClassLoader) ClassLoader.getSystemClassLoader();
- }
- catch( ClassCastException e )
- {
- final String error =
- "The Depot console must be invoked with the
\"java.system.class.loader\" "
- + "system property with the value of \""
- + DepotClassLoader.class.getName()
- + "\".";
- getLogger().error( error );
- throw new HandledError();
- }
+ return ClassLoader.getSystemClassLoader();
}

private static void clearPreferences( Class c )
@@ -717,7 +734,7 @@
"Unexpected error while attempting to construct the transit
model.";
getLogger().error( error, e );
throw new HandledError();
- }
+ }
}

private static TransitModel createTransitModel( String[] args, Logger
logger )
@@ -747,7 +764,7 @@
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( "java.rmi.server.RMIClassLoaderSpi",
"net.dpml.depot.lang.DepotRMIClassLoaderSpi" );
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() );

Modified:
development/main/depot/console/src/main/net/dpml/depot/lang/DepotRMIClassLoaderSpi.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/lang/DepotRMIClassLoaderSpi.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/lang/DepotRMIClassLoaderSpi.java
Mon Jun 20 11:02:59 2005
@@ -35,7 +35,14 @@
private RMIClassLoaderSpi m_delegate =
RMIClassLoader.getDefaultProviderInstance();

- private Logger m_logger = setupLogger();
+ private Logger m_logger;
+
+ public DepotRMIClassLoaderSpi()
+ {
+ super();
+ m_logger = setupLogger();
+ m_logger.debug( "classloader spi established" );
+ }

/**
* Provides the implementation for
@@ -66,7 +73,10 @@
{
if( null != codebase )
{
- getLogger().info( "Loading: " + name );
+ final String message =
+ "Loading class: " + name
+ + "\nCodebase: " + codebase;
+ getLogger().info( message );
}
return m_delegate.loadClass( codebase, name, defaultLoader );
}

Modified:
development/main/depot/console/src/main/net/dpml/depot/logging/ConfigurationHandler.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/logging/ConfigurationHandler.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/logging/ConfigurationHandler.java
Mon Jun 20 11:02:59 2005
@@ -38,9 +38,8 @@
*/
public ConfigurationHandler()
{
- Preferences prefs = Preferences.userNodeForPackage( getClass()
).node( "nodes" );
- String defaultLevel = prefs.get( "level", "INFO" );
- String rootLevel = System.getProperty( "dpml.logging.level",
defaultLevel ).toUpperCase();
+ String group = System.getProperty( "dpml.system.group", "root" );
+ String level = System.getProperty( "dpml.logging.level", "INFO"
).toUpperCase();

Properties properties = new Properties();
properties.setProperty(
@@ -54,24 +53,23 @@
// set the file handler properties
//

- properties.setProperty( "java.util.logging.FileHandler.pattern",
"%h/java%u.log" );
+ properties.setProperty( "java.util.logging.FileHandler.pattern",
"%h/" + group + "%u.log" );
properties.setProperty( "java.util.logging.FileHandler.limit",
"50000" );
properties.setProperty( "java.util.logging.FileHandler.count", "1" );
- properties.setProperty( "java.util.logging.FileHandler.formatter",
"java.util.logging.XMLFormatter" );
+ properties.setProperty(
+ "java.util.logging.FileHandler.formatter",
"net.dpml.depot.logging.StandardFormatter" );

//
// set the default level by setting the root logger level
//

- properties.setProperty( ".level", rootLevel );
+ properties.setProperty( ".level", level );

//
// set the level that the console handler will handle
//

- properties.setProperty(
- "java.util.logging.ConsoleHandler.level",
- "FINEST" );
+ properties.setProperty( "java.util.logging.ConsoleHandler.level",
"FINEST" );

try
{

Modified:
development/main/depot/console/src/main/net/dpml/depot/logging/StandardFormatter.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/logging/StandardFormatter.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/logging/StandardFormatter.java
Mon Jun 20 11:02:59 2005
@@ -21,15 +21,14 @@
import java.util.logging.Formatter;
import java.util.logging.LogRecord;

+import net.dpml.transit.util.ExceptionHelper;

/**
* Logging message formatter that includes the category in the logging
statement.
*/
public class StandardFormatter extends Formatter
{
- private String lineSeparator =
- (String) java.security.AccessController.doPrivileged(
- new sun.security.action.GetPropertyAction("line.separator"));
+ private String lineSeparator = System.getProperty( "line.separator");

/**
* Format a LogRecord using the classic style.

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 11:02:59 2005
@@ -59,7 +59,7 @@
Connection connection = getConnection();
boolean command = getCommandPolicy();
boolean enabled = getEnabled();
- URI uri = getPluginURI();
+ URI uri = getCodeBaseURI();

m_profile =
new DefaultApplicationProfile(
@@ -75,33 +75,6 @@
return m_profile;
}

- protected URI getPluginURI() throws ProfileException
- {
- Preferences prefs = getPreferences();
- String path = prefs.get( "plugin", null );
- if( null != path )
- {
- try
- {
- return new URI( path );
- }
- catch( URISyntaxException e )
- {
- final String error =
- "Plugin application profile contains an invalid uri value."
- + "\nURI: " + path;
- throw new ProfileException( error, e );
- }
- }
- else
- {
- final String error =
- "Requested plugin profile '" + prefs
- + "' does not declare a plugin uri attribute.";
- throw new ProfileException( error );
- }
- }
-
protected boolean getEnabled()
{
Preferences prefs = getPreferences();

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 11:02:59 2005
@@ -51,6 +51,7 @@
{
super( prefs, logger, creation, policy );
setupTestProfile();
+ setupMexicoProfile();
ApplicationProfile[] profiles = getApplicationProfiles();
m_depot = new DefaultDepotModel( logger, creation, this, profiles );
}
@@ -95,7 +96,6 @@
Logger logger = getLogger().getChildLogger( id );
boolean policy = getStoragePolicy();
Date creation = getCreationDate();
- String path = prefs.get( "plugin", null );
ApplicationProfileStorage store = new ApplicationProfileStorage(
prefs, logger, creation, policy );
return store.getApplicationProfile();
}
@@ -107,10 +107,19 @@
Logger logger = getLogger().getChildLogger( id );
boolean policy = getStoragePolicy();
Preferences prefs = getPreferences().node( "profiles" ).node( id );
- prefs.put( "plugin", "@TEST-PLUGIN-URI@" );
- prefs.put( "title", "Depot Station Test" );
+ prefs.put( "uri", "@TEST-PLUGIN-URI@" );
+ prefs.put( "title", "Depot Cient Test" );
prefs.putBoolean( "command", true );
- //ApplicationProfileStorage store = new ApplicationProfileStorage(
prefs, logger, creation, policy );
- //return store.getApplicationProfile();
+ }
+
+ private void setupMexicoProfile() throws ProfileException
+ {
+ String id = "mexico";
+ Date creation = getCreationDate();
+ Logger logger = getLogger().getChildLogger( id );
+ boolean policy = getStoragePolicy();
+ Preferences prefs = getPreferences().node( "profiles" ).node( id );
+ prefs.put( "uri",
"artifact:plugin:dpml/test/dpml-test-mexico#SNAPSHOT" );
+ prefs.put( "title", "Depot Server Test" );
}
}

Modified: development/main/depot/test/mexico/build.xml
==============================================================================
--- development/main/depot/test/mexico/build.xml (original)
+++ development/main/depot/test/mexico/build.xml Mon Jun 20 11:02:59
2005
@@ -13,4 +13,8 @@
</rmic>
</target>

+ <target name="package" depends="standard.package">
+ <x:export class="net.dpml.test.mexico.Server"/>
+ </target>
+
</project>

Modified:
development/main/depot/test/mexico/src/main/net/dpml/test/mexico/Server.java
==============================================================================
---
development/main/depot/test/mexico/src/main/net/dpml/test/mexico/Server.java
(original)
+++
development/main/depot/test/mexico/src/main/net/dpml/test/mexico/Server.java
Mon Jun 20 11:02:59 2005
@@ -5,23 +5,21 @@
import java.rmi.RemoteException;
import java.rmi.MarshalledObject;
import java.rmi.server.UnicastRemoteObject;
-import java.rmi.activation.Activatable;
-import java.rmi.activation.ActivationID;

import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.LinkedList;
import java.util.prefs.Preferences;

-public class Server extends Activatable implements Service
+public class Server extends UnicastRemoteObject implements Service
{
private int m_count = 0;
private final Logger m_logger = Logger.getLogger( "mexico" );
private LinkedList m_listeners = new LinkedList();

- public Server( ActivationID id, MarshalledObject data ) throws
RemoteException
+ public Server() throws RemoteException
{
- super( id, 0 );
+ super();
Preferences prefs = Preferences.userNodeForPackage( Server.class );
m_count = prefs.getInt( "count", 0 );
}

Modified:
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/PartDataType.java
==============================================================================
---
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/PartDataType.java
(original)
+++
development/main/metro/composition/builder/src/main/net/dpml/composition/builder/datatypes/PartDataType.java
Mon Jun 20 11:02:59 2005
@@ -22,13 +22,14 @@
import java.net.URI;
import java.net.URISyntaxException;

+import net.dpml.composition.builder.PartReferenceBuilder;
+import net.dpml.composition.control.CompositionPartHandler;
+import net.dpml.composition.info.Type;
+
import net.dpml.part.control.DelegationException;
import net.dpml.part.control.PartNotFoundException;
import net.dpml.part.part.Part;
import net.dpml.part.part.PartReference;
-import net.dpml.composition.builder.PartReferenceBuilder;
-import net.dpml.composition.control.CompositionPartHandler;
-import net.dpml.composition.info.Type;

import org.apache.tools.ant.BuildException;

@@ -124,9 +125,9 @@
{
String key = getKey();
URI uri = getURI();
- CompositionPartHandler handler = new CompositionPartHandler();
try
{
+ CompositionPartHandler handler = new CompositionPartHandler();
return handler.loadPart( uri );
}
catch( PartNotFoundException pnfe )

Modified: development/main/metro/composition/control/build.xml
==============================================================================
--- development/main/metro/composition/control/build.xml (original)
+++ development/main/metro/composition/control/build.xml Mon Jun 20
11:02:59 2005
@@ -17,6 +17,16 @@
<x:path id="build.path"/>
<rmic base="${basedir}/target/classes" classpathref="build.path">
<include name="**/DefaultControllerModel.class"/>
+ <include name="**/CompositionManager.class"/>
+ <include name="**/CompositionController.class"/>
+ <include name="**/CompositionPartHandler.class"/>
+ <include name="**/CompositionModel.class"/>
+ <include name="**/ComponentEntry.class"/>
+ <include name="**/ComponentController.class"/>
+ <include name="**/ReferenceEntry.class"/>
+ <include name="**/ValueController.class"/>
+ <include name="**/ValueModel.class"/>
+ <include name="**/ValueEntry.class"/>
</rmic>
</target>


Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/ComponentController.java
Mon Jun 20 11:02:59 2005
@@ -35,11 +35,12 @@
import java.lang.reflect.Proxy;
import java.net.URI;
import java.net.URISyntaxException;
+import java.rmi.server.UnicastRemoteObject;
+import java.rmi.RemoteException;
import java.util.Observable;

import javax.swing.event.ChangeEvent;

-
import net.dpml.composition.model.CompositionModel;
import net.dpml.composition.model.ComponentEntry;

@@ -67,7 +68,7 @@
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public class ComponentController implements Manager
+public class ComponentController extends UnicastRemoteObject implements
Manager
{
private final Map m_handlers = new Hashtable();
private final LifecycleHandler m_lifecycleHandler;
@@ -76,8 +77,10 @@
private final CompositionController m_controller;
private final Monitor m_monitor;

- public ComponentController( Monitor monitor, CompositionController
controller )
+ public ComponentController( Monitor monitor, CompositionController
controller ) throws RemoteException
{
+ super();
+
m_controller = controller;
m_monitor = monitor;
m_lifecycleHandler = new LifecycleHandler( monitor );
@@ -86,12 +89,12 @@
m_uri = CompositionController.createURI( "manager", path );
}

- public URI getURI()
+ public URI getURI() throws RemoteException
{
return m_uri;
}

- public String getName()
+ public String getName() throws RemoteException
{
return getClass().getName();
}
@@ -142,7 +145,7 @@
*
* @param proxy the proxy to release
*/
- public void release( Object proxy )
+ public void release( Object proxy ) throws RemoteException
{
if( null == proxy )
{
@@ -258,7 +261,7 @@
component.setInitialized( true );
}

- private Object getInstance( ComponentEntry component )
+ private Object getInstance( ComponentEntry component ) throws
RemoteException
{
Object instance = component.getLocalInstance();
if( null == instance)
@@ -282,7 +285,7 @@
return instance;
}

- private void validate( Class subject, State state ) throws
ValidationException
+ private void validate( Class subject, State state ) throws
ValidationException, RemoteException
{
if( null == state )
{
@@ -604,6 +607,7 @@
* @return the populated object array
*/
private Object[] resolveArguments( ComponentEntry entry, Class[]
parameters, State state, State target )
+ throws RemoteException
{
Object instance = getInstance( entry );
boolean firstStateAssigned = false;
@@ -658,7 +662,7 @@
* non-terminal state the procedure will be repeated. If the current
state
* is a terminal state the operation simply returns.
*/
- public synchronized void terminate( Component component )
+ public synchronized void terminate( Component component ) throws
RemoteException
{
if( component instanceof ComponentEntry )
{

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionController.java
Mon Jun 20 11:02:59 2005
@@ -93,6 +93,7 @@
CompositionController( ControllerContext context ) throws RemoteException
{
super();
+
m_logger = getLoggerForURI( context.getURI() );
m_logger.info( "metro controller established" );
m_monitor = new DefaultMonitor( m_logger );
@@ -126,7 +127,7 @@
* Load the model controller.
* @return the controller
*/
- public Controller getController()
+ public Controller getController() throws RemoteException
{
return getCompositionController();
}
@@ -159,7 +160,7 @@
* @return the resource
* @exception IllegalArgumentException if the urn is not recognized
*/
- public Object getResource( Model model, URI urn )
+ public Object getResource( Model model, URI urn ) throws RemoteException
{
String scheme = urn.getScheme();
String key = urn.getSchemeSpecificPart();
@@ -237,7 +238,7 @@
}
}

- public String getName()
+ public String getName() throws RemoteException
{
return getPartition().toASCIIString();
}
@@ -260,7 +261,7 @@
*/
public Model getModel( URI uri )
throws IOException, DelegationException, ModelException,
PartNotFoundException,
- HandlerNotFoundException, DelegationException
+ HandlerNotFoundException, DelegationException, RemoteException
{
return getModel( uri, null );
}
@@ -274,7 +275,7 @@
*/
public Model getModel( URI uri, String key )
throws IOException, DelegationException, ModelException,
PartNotFoundException,
- HandlerNotFoundException, DelegationException
+ HandlerNotFoundException, DelegationException, RemoteException
{
m_logger.fine( "loading part " + uri );
Part part = loadPart( uri );
@@ -292,7 +293,7 @@
* @return the model
*/
public Model getModel( ClassLoader classloader, Part part, String key )
- throws ModelException, HandlerNotFoundException, DelegationException
+ throws ModelException, HandlerNotFoundException, DelegationException,
RemoteException
{
if( isRecognizedPart( part ) )
{
@@ -315,7 +316,7 @@
* @return the model
*/
public Model getModel( CompositionModel model, ClassLoader classloader,
Part part, String key )
- throws ModelException
+ throws ModelException, RemoteException
{
if( part instanceof ComponentProfile )
{
@@ -363,7 +364,7 @@
* @param model the reference model
* @return the service provider
*/
- public Provider getProvider( Model model )
+ public Provider getProvider( Model model ) throws RemoteException
{
return getComponent( (Component) null, model );
}
@@ -375,7 +376,7 @@
* @param identity the privider identity
* @return the service provider
*/
- public Provider getProvider( Model model, Object identity )
+ public Provider getProvider( Model model, Object identity ) throws
RemoteException
{
return getComponent( (Component) null, model, identity );
}
@@ -390,7 +391,7 @@
* @return the model
*/
public Component getComponent( Component owner, ClassLoader classloader,
Part part, String key )
- throws ModelException, HandlerNotFoundException, DelegationException
+ throws ModelException, HandlerNotFoundException, DelegationException,
RemoteException
{
return getComponent( owner, null, classloader, part, key );
}
@@ -407,7 +408,7 @@
*/
public Component getComponent(
Component owner, CompositionModel model, ClassLoader classloader, Part
part, String key )
- throws ModelException, HandlerNotFoundException, DelegationException
+ throws ModelException, HandlerNotFoundException, DelegationException,
RemoteException
{
if( isRecognizedPart( part ) )
{
@@ -428,7 +429,7 @@
* @param model the reference model
* @return the model
*/
- public Component getComponent( Component owner, Model model )
+ public Component getComponent( Component owner, Model model ) throws
RemoteException
{
if( model instanceof ValueModel )
{
@@ -449,7 +450,7 @@
* @param key the instance identity
* @return the model
*/
- public Component getComponent( Component owner, Model model, Object key
)
+ public Component getComponent( Component owner, Model model, Object key
) throws RemoteException
{
return getComponentEntry( owner, model, key );
}
@@ -462,7 +463,7 @@
* @param key the instance identity
* @return the model
*/
- public ComponentEntry getComponentEntry( Component owner, Model model,
Object key )
+ public ComponentEntry getComponentEntry( Component owner, Model model,
Object key ) throws RemoteException
{
if( null == model )
{
@@ -567,7 +568,7 @@
}
}

- private URI getPartition( Model model )
+ private URI getPartition( Model model ) throws RemoteException
{
if( null == model )
{
@@ -695,7 +696,7 @@
}
}

- private boolean isRecognizedPart( Part part )
+ private boolean isRecognizedPart( Part part ) throws RemoteException
{
return getURI().equals( part.getPartHandlerURI() );
}

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionManager.java
Mon Jun 20 11:02:59 2005
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.rmi.RemoteException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
@@ -104,7 +105,8 @@
* @return the registered component
*/
public Component addComponent( URI uri, String key )
- throws IOException, DelegationException, ModelException,
PartNotFoundException, HandlerNotFoundException
+ throws IOException, DelegationException, ModelException,
PartNotFoundException,
+ HandlerNotFoundException, RemoteException
{
Model model = getModel( uri, key );
Component component = model.getController().getComponent(
(Component) null, model );
@@ -120,7 +122,8 @@
* @return the registered component
*/
public Component addComponent( URI uri, Object id, String key )
- throws IOException, DelegationException, ModelException,
PartNotFoundException, HandlerNotFoundException
+ throws IOException, DelegationException, ModelException,
PartNotFoundException,
+ HandlerNotFoundException, RemoteException
{
Model model = getModel( uri, key );
Component component = model.getController().getComponent(
(Component) null, model, id );
@@ -132,7 +135,7 @@
* Register a component with the system.
* @param component the component to register
*/
- public void addComponent( Component component )
+ public void addComponent( Component component ) throws RemoteException
{
m_components.add( component );
}
@@ -151,7 +154,7 @@
}
}

- public synchronized void stop()
+ public synchronized void stop() throws RemoteException
{
getLogger().info( "initiating shutdown in " + getURI() );
Component[] components = (Component[]) m_instances.keySet().toArray(
new Component[0] );
@@ -210,7 +213,7 @@
//
}

- private URI getLauchTargetURI( String[] arguments )
+ private URI getLauchTargetURI( String[] arguments ) throws
RemoteException
{
if( arguments.length == 0 )
{
@@ -229,7 +232,7 @@
}
}

- private CommandLine getCommandLine( String[] args )
+ private CommandLine getCommandLine( String[] args ) throws
RemoteException
{
try
{
@@ -246,7 +249,7 @@
}
}

- private void addRootPart( URI uri )
+ private void addRootPart( URI uri ) throws RemoteException
{
getLogger().info( "adding root part: " + uri );
try
@@ -280,7 +283,14 @@
{
public void run()
{
- manager.dispose();
+ try
+ {
+ manager.dispose();
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
System.runFinalization();
}
}

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/CompositionPartHandler.java
Mon Jun 20 11:02:59 2005
@@ -24,6 +24,9 @@
import java.io.ObjectInputStream;
import java.net.URI;
import java.net.URL;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
import java.util.WeakHashMap ;

import net.dpml.part.part.Part;
@@ -48,7 +51,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public class CompositionPartHandler implements PartHandler
+public class CompositionPartHandler extends UnicastRemoteObject implements
PartHandler
{
/**
* Map containing the foreign part handlers. The map keys
@@ -62,8 +65,10 @@
*/
private final Repository m_loader;

- public CompositionPartHandler()
+ public CompositionPartHandler() throws RemoteException
{
+ super();
+
m_loader = Transit.getInstance().getRepository();
}

@@ -71,7 +76,7 @@
* Returns the uri of this handler.
* @return the handler uri
*/
- public URI getURI()
+ public URI getURI() throws RemoteException
{
return PART_HANDLER_URI;
}
@@ -81,7 +86,7 @@
* @return the controller
* @exception UnsupportedOperationException allways thrown
*/
- public Controller getController()
+ public Controller getController() throws RemoteException
{
throw new UnsupportedOperationException( "getController" );
}
@@ -96,7 +101,7 @@
* @return the part estracted from the part handler referenced by the uri
*/
public Part loadPart( URI uri )
- throws PartNotFoundException, IOException, DelegationException
+ throws PartNotFoundException, IOException, DelegationException,
RemoteException
{
return loadSerializedPart( uri );
}
@@ -121,7 +126,8 @@
}
}

- public Controller getPartHandler( Part part ) throws
HandlerNotFoundException, DelegationException
+ public Controller getPartHandler( Part part )
+ throws HandlerNotFoundException, DelegationException, RemoteException
{
URI uri = part.getPartHandlerURI();
PartHandler handler = loadPartHandler( uri );
@@ -133,7 +139,7 @@
* @return the part handler
*/
public PartHandler loadPartHandler( URI uri )
- throws HandlerNotFoundException, DelegationException
+ throws HandlerNotFoundException, DelegationException, RemoteException
{
if( false == getURI().equals( uri ) )
{
@@ -174,7 +180,7 @@
}

private Part loadSerializedPart( URI uri )
- throws IOException, DelegationException, PartNotFoundException
+ throws IOException, DelegationException, PartNotFoundException,
RemoteException
{
URL url = resolveURL( uri );
InputStream input = url.openStream();
@@ -240,7 +246,7 @@
}
}

- protected PartHandler resolvePartHandler( URI uri ) throws
HandlerNotFoundException
+ protected PartHandler resolvePartHandler( URI uri ) throws
HandlerNotFoundException, RemoteException
{
if( getURI().equals( uri ) )
{

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/LifestyleHandler.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,8 @@

package net.dpml.composition.control;

+import java.rmi.RemoteException;
+
import net.dpml.composition.model.ComponentEntry;
import net.dpml.composition.model.CompositionModel;
import net.dpml.part.control.Monitor;
@@ -48,7 +50,7 @@
* @param model the model from which new or existing instances will be
resolved
* @return the key to the resolved instance
*/
- public ComponentEntry aquire( CompositionModel model, Object owner )
+ public ComponentEntry aquire( CompositionModel model, Object owner )
throws RemoteException
{
final String lifestyle = model.getLifestylePolicy();
if( getMonitor().isDebugEnabled() )
@@ -110,7 +112,7 @@
* @param model the model from which new or existing instances will be
resolved
* @return the key to the resolved instance
*/
- public ComponentEntry aquire( CompositionModel model, Object key, Object
owner )
+ public ComponentEntry aquire( CompositionModel model, Object key, Object
owner ) throws RemoteException
{
if( null == model )
{

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/PartsInvocationHandler.java
Mon Jun 20 11:02:59 2005
@@ -23,6 +23,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.URI;
+import java.rmi.RemoteException;

import net.dpml.composition.info.PartDescriptor;
import net.dpml.composition.model.ComponentEntry;
@@ -123,7 +124,7 @@
* is null, or if the object instance has been destroyed
earlier.
*/
private Object execute( final Object proxy, final Method method, final
Object[] args )
- throws Throwable, NullPointerException
+ throws Throwable, NullPointerException, RemoteException
{
Class source = method.getDeclaringClass();
if( Object.class == method.getDeclaringClass() )
@@ -264,7 +265,7 @@
}
}

- private DelegationException createDelegationException( String key, Model
provider, String function, Throwable e )
+ private DelegationException createDelegationException( String key, Model
provider, String function, Throwable e ) throws RemoteException
{
URI uri = provider.getURI();
final String error =

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/control/ValueController.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/control/ValueController.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/control/ValueController.java
Mon Jun 20 11:02:59 2005
@@ -19,6 +19,8 @@
package net.dpml.composition.control;

import java.net.URI;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;

import net.dpml.composition.model.ValueEntry;

@@ -33,12 +35,14 @@
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public class ValueController implements Manager
+public class ValueController extends UnicastRemoteObject implements Manager
{
private URI m_uri;

- public ValueController( CompositionController controller )
+ public ValueController( CompositionController controller ) throws
RemoteException
{
+ super();
+
URI uri = controller.getURI();
String path = uri.getSchemeSpecificPart();
m_uri = CompositionController.createURI( "manager", path );
@@ -65,7 +69,7 @@
* Return the instance managed by this manager.
* @return the managed instance
*/
- public Object resolve( Component entry, boolean policy )
+ public Object resolve( Component entry, boolean policy ) throws
RemoteException
{
return ((ValueEntry)entry).getInstance();
}

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/event/WeakEventProducer.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,8 @@

package net.dpml.composition.event;

+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
import java.util.EventObject;
import java.util.EventListener;
import java.util.List;
@@ -27,12 +29,11 @@

import net.dpml.transit.util.ExceptionHelper;

-
/**
* A abstract base class that established an event queue and handles event
dispatch
* operations for listeners declared in a class extending this base class.
*/
-public abstract class WeakEventProducer
+public abstract class WeakEventProducer extends UnicastRemoteObject
{
private Map m_listeners = new WeakHashMap();

@@ -41,6 +42,11 @@
*/
protected final Object m_lock = new Object();

+ public WeakEventProducer() throws RemoteException
+ {
+ super();
+ }
+
/**
* Abstract operation to be implemented by classes extending this base
class.
* An implementation is reposible for the posting of the event to
associated

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/AbstractComponent.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/AbstractComponent.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/AbstractComponent.java
Mon Jun 20 11:02:59 2005
@@ -20,6 +20,7 @@

import java.util.EventObject;
import java.util.EventListener;
+import java.rmi.RemoteException;

import net.dpml.composition.event.WeakEventProducer;

@@ -49,8 +50,10 @@

private boolean m_initialized = false;

- public AbstractComponent( Monitor monitor )
+ public AbstractComponent( Monitor monitor ) throws RemoteException
{
+ super();
+
m_monitor = monitor;
}

@@ -58,14 +61,14 @@
* Return the availability status of the model.
* @return the availability status
*/
- public abstract boolean isOperational();
+ public abstract boolean isOperational() throws RemoteException;

- public void addAvailabilityListener( AvailabilityListener listener )
+ public void addAvailabilityListener( AvailabilityListener listener )
throws RemoteException
{
super.addListener( listener );
}

- public void removeAvailabilityListener( AvailabilityListener listener )
+ public void removeAvailabilityListener( AvailabilityListener listener )
throws RemoteException
{
super.removeListener( listener );
}
@@ -74,17 +77,17 @@
* Return the current state of the component.
* @return the current state
*/
- public State getState()
+ public State getState() throws RemoteException
{
return NULL_STATE;
}

- public void addStateListener( StateListener listener )
+ public void addStateListener( StateListener listener ) throws
RemoteException
{
super.addListener( listener );
}

- public void removeStateListener( StateListener listener )
+ public void removeStateListener( StateListener listener ) throws
RemoteException
{
super.removeListener( listener );
}
@@ -101,7 +104,16 @@
if( listener instanceof AvailabilityListener )
{
AvailabilityListener availabilityListener =
(AvailabilityListener) listener;
- availabilityListener.availabilityChanged( e );
+ try
+ {
+ availabilityListener.availabilityChanged( e );
+ }
+ catch( Throwable t )
+ {
+ final String error =
+ "Listener raised an error duirng notification of a
availability change.";
+ m_monitor.warn( error, t );
+ }
}
}
}
@@ -115,7 +127,16 @@
if( listener instanceof StateListener )
{
StateListener stateListener = (StateListener) listener;
- stateListener.stateChanged( e );
+ try
+ {
+ stateListener.stateChanged( e );
+ }
+ catch( Throwable t )
+ {
+ final String error =
+ "Listener raised an error duirng notification of a
state change.";
+ m_monitor.warn( error, t );
+ }
}
}
}
@@ -128,7 +149,7 @@
}
}

- public abstract Manager getManager();
+ public abstract Manager getManager() throws RemoteException;

/**
* Return an initialized instance of the component.

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/Appliance.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/Appliance.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/Appliance.java
Mon Jun 20 11:02:59 2005
@@ -23,6 +23,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.UndeclaredThrowableException;
import java.net.URI;
+import java.rmi.RemoteException;

import net.dpml.composition.model.ComponentEntry;

@@ -58,7 +59,7 @@
*
* @param component the component model
*/
- Appliance( ComponentEntry component )
+ Appliance( ComponentEntry component ) throws RemoteException
{
assertNotNull( component, "component" );
m_component = component;
@@ -119,7 +120,7 @@
// ApplianceInvocationHandler
//-------------------------------------------------------------------

- public URI getURI()
+ public URI getURI() throws RemoteException
{
return m_component.getURI();
}
@@ -128,12 +129,19 @@
* Request for the component manager or finalization method to release
* references.
*/
- public void dispose()
+ public void dispose()
{
if( !m_disposed )
{
- m_component.removeAvailabilityListener( this );
m_disposed = true;
+ try
+ {
+ m_component.removeAvailabilityListener( this );
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
}
}

@@ -146,7 +154,7 @@
dispose();
}

- private Throwable handleInvocationThrowable( Method method, Throwable e )
+ private Throwable handleInvocationThrowable( Method method, Throwable e
) throws RemoteException
{
final String name = method.getName();
final String error =

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentEntry.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentEntry.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentEntry.java
Mon Jun 20 11:02:59 2005
@@ -24,6 +24,7 @@
import java.lang.reflect.Field;
import java.net.URI;
import java.net.URISyntaxException;
+import java.rmi.RemoteException;
import java.util.EventObject;
import java.util.EventListener;
import java.util.Hashtable;
@@ -55,10 +56,6 @@
import net.dpml.part.control.Manager;

/**
- * A lifestyle handler provides support for the aquisition and release
- * of component instances. An implementation is responsible for the
- * handling of new instance creation based on lifestyle policy declared
- * in a component model.
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: LifestyleManager.java 259 2004-10-30 07:24:40Z mcconnell $
@@ -78,14 +75,18 @@
private boolean m_initialized = false;
private ComponentController m_manager;

- private transient Object m_instance;
+ private Object m_instance;

private final Object m_owner; // not sure if this is needed

private boolean m_disposed = false;

- public ComponentEntry( Monitor monitor, ComponentController manager,
CompositionModel model, Object key, Object owner )
+ public ComponentEntry(
+ Monitor monitor, ComponentController manager, CompositionModel model,
+ Object key, Object owner ) throws RemoteException
{
+ super();
+
m_manager = manager;
m_monitor = monitor;
m_model = model;
@@ -126,27 +127,27 @@
* Return the availability status of the model.
* @return the availability status
*/
- public boolean isOperational()
+ public boolean isOperational() throws RemoteException
{
return true;
}

- public void addAvailabilityListener( AvailabilityListener listener )
+ public void addAvailabilityListener( AvailabilityListener listener )
throws RemoteException
{
super.addListener( listener );
}

- public void removeAvailabilityListener( AvailabilityListener listener )
+ public void removeAvailabilityListener( AvailabilityListener listener )
throws RemoteException
{
super.removeListener( listener );
}

- public void addStateListener( StateListener listener )
+ public void addStateListener( StateListener listener ) throws
RemoteException
{
super.addListener( listener );
}

- public void removeStateListener( StateListener listener )
+ public void removeStateListener( StateListener listener ) throws
RemoteException
{
super.removeListener( listener );
}
@@ -177,7 +178,16 @@
if( listener instanceof StateListener )
{
StateListener stateListener = (StateListener) listener;
- stateListener.stateChanged( e );
+ try
+ {
+ stateListener.stateChanged( e );
+ }
+ catch( Throwable t )
+ {
+ final String error =
+ "Listener raised an exception in response to a state
change notification.";
+ m_monitor.warn( error, t );
+ }
}
}
}
@@ -190,7 +200,7 @@
}
}

- public Manager getManager()
+ public Manager getManager() throws RemoteException
{
return m_manager;
}
@@ -201,7 +211,7 @@
*
* @return the resolved instance
*/
- public Object resolve() throws Exception
+ public Object resolve() throws Exception, RemoteException
{
return getManager().resolve( this, true );
}
@@ -213,7 +223,7 @@
* @param policy the proxy creation policy
* @return the resolved instance
*/
- public Object resolve( boolean policy ) throws Exception
+ public Object resolve( boolean policy ) throws Exception, RemoteException
{
return getManager().resolve( this, policy );
}
@@ -221,7 +231,7 @@
/**
* Initialize the component.
*/
- public void initialize() throws Exception
+ public void initialize() throws Exception, RemoteException
{
m_manager.initialize( this );
}
@@ -233,7 +243,7 @@
* @return the state resulting from the transition
* @exception if a transition error occurs
*/
- public State apply( String key ) throws Exception
+ public State apply( String key ) throws Exception, RemoteException
{
return m_manager.apply( this, key );
}
@@ -244,7 +254,7 @@
* @param key the key identifying the operation to execute
* @exception if a transition error occurs
*/
- public void execute( String key ) throws Exception
+ public void execute( String key ) throws Exception, RemoteException
{
m_manager.execute( this, key );
}
@@ -252,7 +262,7 @@
/**
* Termination of the component.
*/
- public void terminate()
+ public void terminate() throws RemoteException
{
m_manager.terminate( this );
}
@@ -382,7 +392,7 @@
*
* @return the proxy reflecting the service interfaces declared by the
component type
*/
- public Object getProxy()
+ public Object getProxy() throws RemoteException
{
CompositionModel model = getModel();
ClassLoader classloader = model.getClassLoader();
@@ -440,7 +450,7 @@
* remove the instance for the model's instance table and trigger instance
* etherialization.
*/
- public void dispose()
+ public void dispose() throws RemoteException
{
if( m_disposed )
{
@@ -517,7 +527,14 @@
protected void finalize()
{
m_monitor.debug( "component model finalization in " + getURI() );
- dispose();
+ try
+ {
+ dispose();
+ }
+ catch( Throwable e )
+ {
+ e.printStackTrace();
+ }
}

private String getFragment( Object key )
@@ -642,7 +659,7 @@
m_model = model;
}

- public Object getValue( String key, Object[] args )
+ public Object getValue( String key, Object[] args ) throws
RemoteException
{
Object value = get( key );
if( null != value )

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentTable.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentTable.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ComponentTable.java
Mon Jun 20 11:02:59 2005
@@ -22,9 +22,6 @@
import java.util.Map;
import java.util.WeakHashMap;

-import net.dpml.composition.model.ComponentEntry;
-import net.dpml.composition.model.CompositionModel;
-
/**
* The parts model is a model of the set of parts maintained by a parent
model.
*

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/CompositionModel.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/CompositionModel.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/CompositionModel.java
Mon Jun 20 11:02:59 2005
@@ -18,8 +18,9 @@

package net.dpml.composition.model;

-import java.io.Serializable;
import java.net.URI;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
import java.util.LinkedList;
import java.util.List;

@@ -59,7 +60,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public class CompositionModel implements Model, Configurable,
Parameterizable, Serializable
+public class CompositionModel extends UnicastRemoteObject implements Model,
Configurable, Parameterizable
{
private final ComponentTable m_table;
private final List m_errors = new LinkedList();
@@ -91,7 +92,7 @@
*/
public CompositionModel(
CompositionController controller, URI partition, ClassLoader
classloader, ComponentProfile profile )
- throws ModelException
+ throws ModelException, RemoteException
{
this( controller, null, partition, classloader, profile,
profile.getName() );
}
@@ -107,7 +108,7 @@
*/
public CompositionModel(
CompositionController controller, URI partition, ClassLoader
classloader, ComponentProfile profile, String name )
- throws ModelException
+ throws ModelException, RemoteException
{
this( controller, null, partition, classloader, profile, name );
}
@@ -125,8 +126,10 @@
public CompositionModel(
CompositionController controller, CompositionModel parent, URI
partition, ClassLoader classloader,
ComponentProfile profile, String name )
- throws ModelException
+ throws ModelException, RemoteException
{
+ super();
+
m_key = name;
m_controller = controller;
m_partition = partition;
@@ -259,12 +262,12 @@
}
}

- public Provider getProvider()
+ public Provider getProvider() throws RemoteException
{
return getCompositionController().getProvider( this );
}

- public Provider getProvider( Object key )
+ public Provider getProvider( Object key ) throws RemoteException
{
return getCompositionController().getProvider( this, key );
}
@@ -276,7 +279,7 @@
*
* @return the model key
*/
- public Object getKey()
+ public Object getKey() throws RemoteException
{
return m_key;
}
@@ -285,7 +288,7 @@
* Return the primary controller assigned to the model.
* @return the primary controller
*/
- public Controller getController()
+ public Controller getController() throws RemoteException
{
return getCompositionController();
}

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ContextTable.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/ContextTable.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ContextTable.java
Mon Jun 20 11:02:59 2005
@@ -19,6 +19,7 @@
package net.dpml.composition.model;

import java.net.URI;
+import java.rmi.RemoteException;
import java.util.Hashtable;
import java.util.Map;
import java.util.Map.Entry;
@@ -66,7 +67,7 @@
m_parent = parent;
}

- public void addEntry( String key, Part part ) throws ModelException
+ public void addEntry( String key, Part part ) throws ModelException,
RemoteException
{
if( null == key )
{
@@ -203,7 +204,7 @@
return m_entries.containsKey( key );
}

- public Object getValue( String key, Object[] args )
+ public Object getValue( String key, Object[] args ) throws
RemoteException
{
Provider provider = getEntry( key );
if( null == provider )

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/PartsTable.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/PartsTable.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/PartsTable.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,7 @@

package net.dpml.composition.model;

+import java.rmi.RemoteException;
import java.util.Map;
import java.util.Hashtable;

@@ -52,7 +53,7 @@
m_model = model;
}

- public void addPart( String key, Part part ) throws ModelException
+ public void addPart( String key, Part part ) throws ModelException,
RemoteException
{
if( null == key )
{

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ReferenceEntry.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/ReferenceEntry.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ReferenceEntry.java
Mon Jun 20 11:02:59 2005
@@ -20,6 +20,8 @@

import java.lang.reflect.Constructor;
import java.net.URI;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
import java.util.Map.Entry;

import net.dpml.composition.control.CompositionController;
@@ -42,7 +44,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: DefaultConstructorModel.java 1518 2005-01-17 17:13:05Z
niclas $
*/
-public class ReferenceEntry implements Provider
+public class ReferenceEntry extends UnicastRemoteObject implements Provider
{
//--------------------------------------------------------------
// state
@@ -73,8 +75,10 @@
* context argument is null.
*/
public ReferenceEntry( CompositionController controller, String key,
Model provider, URI ref )
- throws ModelException, NullPointerException
+ throws ModelException, NullPointerException, RemoteException
{
+ super();
+
if( null == provider )
{
throw new NullPointerException( "model" );
@@ -88,12 +92,12 @@
m_provider = provider;
}

- public URI getPartition()
+ public URI getPartition() throws RemoteException
{
return m_provider.getPartition();
}

- public URI getURI()
+ public URI getURI() throws RemoteException
{
return m_provider.getURI();
}
@@ -103,7 +107,7 @@
return m_reference;
}

- public Model getProviderModel()
+ public Model getProviderModel() throws RemoteException
{
return m_provider;
}
@@ -112,7 +116,7 @@
// Provider
//--------------------------------------------------------------

- public void release( Object proxy )
+ public void release( Object proxy ) throws RemoteException
{
getProviderModel().getProvider().release( proxy );
}
@@ -137,32 +141,32 @@
return getProviderModel().getProvider().resolve( flag );
}

- public void removeStateListener( StateListener listener )
+ public void removeStateListener( StateListener listener ) throws
RemoteException
{
getProviderModel().getProvider().removeStateListener( listener );
}

- public void removeAvailabilityListener( AvailabilityListener listener )
+ public void removeAvailabilityListener( AvailabilityListener listener )
throws RemoteException
{
getProviderModel().getProvider().removeAvailabilityListener(
listener );
}

- public void addStateListener( StateListener listener )
+ public void addStateListener( StateListener listener ) throws
RemoteException
{
getProviderModel().getProvider().addStateListener( listener );
}

- public void addAvailabilityListener( AvailabilityListener listener )
+ public void addAvailabilityListener( AvailabilityListener listener )
throws RemoteException
{
getProviderModel().getProvider().addAvailabilityListener( listener );
}

- public State getState()
+ public State getState() throws RemoteException
{
return getProviderModel().getProvider().getState();
}

- public boolean isOperational()
+ public boolean isOperational() throws RemoteException
{
return getProviderModel().getProvider().isOperational();
}

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueEntry.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueEntry.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueEntry.java
Mon Jun 20 11:02:59 2005
@@ -20,6 +20,7 @@

import java.lang.reflect.Constructor;
import java.net.URI;
+import java.rmi.RemoteException;

import net.dpml.composition.control.CompositionController;
import net.dpml.composition.data.ValueDirective;
@@ -27,7 +28,6 @@

import net.dpml.part.control.Controller;
import net.dpml.part.control.Manager;
-
import net.dpml.part.control.Monitor;
import net.dpml.part.model.Model;
import net.dpml.part.model.ModelException;
@@ -41,7 +41,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: DefaultConstructorModel.java 1518 2005-01-17 17:13:05Z
niclas $
*/
-public class ValueEntry extends AbstractComponent
+public class ValueEntry extends AbstractComponent implements Component
{
//--------------------------------------------------------------
// state
@@ -77,9 +77,10 @@
public ValueEntry(
Monitor monitor, ValueModel model, String name, Manager manager,
ClassLoader classloader,
ValueDirective directive, Model parent )
- throws ModelException, NullPointerException
+ throws ModelException, NullPointerException, RemoteException
{
super( monitor );
+
if( directive == null )
{
throw new NullPointerException( "directive" );
@@ -101,7 +102,7 @@
//validate();
}

- public Manager getManager()
+ public Manager getManager() throws RemoteException
{
return m_manager;
}
@@ -110,7 +111,7 @@
* Return the availability status of the model.
* @return the availability status
*/
- public boolean isOperational()
+ public boolean isOperational() throws RemoteException
{
return true;
}
@@ -120,17 +121,17 @@
*
* @return the key
*/
- public Object getKey()
+ public Object getKey() throws RemoteException
{
return m_key;
}

- public URI getURI()
+ public URI getURI() throws RemoteException
{
return m_uri;
}

- public Object getInstance()
+ public Object getInstance() throws RemoteException
{
return getValue();
}
@@ -146,7 +147,7 @@
/**
* Termination of the component.
*/
- public void terminate()
+ public void terminate() throws RemoteException
{
m_manager.terminate( this );
}
@@ -165,7 +166,7 @@
*
* @return the context entry value
*/
- public Object getValue()
+ public Object getValue() throws RemoteException
{
if( m_value != null )
{
@@ -212,7 +213,7 @@
* @return the context entry value
*/
public Object getValue( Value p )
- throws ModelException
+ throws ModelException, RemoteException
{
String argument = p.getArgument();
Object object = checkForURNReference( argument );
@@ -235,7 +236,7 @@
* @exception ModelException if the parameter value cannot be resolved
*/
public Object getValue( Class clazz, String argument, Value[] parameters
)
- throws ModelException
+ throws ModelException, RemoteException
{
if( parameters.length == 0 )
{
@@ -255,7 +256,7 @@
}

private Object getMultiArgumentConstructorValue( Class clazz, Value[]
parameters )
- throws ModelException
+ throws ModelException, RemoteException
{
//
// getting here means we are dealing with 0..n types parameter
constructor where the
@@ -392,7 +393,7 @@


private Object getNullArgumentConstructorValue( Class clazz )
- throws ModelException
+ throws ModelException, RemoteException
{
try
{
@@ -431,7 +432,7 @@
}

private Object getSingleArgumentConstructorValue( Class clazz, String
argument )
- throws ModelException
+ throws ModelException, RemoteException
{
Object object = checkForURNReference( argument );
if( null != object )
@@ -502,7 +503,7 @@
}
}

- private Object getPrimitiveValue( Class clazz, String argument ) throws
ModelException
+ private Object getPrimitiveValue( Class clazz, String argument ) throws
ModelException, RemoteException
{
if( Integer.TYPE == clazz )
{
@@ -549,7 +550,7 @@
* @return the parameter class
* @exception ModelException if the parameter class cannot be resolved
*/
- Class getValueClass( Value value ) throws ModelException
+ Class getValueClass( Value value ) throws ModelException, RemoteException
{
String v = value.getArgument();
Object object = checkForURNReference( v );
@@ -569,7 +570,7 @@
* @return the parameter class
* @exception ModelException if the parameter class cannot be resolved
*/
- Class getValueClass( String classname ) throws ModelException
+ Class getValueClass( String classname ) throws ModelException,
RemoteException
{
try
{
@@ -630,7 +631,7 @@
}
}

- private Object checkForURNReference( String argument )
+ private Object checkForURNReference( String argument ) throws
RemoteException
{
if( null == argument )
{
@@ -654,7 +655,7 @@
}
}

- private Object getParentResource( URI urn )
+ private Object getParentResource( URI urn ) throws RemoteException
{
Controller controller = m_model.getController();
if( null != m_parent )
@@ -681,7 +682,7 @@
}

private void validatePair( String descriptorClassName, String
directiveClassName )
- throws ModelException
+ throws ModelException, RemoteException
{
if( "int".equals( descriptorClassName ) )
{

Modified:
development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueModel.java
==============================================================================
---
development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueModel.java
(original)
+++
development/main/metro/composition/control/src/main/net/dpml/composition/model/ValueModel.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,8 @@

package net.dpml.composition.model;

+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
import java.lang.reflect.Constructor;
import java.net.URI;

@@ -40,7 +42,7 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: DefaultConstructorModel.java 1518 2005-01-17 17:13:05Z
niclas $
*/
-public class ValueModel implements Model
+public class ValueModel extends UnicastRemoteObject implements Model
{
//--------------------------------------------------------------
// state
@@ -74,8 +76,10 @@
Monitor monitor,
String name, CompositionController controller, URI partition,
Manager manager, ClassLoader classloader,
ValueDirective directive, Model parent )
- throws ModelException, NullPointerException
+ throws ModelException, NullPointerException, RemoteException
{
+ super();
+
if( name == null )
{
throw new NullPointerException( "name" );
@@ -93,7 +97,7 @@
m_entry = new ValueEntry( monitor, this, name, manager, classloader,
directive, parent );
}

- public URI getURI()
+ public URI getURI() throws RemoteException
{
return m_uri;
}
@@ -102,7 +106,7 @@
* Return the primary controller assigned to the model.
* @return the primary controller
*/
- public Controller getController()
+ public Controller getController() throws RemoteException
{
return m_controller;
}
@@ -111,7 +115,7 @@
* Return the uri identifying the partition that this model is enclosed
within.
* @return the partition uri
*/
- public URI getPartition()
+ public URI getPartition() throws RemoteException
{
return m_partition;
}
@@ -120,22 +124,22 @@
* Return the model key
* @return the key
*/
- public Object getKey()
+ public Object getKey() throws RemoteException
{
return m_key;
}

- public Provider getProvider()
+ public Provider getProvider() throws RemoteException
{
return getComponent();
}

- public Provider getProvider( Object key )
+ public Provider getProvider( Object key ) throws RemoteException
{
throw new UnsupportedOperationException( "getComponent/1" );
}

- public Component getComponent()
+ public Component getComponent() throws RemoteException
{
return m_entry;
}

Modified:
development/main/metro/composition/part/src/main/net/dpml/composition/part/CompositionContentHandler.java
==============================================================================
---
development/main/metro/composition/part/src/main/net/dpml/composition/part/CompositionContentHandler.java
(original)
+++
development/main/metro/composition/part/src/main/net/dpml/composition/part/CompositionContentHandler.java
Mon Jun 20 11:02:59 2005
@@ -26,10 +26,12 @@
import java.net.URLConnection;
import java.net.ContentHandler;
import java.net.UnknownServiceException;
+import java.rmi.RemoteException;
import java.util.Hashtable;
import java.util.Map;

import net.dpml.composition.control.CompositionManager;
+import net.dpml.composition.unit.CompositionHelper;

import net.dpml.transit.repository.Repository;

@@ -42,6 +44,7 @@
import net.dpml.part.model.Provider;
import net.dpml.part.model.Component;

+import net.dpml.transit.Transit;
import net.dpml.transit.model.ContentModel;

/**
@@ -68,20 +71,11 @@
{
throw new NullPointerException( "model" );
}
- if( model instanceof ControllerContext )
- {
- ControllerContext context = (ControllerContext) model;
- m_manager = new CompositionManager( context );
- }
- else
- {
- final String error =
- "Supplied content model is not an instance of "
- + ControllerContext.class.getName()
- + "."
- + "\nContent Model: " + model.getClass().getName();
- throw new IllegalArgumentException( error );
- }
+
+ File data = Transit.DPML_DATA;
+ File basedir = new File( data, "work" );
+ CompositionHelper helper = new CompositionHelper( basedir );
+ m_manager = helper.getCompositionManager();
}

//------------------------------------------------------------------
@@ -115,8 +109,18 @@
}
else if( Provider.class.isAssignableFrom( c ) )
{
- Model model = getModel( url );
- return model.getProvider();
+ try
+ {
+ Model model = getModel( url );
+ return model.getProvider();
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unable to load provider: " + url;
+ throw new RuntimeException( error, e );
+ }
+
}
else if( Object.class.equals( c ) )
{
@@ -129,14 +133,14 @@
{
final String error =
"Unable to load part: " + url;
- throw new ControlRuntimeException(
m_manager.getURI(), error, e );
+ throw new RuntimeException( error, e );
}
}
else
{
final String error =
"Unsupported class argument: " + c.getName();
- throw new ControlRuntimeException( m_manager.getURI(),
error );
+ throw new RuntimeException( error );
}
}
return null;
@@ -155,7 +159,7 @@
{
final String error =
"Error occured while attempting to load part: " + url;
- throw new ControlRuntimeException( m_manager.getURI(), error, e
);
+ throw new RuntimeException( error, e );
}
}

@@ -171,7 +175,7 @@
{
final String error =
"Error occured while attempting to load part: " + url;
- throw new ControlRuntimeException( m_manager.getURI(), error, e
);
+ throw new RuntimeException( error, e );
}
}

@@ -186,8 +190,17 @@

public void dispose()
{
- getCompositionManager().dispose();
- System.gc();
+ try
+ {
+ getCompositionManager().dispose();
+ }
+ catch( Throwable e )
+ {
+ }
+ finally
+ {
+ System.gc();
+ }
}

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

Modified: development/main/metro/index.xml
==============================================================================
--- development/main/metro/index.xml (original)
+++ development/main/metro/index.xml Mon Jun 20 11:02:59 2005
@@ -3,7 +3,6 @@
<index key="dpml-metro">

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

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

@@ -131,7 +129,6 @@
<include key="dpml-configuration-api" tag="api"/>
<include key="dpml-parameters-impl"/>
<include key="dpml-configuration-impl"/>
- <include key="dpml-depot-console"/>
<include key="commons-cli"/>
</dependencies>
</project>
@@ -166,7 +163,6 @@
</types>
</info>
<dependencies>
- <include key="dpml-depot-console"/>
<include key="dpml-composition-control"/>
</dependencies>
</project>

Modified:
development/main/metro/part/src/main/net/dpml/part/control/Control.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/control/Control.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/control/Control.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,7 @@

package net.dpml.part.control;

+import java.rmi.RemoteException;

/**
* Common interface implemented by controls.
@@ -31,6 +32,6 @@
* Return a human readable short name of the controller.
* @return the controller name
*/
- String getName();
+ String getName() throws RemoteException;

}

Modified:
development/main/metro/part/src/main/net/dpml/part/control/Controller.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/control/Controller.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/control/Controller.java
Mon Jun 20 11:02:59 2005
@@ -19,6 +19,7 @@
package net.dpml.part.control;

import java.net.URI;
+import java.rmi.RemoteException;

import net.dpml.part.model.Model;
import net.dpml.part.model.Provider;
@@ -57,7 +58,7 @@
* @return the resource matching the supplied urn
* @exception IllegalStateException if the supplied urn is not valid
*/
- Object getResource( Model model, URI urn );
+ Object getResource( Model model, URI urn ) throws RemoteException;

/**
* Return a new model for a supplied part.
@@ -68,7 +69,7 @@
* @return the model
*/
Model getModel( ClassLoader parent, Part part, String name )
- throws ModelException, HandlerNotFoundException, DelegationException;
+ throws ModelException, HandlerNotFoundException, DelegationException,
RemoteException;

/**
* Return a default service provider.
@@ -76,7 +77,7 @@
* @param model the reference model
* @return the service provider
*/
- Provider getProvider( Model model );
+ Provider getProvider( Model model ) throws RemoteException;

/**
* Return an identified service provider.
@@ -85,7 +86,7 @@
* @param identity the privider identity
* @return the service provider
*/
- Provider getProvider( Model model, Object identity );
+ Provider getProvider( Model model, Object identity ) throws
RemoteException;

/**
* Return a default service provider component.
@@ -94,7 +95,7 @@
* @return the service provider
*/
Component getComponent( Component owner, Model model )
- throws ModelException;
+ throws ModelException, RemoteException;

/**
* Return an identified service provider component.
@@ -104,7 +105,7 @@
* @return the service provider
*/
Component getComponent( Component owner, Model model, Object identity )
- throws ModelException;
+ throws ModelException, RemoteException;

/**
* Return a component for a supplied part.
@@ -115,6 +116,6 @@
* @return the default provider
*/
Component getComponent( Component owner, ClassLoader parent, Part part,
String name )
- throws ModelException, HandlerNotFoundException, DelegationException;
+ throws ModelException, HandlerNotFoundException, DelegationException,
RemoteException;

}

Modified:
development/main/metro/part/src/main/net/dpml/part/control/Identifiable.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/control/Identifiable.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/control/Identifiable.java
Mon Jun 20 11:02:59 2005
@@ -19,6 +19,8 @@
package net.dpml.part.control;

import java.net.URI;
+import java.rmi.Remote;
+import java.rmi.RemoteException;

/**
* Interface implemented by objects that expose an identity.
@@ -26,11 +28,11 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public interface Identifiable
+public interface Identifiable extends Remote
{
/**
* Returns the identity of the object implementing this interface.
* @return a uri identifying the object
*/
- URI getURI();
+ URI getURI() throws RemoteException;
}

Modified:
development/main/metro/part/src/main/net/dpml/part/control/Manager.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/control/Manager.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/control/Manager.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,8 @@

package net.dpml.part.control;

+import java.rmi.RemoteException;
+
import net.dpml.part.model.Component;
import net.dpml.part.model.ResourceUnavailableException;
import net.dpml.part.state.State;
@@ -63,7 +65,7 @@
*
* @param instance the instance to release
*/
- void release( Object instance );
+ void release( Object instance ) throws RemoteException;

/**
* Initialize the component.
@@ -75,6 +77,6 @@
* Termination of the component.
* @param component the component
*/
- void terminate( Component component );
+ void terminate( Component component ) throws RemoteException;

}

Modified:
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/control/PartHandler.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,8 @@

package net.dpml.part.control;

+import java.rmi.Remote;
+import java.rmi.RemoteException;
import java.io.IOException;
import java.net.URI;

@@ -29,26 +31,26 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public interface PartHandler
+public interface PartHandler extends Remote
{
/**
* Returns the uri of the handler.
* @return the handler uri
*/
- URI getURI();
+ URI getURI() throws RemoteException;

/**
* Load the model controller.
* @return the controller
*/
- Controller getController();
+ Controller getController() throws RemoteException;

/**
* Load a part handler giiven a handler uri.
* @return the part handler
*/
PartHandler loadPartHandler( URI uri )
- throws HandlerNotFoundException, IOException, DelegationException;
+ throws HandlerNotFoundException, IOException, DelegationException,
RemoteException;

/**
* Load a part from serialized form. The uri is assumed to be a uri that
@@ -58,12 +60,12 @@
* @return the part estracted from the part handler referenced by the uri
*/
public Part loadPart( URI uri )
- throws DelegationException, PartNotFoundException, IOException;
+ throws DelegationException, PartNotFoundException, IOException,
RemoteException;

/**
* Load a part from a serialized object byte array.
* @param bytes the byte array
* @return the part
*/
- Part loadPart( byte[] bytes ) throws IOException;
+ Part loadPart( byte[] bytes ) throws IOException, RemoteException;
}

Modified:
development/main/metro/part/src/main/net/dpml/part/control/SystemManager.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/control/SystemManager.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/control/SystemManager.java
Mon Jun 20 11:02:59 2005
@@ -20,6 +20,8 @@

import java.io.IOException;
import java.net.URI;
+import java.rmi.Remote;
+import java.rmi.RemoteException;

import net.dpml.part.model.Component;
import net.dpml.part.model.Model;
@@ -43,7 +45,8 @@
* @return the registered component
*/
Component addComponent( URI uri, String key )
- throws IOException, DelegationException, ModelException,
PartNotFoundException, HandlerNotFoundException;
+ throws IOException, DelegationException, ModelException,
PartNotFoundException,
+ HandlerNotFoundException, RemoteException;

/**
* Add a part designated by a supplied uri to the system scope.
@@ -53,24 +56,25 @@
* @return the registered component
*/
Component addComponent( URI uri, Object id, String key )
- throws IOException, DelegationException, ModelException,
PartNotFoundException, HandlerNotFoundException;
+ throws IOException, DelegationException, ModelException,
PartNotFoundException,
+ HandlerNotFoundException, RemoteException;

/**
* Register a component with the system.
* @param component the component to register
*/
- void addComponent( Component component );
+ void addComponent( Component component ) throws RemoteException;

/**
* Start the system.
* @exception if a startup failure occurs
*/
- void start() throws Exception;
+ void start() throws Exception, RemoteException;

/**
* Stop the system.
*/
- void stop();
+ void stop() throws RemoteException;

/**
* Dispose of the manager.

Modified:
development/main/metro/part/src/main/net/dpml/part/model/Component.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/model/Component.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/model/Component.java
Mon Jun 20 11:02:59 2005
@@ -20,6 +20,7 @@

import java.net.URI;
import java.util.Map.Entry;
+import java.rmi.RemoteException;

import net.dpml.part.control.Controller;
import net.dpml.part.control.Identifiable;
@@ -40,15 +41,15 @@
/**
* Return a Manager for the component.
*/
- Manager getManager();
+ Manager getManager() throws RemoteException;

/**
* Initialize the component.
*/
- void initialize() throws Exception;
+ void initialize() throws Exception, RemoteException;

/**
* Termination of the component.
*/
- void terminate();
+ void terminate() throws RemoteException;
}

Modified: development/main/metro/part/src/main/net/dpml/part/model/Model.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/model/Model.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/model/Model.java Mon
Jun 20 11:02:59 2005
@@ -20,6 +20,8 @@

import java.net.URI;
import java.util.Map.Entry;
+import java.rmi.Remote;
+import java.rmi.RemoteException;

import net.dpml.part.control.Controller;
import net.dpml.part.control.Identifiable;
@@ -31,32 +33,32 @@
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
*/
-public interface Model extends Identifiable
+public interface Model extends Identifiable, Remote
{
/**
* Return the primary controller assigned to the model.
* @return the primary controller
*/
- Controller getController();
+ Controller getController() throws RemoteException;

/**
* Return the uri identifying the partition that this model is enclosed
within.
* @return the partition uri
*/
- URI getPartition();
+ URI getPartition() throws RemoteException;

/**
* Return the model key
* @return the key
*/
- Object getKey();
+ Object getKey() throws RemoteException;

/**
* Return the default service provider.
*
* @return the default service provider
*/
- Provider getProvider();
+ Provider getProvider() throws RemoteException;

/**
* Optional operation that returns an identifiable service provider.
@@ -64,6 +66,6 @@
* @param id the service provider identifier
* @return the identfied provider
*/
- Provider getProvider( Object id );
+ Provider getProvider( Object id ) throws RemoteException;

}

Modified:
development/main/metro/part/src/main/net/dpml/part/model/Provider.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/model/Provider.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/model/Provider.java
Mon Jun 20 11:02:59 2005
@@ -20,6 +20,8 @@

import java.net.URI;
import java.util.Map.Entry;
+import java.rmi.Remote;
+import java.rmi.RemoteException;

import net.dpml.part.control.Controller;
import net.dpml.part.control.Identifiable;
@@ -41,43 +43,43 @@
* Return the operational status of the model.
* @return the operational status
*/
- boolean isOperational();
+ boolean isOperational() throws RemoteException;

/**
* Add an availability listener to the provider.
* @param listener the availability listener
*/
- void addAvailabilityListener( AvailabilityListener listener );
+ void addAvailabilityListener( AvailabilityListener listener ) throws
RemoteException;

/**
* Remove an availability listener from the provider.
* @param listener the availability listener
*/
- void removeAvailabilityListener( AvailabilityListener listener );
+ void removeAvailabilityListener( AvailabilityListener listener ) throws
RemoteException;

/**
* Return the current state of the component.
* @return the current state
*/
- State getState();
+ State getState() throws RemoteException;

/**
* Add a state listener to the provider.
* @param listener the state listener
*/
- void addStateListener( StateListener listener );
+ void addStateListener( StateListener listener ) throws RemoteException;

/**
* Remove a state listener from the provider.
* @param listener the state listener
*/
- void removeStateListener( StateListener listener );
+ void removeStateListener( StateListener listener ) throws
RemoteException;

/**
* Return an initialized instance of the component.
* @return the resolved instance
*/
- Object resolve() throws Exception;
+ Object resolve() throws Exception, RemoteException;

/**
* Return an initialized instance of the component using a supplied
isolation policy.
@@ -90,7 +92,7 @@
* @param isolation the isolation policy
* @return the resolved instance
*/
- Object resolve( boolean isolation ) throws Exception;
+ Object resolve( boolean isolation ) throws Exception, RemoteException;

/**
* Applies a state transition identified by a supplied transition key.
@@ -99,7 +101,7 @@
* @return the state resulting from the transition
* @exception if a transition error occurs
*/
- State apply( String key ) throws Exception;
+ State apply( String key ) throws Exception, RemoteException;

/**
* Executes an operation identified by a supplied operation key.
@@ -107,12 +109,12 @@
* @param key the key identifying the operation to execute
* @exception if a transition error occurs
*/
- void execute( String key ) throws Exception;
+ void execute( String key ) throws Exception, RemoteException;

/**
* Release a reference to an object managed by the instance.
*
* @param instance the instance to release
*/
- void release( Object instance );
+ void release( Object instance ) throws RemoteException;
}

Modified:
development/main/metro/part/src/main/net/dpml/part/state/Operation.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/state/Operation.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/state/Operation.java
Mon Jun 20 11:02:59 2005
@@ -19,13 +19,14 @@
package net.dpml.part.state;

import java.net.URI;
+import java.io.Serializable;

/**
* The Operation links an operation to a handler uri.
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public final class Operation
+public final class Operation implements Serializable
{
private final URI m_handler;


Modified: development/main/metro/part/src/main/net/dpml/part/state/State.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/state/State.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/state/State.java Mon
Jun 20 11:02:59 2005
@@ -18,6 +18,7 @@

package net.dpml.part.state;

+import java.io.Serializable;
import java.util.Map;
import java.util.Hashtable;
import java.util.ArrayList;
@@ -31,7 +32,7 @@
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public final class State
+public final class State implements Serializable
{
private final String m_name;
private final State m_parent;

Modified:
development/main/metro/part/src/main/net/dpml/part/state/StateListener.java
==============================================================================
---
development/main/metro/part/src/main/net/dpml/part/state/StateListener.java
(original)
+++
development/main/metro/part/src/main/net/dpml/part/state/StateListener.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,8 @@

package net.dpml.part.state;

+import java.rmi.Remote;
+import java.rmi.RemoteException;
import java.util.EventListener;

/**
@@ -25,13 +27,13 @@
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public interface StateListener extends EventListener
+public interface StateListener extends EventListener, Remote
{
/**
* Notify the listener of a state change.
*
* @param event the state change event
*/
- void stateChanged( final StateEvent event );
+ void stateChanged( final StateEvent event ) throws RemoteException;
}


Modified:
development/main/metro/part/src/main/net/dpml/part/state/Transition.java
==============================================================================
--- development/main/metro/part/src/main/net/dpml/part/state/Transition.java
(original)
+++ development/main/metro/part/src/main/net/dpml/part/state/Transition.java
Mon Jun 20 11:02:59 2005
@@ -18,6 +18,7 @@

package net.dpml.part.state;

+import java.io.Serializable;
import java.net.URI;

/**
@@ -26,7 +27,7 @@
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public class Transition
+public class Transition implements Serializable
{
private final State m_target;
private final URI m_handler;

Modified: development/main/test/unit/index.xml
==============================================================================
--- development/main/test/unit/index.xml (original)
+++ development/main/test/unit/index.xml Mon Jun 20 11:02:59 2005
@@ -15,6 +15,7 @@
<dependencies>
<include key="dpml-test-simple"/>
<include key="dpml-composition-control"/>
+ <include key="dpml-depot-console"/>
<include key="ant-junit"/>
</dependencies>
<plugins>
@@ -34,6 +35,7 @@
<include key="dpml-test-simple"/>
<include key="dpml-test-plus"/>
<include key="dpml-composition-control"/>
+ <include key="dpml-depot-console"/>
<include key="ant-junit"/>
</dependencies>
<plugins>

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
Mon Jun 20 11:02:59 2005
@@ -326,7 +326,6 @@
synchronized( m_listener )
{
ContentRegistryModel model = m_model.getContentRegistryModel();
- model.initialize();
model.addCodeBaseListener( m_listener );
URI uri = model.getCodeBaseURI();
if( null != uri )
@@ -350,18 +349,21 @@
if( null != uri )
{
m_logger.info( "loading custom content handler registry" );
+ //ClassLoader classloader = getClass().getClassLoader();
+ ClassLoader classloader = Transit.class.getClassLoader();
try
{
Logger log = m_logger.getChildLogger( "content" );
Object[] args = new Object[]{ model, log };
- ClassLoader classloader = Transit.class.getClassLoader();
- return (ContentRegistry) getRepository().getPlugin(
classloader, uri, args );
+ Repository repository = getRepository();
+ return (ContentRegistry) repository.getPlugin(
classloader, uri, args );
}
catch( Throwable e )
{
final String error =
"Critical error while attempting to establish content
management subsystem."
- + "\nURI: " + uri;
+ + "\nURI: " + uri
+ + "\nClassLoader: " + classloader;
throw new TransitError( error, e );
}
}
@@ -377,7 +379,7 @@
catch( Throwable e )
{
final String error =
- "Critical error while attempting to establish content
management subsystem.";
+ "Critical error while attempting to establish default
content management subsystem.";
throw new TransitError( error, e );
}
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/ContentRegistryModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/ContentRegistryModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/ContentRegistryModel.java
Mon Jun 20 11:02:59 2005
@@ -30,11 +30,6 @@
public interface ContentRegistryModel extends CodeBaseModel
{
/**
- * Initialization of the content registry model.
- */
- void initialize() throws IOException;
-
- /**
* Return an array of content managers currently assigned to the registry.
* @return the content manager array
*/

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultContentRegistryModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultContentRegistryModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultContentRegistryModel.java
Mon Jun 20 11:02:59 2005
@@ -29,7 +29,6 @@
import java.util.EventObject;
import java.util.EventListener;

-import net.dpml.transit.Transit;
import net.dpml.transit.home.ContentRegistryHome;

/**
@@ -37,7 +36,7 @@
* infomration about the set of registred plugin handler configurations.
*
* @author <a href="http://www.dpml.net";>The Digital Product Meta Library</a>
- * @version $Id: StandardTransitDirector.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
+ * @version $Id: DefaultContentRegistryModel.java 2480 2005-05-10 04:44:32Z
mcconnell AT dpml.net $
*/
public class DefaultContentRegistryModel extends DisposableCodeBaseModel
implements ContentRegistryModel
@@ -50,18 +49,21 @@

private ContentRegistryHome m_home;

- private boolean m_init = false;
-
//
------------------------------------------------------------------------
// constructor
//
------------------------------------------------------------------------

public DefaultContentRegistryModel(
- Logger logger, Date creation, ContentRegistryHome home,
- URI uri ) throws DuplicateKeyException, RemoteException
+ Logger logger, Date creation, ContentRegistryHome home, URI uri,
ContentModel[] models )
+ throws DuplicateKeyException, RemoteException
{
super( logger, creation, home, uri );
m_home = home;
+ for( int i=0; i<models.length; i++ )
+ {
+ ContentModel model = models[i];
+ addContentModel( model, false );
+ }
}

//
------------------------------------------------------------------------
@@ -69,36 +71,6 @@
//
------------------------------------------------------------------------

/**
- * Initialization of the content registry model.
- */
- public void initialize() throws IOException
- {
- synchronized( m_lock )
- {
- if( false == m_init )
- {
- m_init = true;
- try
- {
- Transit.getInstance();
- ContentModel[] models = m_home.createContentModels();
- for( int i=0; i<models.length; i++ )
- {
- ContentModel model = models[i];
- addContentModel( model, false );
- }
- }
- catch( Throwable e )
- {
- final String error =
- "Unexpected exception during late initialization of
content models.";
- throw new ModelRuntimeException( error, e );
- }
- }
- }
- }
-
- /**
* Return an array of content managers currently assigned to the registry.
* @return the content manager array
*/
@@ -114,10 +86,6 @@
{
synchronized( m_lock )
{
- if( false == m_init )
- {
- throw new IllegalStateException( "init" );
- }
ContentModel[] managers = getContentModels();
for( int i=0; i<managers.length; i++ )
{

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/unit/ContentRegistryStorageUnit.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/unit/ContentRegistryStorageUnit.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/unit/ContentRegistryStorageUnit.java
Mon Jun 20 11:02:59 2005
@@ -24,8 +24,6 @@
import java.util.prefs.Preferences;
import java.util.prefs.BackingStoreException;

-import net.dpml.transit.Transit;
-import net.dpml.transit.artifact.Artifact;
import net.dpml.transit.home.ContentHome;
import net.dpml.transit.home.ContentRegistryHome;
import net.dpml.transit.model.DefaultContentRegistryModel;
@@ -111,7 +109,8 @@
try
{
URI uri = getCodeBaseURI();
- return new DefaultContentRegistryModel( logger, creation, this,
uri );
+ ContentModel[] models = createContentModels();
+ return new DefaultContentRegistryModel( logger, creation, this,
uri, models );
}
catch( Exception e )
{
@@ -125,61 +124,7 @@
Preferences prefs, Logger logger, Date creation, boolean policy )
throws BuilderException
{
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(
Transit.class.getClassLoader() );
- Repository repository = Transit.getInstance().getRepository();
- URI uri = getURI( prefs, "uri" );
- String classname = getPluginClassname( uri );
- String storageClassname = classname + "StorageUnit";
- ClassLoader classloader = getPluginClassLoader( uri );
- try
- {
- Class c = classloader.loadClass( storageClassname );
- Object[] args = new Object[]{ prefs, logger, creation, new
Boolean( policy ) };
- ContentHome home = (ContentHome) repository.instantiate( c,
args );
- return home.getContentModel();
- }
- catch( ClassNotFoundException e )
- {
- ContentStorageUnit home =
- new ContentStorageUnit( prefs, logger, creation, policy );
- return home.createContentModel();
- }
- catch( Throwable e )
- {
- final String error =
- "Error occured while attempting to load a custom content
home."
- + "\nClassname: " + classname
- + "\nURI: " + uri;
- throw new BuilderException( error, e );
- }
- }
- catch( Exception ue )
- {
- final String error =
- "Internal error while attempting to construct a content
model.";
- throw new BuilderException( error, ue );
- }
- finally
- {
- Thread.currentThread().setContextClassLoader( cl );
- }
- }
-
- private String getPluginClassname( URI uri ) throws Exception
- {
- Artifact artifact = Artifact.createArtifact( uri );
- URL url = artifact.toURL();
- Plugin plugin = (Plugin) url.getContent( new Class[]{ Plugin.class }
);
- return plugin.getClassname();
- }
-
- private ClassLoader getPluginClassLoader( URI uri ) throws Exception
- {
- Artifact artifact = Artifact.createArtifact( uri );
- URL url = artifact.toURL();
- return (ClassLoader) url.getContent( new Class[]{ ClassLoader.class
} );
+ ContentStorageUnit store = new ContentStorageUnit( prefs, logger,
creation, policy );
+ return store.createContentModel();
}
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/util/ExceptionHelper.java
Mon Jun 20 11:02:59 2005
@@ -22,6 +22,8 @@
import java.io.StringWriter;
import java.lang.reflect.Method;
import java.util.StringTokenizer;
+import java.rmi.activation.ActivationGroup;
+import java.rmi.activation.ActivationGroupID;

/**
* General utilities supporting the packaging of exception messages.
@@ -192,6 +194,13 @@
buffer.append( message );
buffer.append( "\n" );
}
+
+ ActivationGroupID groupID = ActivationGroup.currentGroupID();
+ if( null != groupID )
+ {
+ buffer.append( "Group: " + groupID );
+ buffer.append( "\n" );
+ }

if( e == null )
{



  • svn commit: r2896 - in development/main: depot/console/etc/bin depot/console/src/main/net/dpml/depot depot/console/src/main/net/dpml/depot/lang depot/console/src/main/net/dpml/depot/logging depot/console/src/main/net/dpml/depot/profile depot/test/mexico depot/test/mexico/src/main/net/dpml/test/mexico metro metro/composition/builder/src/main/net/dpml/composition/builder/datatypes metro/composition/control metro/composition/control/src/main/net/dpml/composition/control metro/composition/control/src/main/net/dpml/composition/event metro/composition/control/src/main/net/dpml/composition/model metro/composition/part/src/main/net/dpml/composition/part metro/part/src/main/net/dpml/part/control metro/part/src/main/net/dpml/part/model metro/part/src/main/net/dpml/part/state test/unit transit/core/handler/src/main/net/dpml/transit transit/core/handler/src/main/net/dpml/transit/model transit/core/handler/src/main/net/dpml/transit/unit transit/core/handler/src/main/net/dpml/transit/util, mcconnell, 06/20/2005

Archive powered by MHonArc 2.6.24.

Top of Page