adammurdoch 02/05/28 23:40:06
Modified: container/src/java/org/apache/myrmidon/components/embeddor
DefaultEmbeddor.java
Log:
Create a property store containing the system properties when DefaultEmbeddor
is initialised, rather than each time a workspace is created. This is closer
to what ant 1 does (and the old way was messing up myrmidon building
myrmidon).
Revision Changes Path
1.78 +16 -12
jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
Index: DefaultEmbeddor.java
===================================================================
RCS file:
/home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- DefaultEmbeddor.java 28 May 2002 03:29:56 -0000 1.77
+++ DefaultEmbeddor.java 29 May 2002 06:40:06 -0000 1.78
@@ -47,7 +47,7 @@
import org.apache.myrmidon.interfaces.library.Library;
import org.apache.myrmidon.interfaces.library.LibraryManager;
import org.apache.myrmidon.interfaces.oldmodel.Project;
-import org.apache.myrmidon.interfaces.property.NameValidator;
+import org.apache.myrmidon.interfaces.property.NameValidatorManager;
import org.apache.myrmidon.interfaces.property.PropertyResolver;
import org.apache.myrmidon.interfaces.property.PropertyStore;
import org.apache.myrmidon.interfaces.role.RoleManager;
@@ -63,7 +63,7 @@
* Instantiate this to embed inside other applications.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.77 $ $Date: 2002/05/28 03:29:56 $
+ * @version $Revision: 1.78 $ $Date: 2002/05/29 06:40:06 $
*/
public class DefaultEmbeddor
extends AbstractLogEnabled
@@ -85,6 +85,7 @@
private List m_components = new ArrayList();
private DefaultServiceManager m_serviceManager = new
DefaultServiceManager();
private Context m_context;
+ private PropertyStore m_rootProps;
/**
* Setup basic properties of engine.
@@ -137,7 +138,7 @@
}
/**
- * Creates a workspace.
+ * Creates an execution frame.
*/
public ExecutionFrame createExecutionFrame( final Map properties )
throws Exception
@@ -158,8 +159,9 @@
new DefaultServiceManager( msServiceManager );
// Create the property store
- final PropertyStore propStore = createBaseStore( properties );
+ final PropertyStore propStore = m_rootProps.createChildStore();
manager.put( PropertyStore.ROLE, propStore );
+ addToStore( propStore, properties );
return new DefaultExecutionFrame( "",
new File( "." ),
@@ -208,6 +210,9 @@
m_deployer = (Deployer)m_serviceManager.lookup( Deployer.ROLE );
m_typeManager = (TypeManager)m_serviceManager.lookup(
TypeManager.ROLE );
m_libraryManager = (LibraryManager)m_serviceManager.lookup(
LibraryManager.ROLE );
+
+ // create the root property store
+ m_rootProps = createBaseStore( m_serviceManager );
}
public void start()
@@ -297,9 +302,9 @@
createComponent( Executor.ROLE,
Executor.class,
PREFIX + "executor.DefaultExecutor" );
- createComponent( NameValidator.ROLE,
- NameValidator.class,
- PREFIX + "property.DefaultNameValidator" );
+ createComponent( NameValidatorManager.ROLE,
+ NameValidatorManager.class,
+ PREFIX + "property.DefaultNameValidatorManager" );
createComponent( PropertyResolver.ROLE,
PropertyResolver.class,
PREFIX + "property.DefaultPropertyResolver" );
@@ -401,16 +406,15 @@
}
/**
- * Creates the root property store for a workspace
+ * Creates the root property store.
*/
- private PropertyStore createBaseStore( final Map properties )
+ private PropertyStore createBaseStore( final ServiceManager
serviceManager )
throws Exception
{
final DefaultPropertyStore store = new DefaultPropertyStore();
+ ContainerUtil.service( store, serviceManager );
- addToStore( store, properties );
-
- //Add system properties so that they overide user-defined properties
+ //Add system properties
addToStore( store, System.getProperties() );
//Add runtime info
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>