Hi,
after much Whisky and good hacking, here some patches we forgot to commit,
and I didn't get Niclas password ;)
Commissioner adds some more informations to the Thread name, good for
debugging purposes.
<<commissioner.txt>>
Some more changes to get around the new Naming pattern.
<<testcase.txt>>
/peter
---------------------------------
Peter Neubauer
Software Manager
ScanCoin Industries AB
Index:
composition/impl/src/java/org/apache/avalon/composition/model/impl/Commissioner.java
===================================================================
---
composition/impl/src/java/org/apache/avalon/composition/model/impl/Commissioner.java
(revision 43579)
+++
composition/impl/src/java/org/apache/avalon/composition/model/impl/Commissioner.java
(working copy)
@@ -62,12 +62,12 @@
// constructor
//------------------------------------------------------------
- Commissioner( Logger logger, boolean flag )
+ Commissioner( Logger logger, boolean flag, String tag )
{
m_logger = logger;
m_ThreadCounter++;
final String name =
- "Commissioner [" + m_ThreadCounter + "]";
+ "Commissioner [" + tag + ", " + m_ThreadCounter + "]";
m_flag = flag;
if( flag )
{
@@ -80,6 +80,11 @@
m_thread = new Thread( this, name );
m_thread.start();
}
+
+ Commissioner( Logger logger, boolean flag )
+ {
+ this( logger, flag, "unnamed" );
+ }
//------------------------------------------------------------
// implementation
@@ -131,11 +136,11 @@
+ "]" );
}
}
-
+
CommissionRequest request =
new CommissionRequest( model, m_thread );
- m_queue.put( request );
- long t = request.waitForCompletion();
+ m_queue.put( request );
+ long t = request.waitForCompletion();
if( m_logger.isDebugEnabled() )
{
m_logger.debug(
@@ -180,7 +185,7 @@
DeploymentModel model = request.getDeploymentModel();
try
{
- if( m_flag )
+ if( m_flag )
{
model.commission();
}
Index:
composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
===================================================================
---
composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
(revision 43579)
+++
composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
(working copy)
@@ -207,7 +207,6 @@
public void commission() throws Exception
{
assemble();
-
synchronized( m_commissioned )
{
if( m_commissioned.isEnabled() ) return;
@@ -217,11 +216,10 @@
// we locate the locally scoped models
// and deploy them
//
-
DeploymentModel[] startup = getStartupGraph();
-
+
Commissioner commissioner =
- new Commissioner( getLogger(), true );
+ new Commissioner( getLogger(), true, this.getName() );
try
{
@@ -235,7 +233,7 @@
{
commissioner.dispose();
}
-
+
//
// all subsidary model and runtime structures are not
// fully commissioned and we can proceed with the
Index: meta/impl/src/test/org/apache/avalon/meta/classic/Test.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/classic/Test.java (revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/classic/Test.java (working copy)
@@ -1,22 +0,0 @@
-/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.avalon.meta.classic;
-
-public class Test
-{
-}
Index: meta/impl/src/test/org/apache/avalon/meta/classic/Test.xinfo
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/classic/Test.xinfo (revision
43579)
+++ meta/impl/src/test/org/apache/avalon/meta/classic/Test.xinfo (working copy)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE type PUBLIC "-//AVALON/Type DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/meta/type_1_1.dtd" >
-
-<type>
- <info>
- <name>test</name>
- <version>1.0.0</version>
- <lifestyle>singleton</lifestyle>
- </info>
- <services>
- <service type="org.apache.avalon.merlin.test.Hello" version="1.0.0"/>
- </services>
-</type>
\ No newline at end of file
Index: meta/impl/src/test/org/apache/avalon/meta/classic/TestClass.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/classic/TestClass.java (revision
43456)
+++ meta/impl/src/test/org/apache/avalon/meta/classic/TestClass.java (working copy)
@@ -17,6 +17,6 @@
package org.apache.avalon.meta.classic;
-public class Test
+public class TestClass
{
}
Index: meta/impl/src/test/org/apache/avalon/meta/classic/ClassicTestCase.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/classic/ClassicTestCase.java
(revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/classic/ClassicTestCase.java
(working copy)
@@ -39,7 +39,7 @@
{
TypeBuilder builder = new TypeBuilder();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class clazz = loader.loadClass( "org.apache.avalon.meta.classic.Test" );
+ Class clazz = loader.loadClass( "org.apache.avalon.meta.classic.TestClass" );
m_type = builder.buildType( clazz );
}
@@ -56,6 +56,6 @@
public void testClassName() throws Exception
{
assertTrue(
- m_type.getInfo().getClassname().equals(
"org.apache.avalon.meta.classic.Test" ) );
+ m_type.getInfo().getClassname().equals(
"org.apache.avalon.meta.classic.TestClass" ) );
}
}
Index: meta/impl/src/test/org/apache/avalon/meta/compat/CompatTestCase.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/compat/CompatTestCase.java
(revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/compat/CompatTestCase.java
(working copy)
@@ -39,7 +39,7 @@
{
TypeBuilder builder = new TypeBuilder();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class clazz = loader.loadClass( "org.apache.avalon.meta.compat.Test" );
+ Class clazz = loader.loadClass( "org.apache.avalon.meta.compat.TestClass" );
m_type = builder.buildType( clazz );
}
@@ -56,6 +56,6 @@
public void testClassName() throws Exception
{
assertTrue(
- m_type.getInfo().getClassname().equals(
"org.apache.avalon.meta.compat.Test" ) );
+ m_type.getInfo().getClassname().equals(
"org.apache.avalon.meta.compat.TestClass" ) );
}
}
Index: meta/impl/src/test/org/apache/avalon/meta/compat/Test.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/compat/Test.java (revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/compat/Test.java (working copy)
@@ -1,22 +0,0 @@
-/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.avalon.meta.compat;
-
-public class Test
-{
-}
Index: meta/impl/src/test/org/apache/avalon/meta/compat/Test.xinfo
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/compat/Test.xinfo (revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/compat/Test.xinfo (working copy)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE type PUBLIC "-//AVALON/Type DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/meta/type_1_1.dtd" >
-
-<type>
- <info>
- <name>test</name>
- <version>1.0.0</version>
- <attributes>
- <attribute key="urn:avalon:lifestyle" value="singleton"/>
- </attributes>
- </info>
-</type>
\ No newline at end of file
Index: meta/impl/src/test/org/apache/avalon/meta/compat/TestClass.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/compat/TestClass.java (revision
43456)
+++ meta/impl/src/test/org/apache/avalon/meta/compat/TestClass.java (working copy)
@@ -17,6 +17,6 @@
package org.apache.avalon.meta.compat;
-public class Test
+public class TestClass
{
}
Index: meta/impl/src/test/org/apache/avalon/meta/legacy/Test.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/legacy/Test.java (revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/legacy/Test.java (working copy)
@@ -1,22 +0,0 @@
-/*
- * Copyright 2004 Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.avalon.meta.legacy;
-
-public class Test
-{
-}
Index: meta/impl/src/test/org/apache/avalon/meta/legacy/LegacyTestCase.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/legacy/LegacyTestCase.java
(revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/legacy/LegacyTestCase.java
(working copy)
@@ -39,13 +39,13 @@
{
TypeBuilder builder = new TypeBuilder();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class clazz = loader.loadClass( "org.apache.avalon.meta.legacy.Test" );
+ Class clazz = loader.loadClass( "org.apache.avalon.meta.legacy.TestClass" );
m_type = builder.buildType( clazz );
}
public void testName() throws Exception
{
- assertTrue( m_type.getInfo().getName().equals( "test" ) );
+ assertTrue( m_type.getInfo().getName().equals( "testclass" ) );
}
public void testLifestyle() throws Exception
@@ -56,6 +56,6 @@
public void testClassName() throws Exception
{
assertTrue(
- m_type.getInfo().getClassname().equals(
"org.apache.avalon.meta.legacy.Test" ) );
+ m_type.getInfo().getClassname().equals(
"org.apache.avalon.meta.legacy.TestClass" ) );
}
}
Index: meta/impl/src/test/org/apache/avalon/meta/legacy/Test.xinfo
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/legacy/Test.xinfo (revision 43579)
+++ meta/impl/src/test/org/apache/avalon/meta/legacy/Test.xinfo (working copy)
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE blockinfo PUBLIC "-//PHOENIX/Block Info DTD Version 1.0//EN"
- "http://jakarta.apache.org/avalon/dtds/phoenix/blockinfo_1_0.dtd">
-
-<blockinfo>
-
- <block>
- <version>1.0</version>
- </block>
-
- <services>
- <service
name="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/>
- </services>
-
- <dependencies>
- <dependency>
- <service name="org.apache.avalon.cornerstone.services.threads.ThreadManager"
version="1.0"/>
- </dependency>
- </dependencies>
-
-</blockinfo>
Index: meta/impl/src/test/org/apache/avalon/meta/legacy/TestClass.java
===================================================================
--- meta/impl/src/test/org/apache/avalon/meta/legacy/TestClass.java (revision
43456)
+++ meta/impl/src/test/org/apache/avalon/meta/legacy/TestClass.java (working copy)
@@ -17,6 +17,6 @@
package org.apache.avalon.meta.legacy;
-public class Test
+public class TestClass
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]