[jboss-cvs] JBossAS SVN: r104545 - in projects/ejb3/components/embedded/trunk: impl-as/src/main/resources and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu May 6 21:30:19 EDT 2010
Author: ALRubinger
Date: 2010-05-06 21:30:19 -0400 (Thu, 06 May 2010)
New Revision: 104545
Modified:
projects/ejb3/components/embedded/trunk/impl-as/src/main/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerASAdaptor.java
projects/ejb3/components/embedded/trunk/impl-as/src/main/resources/embedded-ejb-as-adaptor-jboss-beans.xml
projects/ejb3/components/embedded/trunk/impl-as/src/test/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerExistingMCServerIntegrationUnitTest.java
projects/ejb3/components/embedded/trunk/impl-base/src/main/java/org/jboss/ejb3/embedded/impl/base/JBossEJBContainerBase.java
Log:
[EJBTHREE-2083] Fix nondeterministic type-based injection and add tests to align with AS
Modified: projects/ejb3/components/embedded/trunk/impl-as/src/main/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerASAdaptor.java
===================================================================
--- projects/ejb3/components/embedded/trunk/impl-as/src/main/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerASAdaptor.java 2010-05-07 00:24:30 UTC (rev 104544)
+++ projects/ejb3/components/embedded/trunk/impl-as/src/main/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerASAdaptor.java 2010-05-07 01:30:19 UTC (rev 104545)
@@ -24,6 +24,7 @@
import javax.ejb.embeddable.EJBContainer;
import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.bootstrap.api.mc.server.MCBasedServer;
import org.jboss.bootstrap.api.mc.server.MCServer;
/**
@@ -51,7 +52,7 @@
* {@link MCServer} instance handling all wiring of components which together
* will compose the JBoss Embedded EJB3 implementation.
*/
- private static volatile MCServer server;
+ private static volatile MCBasedServer<?, ?> server;
//-------------------------------------------------------------------------------------||
// Constructor ------------------------------------------------------------------------||
@@ -66,7 +67,7 @@
* @throws IllegalArgumentException If the server is not specified
* @throws IllegalStateException If this has already been called
*/
- public EmbeddedEJBContainerASAdaptor(@Inject final MCServer server) throws IllegalStateException,
+ public EmbeddedEJBContainerASAdaptor(@Inject final MCBasedServer<?, ?> server) throws IllegalStateException,
IllegalArgumentException
{
// So that we can't reset the MC Server
@@ -93,7 +94,7 @@
*
* @throws IllegalStateException If the {@link MCServer} has not yet been set
*/
- static MCServer getMCServer() throws IllegalStateException
+ static MCBasedServer<?, ?> getMCServer() throws IllegalStateException
{
// Precondition checks
if (server == null)
@@ -113,7 +114,8 @@
* @throws IllegalStateException If the {@link MCServer} has already been set
* @throws IllegalArgumentException If the specified {@link MCServer} is null
*/
- private static void setMCServer(final MCServer server) throws IllegalStateException, IllegalArgumentException
+ private static void setMCServer(final MCBasedServer<?, ?> server) throws IllegalStateException,
+ IllegalArgumentException
{
// Precondition checks
if (server == null)
Modified: projects/ejb3/components/embedded/trunk/impl-as/src/main/resources/embedded-ejb-as-adaptor-jboss-beans.xml
===================================================================
--- projects/ejb3/components/embedded/trunk/impl-as/src/main/resources/embedded-ejb-as-adaptor-jboss-beans.xml 2010-05-07 00:24:30 UTC (rev 104544)
+++ projects/ejb3/components/embedded/trunk/impl-as/src/main/resources/embedded-ejb-as-adaptor-jboss-beans.xml 2010-05-07 01:30:19 UTC (rev 104545)
@@ -11,8 +11,8 @@
<bean name="org.jboss.ejb3.EmbeddedEJBContainerASAdaptor"
class="org.jboss.ejb3.embedded.impl.as.EmbeddedEJBContainerASAdaptor">
<constructor>
- <parameter class="org.jboss.bootstrap.api.mc.server.MCServer">
- <inject />
+ <parameter class="org.jboss.bootstrap.api.mc.server.MCBasedServer">
+ <inject bean="JBossServer"/>
</parameter>
</constructor>
</bean>
Modified: projects/ejb3/components/embedded/trunk/impl-as/src/test/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerExistingMCServerIntegrationUnitTest.java
===================================================================
--- projects/ejb3/components/embedded/trunk/impl-as/src/test/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerExistingMCServerIntegrationUnitTest.java 2010-05-07 00:24:30 UTC (rev 104544)
+++ projects/ejb3/components/embedded/trunk/impl-as/src/test/java/org/jboss/ejb3/embedded/impl/as/EmbeddedEJBContainerExistingMCServerIntegrationUnitTest.java 2010-05-07 01:30:19 UTC (rev 104545)
@@ -140,6 +140,19 @@
// Start
server.start();
+ // Install the server into MC again as another alias (AS does not have the type unique, so we ensure
+ // that we're correctly doing this by name)
+ final BeanMetaDataBuilder bmdb = BeanMetaDataBuilderFactory.createBuilder("JBossServer-alias", server.getClass()
+ .getName());
+ try
+ {
+ server.getKernel().getController().install(bmdb.getBeanMetaData());
+ }
+ catch (final Throwable e1)
+ {
+ throw new RuntimeException("Could not install JBossServer as alias", e1);
+ }
+
// Install a mock ShrinkWrapDeployer (we don't need a real one here)
final BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(
MockShrinkWrapDeployer.class.getName()).setName(MockShrinkWrapDeployer.class.getSimpleName());
Modified: projects/ejb3/components/embedded/trunk/impl-base/src/main/java/org/jboss/ejb3/embedded/impl/base/JBossEJBContainerBase.java
===================================================================
--- projects/ejb3/components/embedded/trunk/impl-base/src/main/java/org/jboss/ejb3/embedded/impl/base/JBossEJBContainerBase.java 2010-05-07 00:24:30 UTC (rev 104544)
+++ projects/ejb3/components/embedded/trunk/impl-base/src/main/java/org/jboss/ejb3/embedded/impl/base/JBossEJBContainerBase.java 2010-05-07 01:30:19 UTC (rev 104545)
@@ -34,6 +34,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.bootstrap.api.mc.server.MCBasedServer;
import org.jboss.bootstrap.api.mc.server.MCServer;
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.deployers.client.spi.main.MainDeployer;
@@ -87,7 +88,7 @@
/**
* Underlying MC Server
*/
- private final MCServer mcServer;
+ private final MCBasedServer<?, ?> mcServer;
/**
* All deployments currently installed via this container
@@ -104,7 +105,7 @@
// Constructor ------------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
- protected JBossEJBContainerBase(final Map<?, ?> properties, final String[] modules, final MCServer server)
+ protected JBossEJBContainerBase(final Map<?, ?> properties, final String[] modules, final MCBasedServer<?, ?> server)
{
// Precondition checks
if (server == null)
@@ -309,7 +310,7 @@
*
* @return
*/
- protected MCServer getMCServer()
+ protected MCBasedServer<?, ?> getMCServer()
{
return mcServer;
}
More information about the jboss-cvs-commits
mailing list