[webbeans-commits] Webbeans SVN: r2806 - in tck/trunk/impl/src/main: resources and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-10 07:42:30 -0400 (Wed, 10 Jun 2009)
New Revision: 2806
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextIntegrationTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
update tck to 20090519
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextIntegrationTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextIntegrationTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * 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.jboss.jsr299.tck.tests.context;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: PRD2
- */
-@Artifact
-@IntegrationTest
-public class ContextIntegrationTest
-{
- @Test(groups = { "stub", "contexts", "integration" })
- @SpecAssertion(section = "8.5", id = "c")
- public void testBuiltInNormalScopedContextsDoNotPropagateAcrossRemoteMethodInvocations()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "contexts", "integration" })
- @SpecAssertion(section = "8.5", id = "c")
- public void testBuiltInNormalScopedContextsDoNotPropagateAcrossAsynchronousMethodInvocations()
- {
- assert false;
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -18,7 +18,8 @@
/**
*
- * Spec version: PRD2
+ * Spec version: 20090519
+ *
*/
@Artifact
public class ContextTest extends AbstractJSR299Test
@@ -59,7 +60,7 @@
}
@Test(expectedExceptions = { IllegalStateException.class }, groups = { "manager" })
- @SpecAssertion(section = "8.6", id = "d")
+ @SpecAssertion(section = "6.5.1", id = "b")
public void testGetContextWithTooManyActiveContextsFails()
{
Context firstContext = new DummyContext()
@@ -74,25 +75,15 @@
}
@Test(expectedExceptions = { ContextNotActiveException.class }, groups = { "manager" })
- @SpecAssertion(section = "8.6", id = "c")
+ @SpecAssertion(section = "6.5.1", id = "a")
public void testGetContextWithNoRegisteredContextsFails()
{
getCurrentManager().getContext(Unregistered.class);
}
- /**
- * For each of the built-in normal scopes, contexts propagate across any Java
- * method call, including invocation of EJB local business methods.
- */
- @Test(groups = { "stub", "contexts", "underInvestigation" })
- @SpecAssertion(section = "8.5", id = "b")
- public void testBuiltInNormalScopedContextsPropagateAcrossAnyJavaMethodCall()
- {
- assert false;
- }
-
@Test(groups = { "contexts" })
- @SpecAssertion(section = "8.5", id = "a")
+ @SpecAssertion(section = "unknown", id = "unknown")
+ //@SpecAssertion(section = "8.5", id = "a")
public void testBuiltInContexts()
{
Context context = getCurrentManager().getContext(Dependent.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -9,11 +9,16 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class DestroyedInstanceReturnedByGetTest extends AbstractJSR299Test
{
@Test(groups = { "contexts" })
- @SpecAssertion(section = "8.1", id = "g")
+ @SpecAssertion(section = "6.2", id = "q")
public void testDestroyedInstanceMustNotBeReturnedByGet()
{
Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -14,7 +14,7 @@
public class GetOnInactiveContextTest extends AbstractJSR299Test
{
@Test(groups = { "contexts" }, expectedExceptions = { ContextNotActiveException.class })
- @SpecAssertion(section = "8.1", id = "h")
+ @SpecAssertion(section = "6.2", id = "m")
public void testInvokingGetOnInactiveContextFails()
{
Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -11,11 +11,16 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class GetTest extends AbstractJSR299Test
{
@Test(groups = { "contexts" })
- @SpecAssertion(section = "8.1", id = "e")
+ @SpecAssertion(section = "6.2", id = "o")
public void testGetMayNotCreateNewInstanceUnlessCreationalContextGiven()
{
Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -4,15 +4,24 @@
import javax.enterprise.context.spi.Contextual;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class GetWithNoCreationalContextTest extends AbstractJSR299Test
{
@Test(groups = { "contexts" })
- @SpecAssertion(section = "8.1", id = "b")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "na"),
+ @SpecAssertion(section = "6.2", id = "k")
+ })
public void testGetWithoutCreationalContextReturnsNull()
{
Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -8,13 +8,18 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class InactiveContextTest extends AbstractJSR299Test
{
@Test(expectedExceptions = { ContextNotActiveException.class }, groups = { "manager" })
- @SpecAssertion(section = "8.6", id = "c")
+ @SpecAssertion(section = "6.2", id = "m")
public void testGetContextWithNoActiveContextsFails()
{
getCurrentConfiguration().getContexts().setInactive(getCurrentConfiguration().getContexts().getRequestContext());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-10 11:42:30 UTC (rev 2806)
@@ -15,7 +15,7 @@
/**
* This class tests a basic context against section 8 of the specification
*
- * Spec version: PRD2
+ * Spec version: 20090519
*
* @author Nicklas Karlsson
* @author Pete Muir
@@ -27,8 +27,8 @@
@Test(groups = { "contexts" })
@SpecAssertions( {
- @SpecAssertion(section = "8.1", id = "a"),
- @SpecAssertion(section = "8.2", id = "c")
+ @SpecAssertion(section = "6.2", id = "j"),
+ @SpecAssertion(section = "6.3", id = "c")
} )
public void testGetReturnsExistingInstance()
{
@@ -42,7 +42,7 @@
@Test(groups = { "contexts" })
@SpecAssertions( {
- @SpecAssertion(section = "8.1", id = "c")
+ @SpecAssertion(section = "6.2", id = "l")
} )
public void testGetWithCreationalContextReturnsNewInstance()
{
@@ -57,8 +57,8 @@
}
@Test(groups = { "contexts" })
- @SpecAssertion(section = "8.1", id = "d")
- public void testGetMayNotReturnNullUnlessNoCreationalContextOrContextualCreateReturnsNull()
+ @SpecAssertion(section = "6.2", id = "nb")
+ public void testGetMayNotReturnNullUnlessContextualCreateReturnsNull()
{
// The case of no creational context is already tested where a null is
// returned. Here we just test that the contextual create can return null.
@@ -73,10 +73,8 @@
@Test(groups = { "contexts" })
@SpecAssertions( {
- @SpecAssertion(section = "6", id = "i"),
- @SpecAssertion(section = "6", id = "j"),
- @SpecAssertion(section = "8.1", id = "f"),
- @SpecAssertion(section = "8.2", id = "d")
+ @SpecAssertion(section = "6.2", id = "p"),
+ @SpecAssertion(section = "6.3", id = "d")
})
public void testContextDestroysBeansWhenDestroyed()
{
@@ -96,7 +94,7 @@
@Test(groups = { "contexts" })
@SpecAssertions( {
- @SpecAssertion(section = "8.2", id = "e")
+ @SpecAssertion(section = "6.3", id = "e")
})
public void testSameNormalScopeBeanInjectedEverywhere()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-10 11:16:01 UTC (rev 2805)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-10 11:42:30 UTC (rev 2806)
@@ -2546,18 +2546,26 @@
<text>If the context object is inactive, the |get()| method must throw a |ContextNotActiveException|.</text>
</assertion>
- <assertion id="n">
- <text>The |get()| method may not return a null value unless no |CreationalContext| is given, or |Contextual.create()| returns a null value.</text>
+ <assertion id="na">
+ <text>The |get()| method may not return a null value _unless no |CreationalContext| is given_, or |Contextual.create()| returns a null value.</text>
</assertion>
+ <assertion id="nb">
+ <text>The |get()| method may not return a null value unless no |CreationalContext| is given, or _|Contextual.create()| returns a null value_.</text>
+ </assertion>
+
<assertion id="o">
<text>The |get()| method may not create a new instance of the given contextual type unless a |CreationalContext| is given.</text>
</assertion>
<assertion id="p">
<text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()|
-method of the Contextual object representing the contextual type. A destroyed instance must not subsequently be returned by the |get()| method.</text>
+method of the Contextual object representing the contextual type.</text>
</assertion>
+
+ <assertion id="q">
+ <text> A destroyed instance must not subsequently be returned by the |get()| method.</text>
+ </assertion>
</section>
<section id="6.3" title="Normal scopes and pseudo-scopes">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2805 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities: child and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-10 07:16:01 -0400 (Wed, 10 Jun 2009)
New Revision: 2805
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java
Log:
update tck to 20090519
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -27,6 +27,12 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class ActivitiesTest extends AbstractJSR299Test
{
@@ -170,7 +176,6 @@
@Test
@SpecAssertions({
@SpecAssertion(section="11.6", id="b"),
- @SpecAssertion(section="11.6", id="m"),
@SpecAssertion(section="11.6", id="d")
})
public void testBeanBelongingToParentActivityBelongsToChildActivity()
@@ -196,8 +201,7 @@
@Test
@SpecAssertions({
- @SpecAssertion(section="11.6", id="j"),
- @SpecAssertion(section="11.6", id="n")
+ @SpecAssertion(section="11.6", id="j")
})
public void testObserverBelongingToParentActivityBelongsToChildActivity()
{
@@ -238,7 +242,7 @@
}
@Test
- @SpecAssertion(section="11.6", id="o")
+ @SpecAssertion(section="11.6", id="g")
public void testBeanBelongingToChildActivityCannotBeInjectedIntoParentActivityBean()
{
assert getBeans(Cow.class).size() == 1;
@@ -249,7 +253,7 @@
}
@Test(expectedExceptions=UnsatisfiedResolutionException.class)
- @SpecAssertion(section="11.6", id="r")
+ @SpecAssertion(section="11.6", id="i")
public void testInstanceProcessedByParentActivity()
{
Context dummyContext = new DummyContext();
@@ -279,7 +283,7 @@
}
@Test
- @SpecAssertion(section="11.6", id="s")
+ @SpecAssertion(section="11.6", id="f")
public void testObserverBelongingToChildDoesNotFireForParentActivity()
{
BeanManager childActivity = getCurrentManager().createActivity();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -20,6 +20,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class SameBeanTypeInChildActivityTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -22,6 +22,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class ELCurrentActivityTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -14,6 +14,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class EventCurrentActivityTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -14,6 +14,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class InactiveScopeTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -13,6 +13,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class InjectedManagerCurrentActivityTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -22,6 +22,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class InstanceCurrentActivityTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -14,6 +14,11 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
@IntegrationTest
public class JndiManagerCurrentActivityTest extends AbstractJSR299Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java 2009-06-10 11:01:30 UTC (rev 2804)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java 2009-06-10 11:16:01 UTC (rev 2805)
@@ -13,6 +13,11 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
@Artifact
public class NonNormalScopeTest extends AbstractJSR299Test
{
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2804 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-10 07:01:30 -0400 (Wed, 10 Jun 2009)
New Revision: 2804
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
Log:
update tck to 20090519
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-06-10 10:53:16 UTC (rev 2803)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-06-10 11:01:30 UTC (rev 2804)
@@ -11,7 +11,7 @@
/**
*
- * Spec version: PRD2
+ * Spec version: 20090519
*
*/
@Artifact
@@ -19,7 +19,7 @@
{
@Test
- @SpecAssertion(section = "5.4", id = "b")
+ @SpecAssertion(section = "5.3", id = "b")
public void testClientProxyUsedForNormalScope()
{
Tuna tuna = getInstanceByType(Tuna.class);
@@ -27,7 +27,7 @@
}
@Test
- @SpecAssertion(section = "5.4", id = "a")
+ @SpecAssertion(section = "5.3", id = "a")
public void testClientProxyNotUsedForPseudoScope() throws Exception
{
new RunInDependentContext()
@@ -45,7 +45,8 @@
}
@Test(groups="incontainer-ri-broken")
- @SpecAssertion(section = "5.4", id = "c")
+ //@SpecAssertion(section = "5.4", id = "c")
+ @SpecAssertion(section = "unknown", id = "unknown")
public void testSimpleWebBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
{
TunedTuna tuna = getInstanceByType(TunedTuna.class);
@@ -57,7 +58,7 @@
}
@Test
- @SpecAssertion(section = "5.4.2", id = "a")
+ @SpecAssertion(section = "5.3.2", id = "aa")
public void testClientProxyInvocation()
{
Bean<TunedTuna> tunaBean = getBeans(TunedTuna.class).iterator().next();
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2803 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-10 06:53:16 -0400 (Wed, 10 Jun 2009)
New Revision: 2803
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
fix parsing problem
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-10 01:47:00 UTC (rev 2802)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-10 10:53:16 UTC (rev 2803)
@@ -2253,7 +2253,9 @@
</section>
<section id="5.4.5" title="Destruction of dependent objects">
- <text>When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all dependent objects, as defined in Section 6.4.3, "Dependent object destruction", after the |@PreDestroy| callback completes and after the servlet |destroy()| method is called.</text>
+ <assertion>
+ <text>When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all dependent objects, as defined in Section 6.4.3, "Dependent object destruction", after the |@PreDestroy| callback completes and after the servlet |destroy()| method is called.</text>
+ </assertion>
</section>
<section id="5.4.6" title="Invocation of producer or disposal methods">
@@ -3490,7 +3492,7 @@
</assertion>
<assertion id="b">
- <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
+ <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
</assertion>
<assertion id="c">
@@ -4713,7 +4715,7 @@
</assertion>
<assertion id="f">
- <text>Beans and observers registered with an activity are visible only to that activity and its children�they are never visible to direct or indirect parent activities, or to other children of the parent activity.</text>
+ <text>Beans and observers registered with an activity are visible only to that activity and its children�they are never visible to direct or indirect parent activities, or to other children of the parent activity.</text>
</assertion>
<assertion id="g">
@@ -4862,7 +4864,7 @@
</assertion>
<assertion id="i">
- <text>If the class is a bean, the container must search the class for observer methods, and for each observer method create an Observer, as defined in Section 10.6.1, �Observer method notification�, for the observer method and fire an event of type ProcessObserver, as defined in Section 11.5.8, �ProcessObserver event�.</text>
+ <text>If the class is a bean, the container must search the class for observer methods, and for each observer method create an Observer, as defined in Section 10.6.1, �Observer method notification�, for the observer method and fire an event of type ProcessObserver, as defined in Section 11.5.8, �ProcessObserver event�.</text>
</assertion>
<assertion id="j">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2802 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-09 21:47:00 -0400 (Tue, 09 Jun 2009)
New Revision: 2802
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
updated section 12 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-09 23:47:01 UTC (rev 2801)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-10 01:47:00 UTC (rev 2802)
@@ -4774,290 +4774,134 @@
<text>A bean registered with an activity is only available to Unified EL expressions that are evaluated when that activity or one of its children is the current activity.</text>
</assertion>
</section>
-
-
-
-
-
-
-
-
- <section id="11" title="Packaging and Deployment">
+ <section id="12" title="Packaging and Deployment">
</section>
- <section id="11.1" title="Deployment lifecycle">
+ <section id="12.1" title="Bean deployment archives">
<assertion id="a">
- <text>First, the container performs bean discovery and registers |Bean| and |Observer| objects for the discovered beans. The container detects definition errors by validating the bean classes and metadata, throwing a |DeploymentException| and aborting deployment of the application if any definition errors exist, as defined in Section 10.1, "Definition errors".</text>
- <note>Test that beans and observers are registered and definition exceptions occur before @Initialized, and that this causes the app deployment to fail</note>
+ <text>Bean classes must be deployed in any EAR, JAR, WAR, EJB-JAR or RAR archive or directory in the application classpath that has a file named |beans.xml| in the metadata directory (META-INF, or WEB-INF in the case of a WAR). Any such archive or directory is called a bean deployment archive.</text>
</assertion>
<assertion id="b">
- <text>Next, the container raises an event of type |@Initialized Manager|, allowing the application or third-party frameworks to register additional |Bean| and |Observer| objects.</text>
- <note>Test that the @Initialized event is called, and that beans are registered</note>
+ <text>When searching for beans, the container considers any Java class in any bean deployment archive, and any |ejb-jar.xml| file in any bean deployment archive.</text>
</assertion>
<assertion id="c">
- <text>Next, the container detects deployment problems by validating bean dependencies and specialization, throwing a |DeploymentException| and aborting deployment of the application if any deployment problems exist, as defined in Section 10.2, "Deployment problems".</text>
- <note>Test that validation happens after @Initialized and before @Deployed and that deployment problems cause deployment to fail</note>
- </assertion>
-
- <assertion id="d">
- <text>Next, the container raises an event of type |@Deployed Manager|.</text>
- <note>Test that the @Deployed event is called</note>
- </assertion>
-
- <assertion id="e">
- <text>Finally, the container begins directing requests to the application.</text>
- <note>Test that the app is usable</note>
- </assertion>
-
+ <text>If a bean is deployed to a location that is not in the application classpath, or does not contain a file named |beans.xml| in the metadata directory, it will not be discovered by the container.</text>
+ </assertion>
</section>
-
- <section id="11.2" title="Bean discovery">
- <assertion id="a" implied="true">
- <text>When bean discovery occurs, the container considers any |beans.xml| file in any metadata directory of the application classpath (standalone WAR)</text>
+
+ <section id="12.2" title="Application initialization lifecycle">
+ <assertion id="a">
+ <text>When an application is started, the container performs the following steps.</text>
</assertion>
- <assertion id="b" implied="true">
- <text>When bean discovery occurs, the container considers any |beans.xml| file in any metadata directory of the application classpath (jar in |WEB-INF/lib| of standalone WAR)</text>
+ <assertion id="b">
+ <text>First, the container must search for service providers for the service |javax.enterprise.inject.spi.Extension| defined in Section 11.5, "Container lifecycle events", instantiate a single instance of each service provider, and search the service provider class for observer methods of initialization events.</text>
</assertion>
- <assertion id="c" implied="true">
- <text>When bean discovery occurs, the container considers any |beans.xml| file in any metadata directory of the application classpath (WAR in EAR)</text>
+ <assertion id="c">
+ <text>Next, the container must fire an event of type |BeforeBeanDiscovery|, as defined in Section 11.5.1, "BeforeBeanDiscovery event".</text>
</assertion>
- <assertion id="d" implied="true">
- <text>When bean discovery occurs, the container considers any |beans.xml| file in any metadata directory of the application classpath (jar in |WEB-INF/lib| of WAR in EAR)</text>
+ <assertion id="d">
+ <text>Next, the container must perform bean discovery, and abort initialization of the application if any definition errors exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- <assertion id="e" implied="true">
- <text>When bean discovery occurs, the container considers any |beans.xml| file in any metadata directory of the application classpath (ejb-jar)</text>
+ <assertion id="e">
+ <text>Next, the container must fire an event of type |AfterBeanDiscovery|, as defined in Section 11.5.2, "AfterBeanDiscovery event", and abort initialization of the application if any observer registers a definition error.</text>
</assertion>
-
- <assertion id="f" implied="true">
- <text>When bean discovery occurs, the container considers any |beans.xml| file in any metadata directory of the application classpath (jar in EAR lib directory)</text>
+
+ <assertion id="f">
+ <text>Next, the container must detect deployment problems by validating bean dependencies and specialization and abort initialization of the application if any deployment problems exist, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
<assertion id="g">
- <text>When bean discovery occurs, the container considers any |ejb-jar.xml| file in any metadata directory of the application classpath that also contains a |beans.xml| file</text>
- <note>What does this mean?</note>
+ <text>Next, the container must fire an event of type |AfterDeploymentValidation|, as defined in Section 11.5.3, "AfterDeploymentValidation event", and abort initialization of the application if any observer registers a deployment problem.</text>
</assertion>
- <assertion id="h" implied="true">
- <text>When bean discovery occurs, the container considers any Java class in any archive or directory in the classpath that has a |beans.xml| file in the metadata directory (standalone WAR)</text>
+ <assertion id="h">
+ <text>Finally, the container begins directing requests to the application.</text>
+ </assertion>
+ </section>
+
+ <section id="12.3" title="Bean discovery">
+ <assertion id="a">
+ <text>The container automatically discovers managed beans (according to the rules of Section 3.2.1, "Which Java classes are managed beans?") and session beans in bean deployment archives and searches the bean classes for producer methods, producer fields, disposal methods and observer methods.</text>
</assertion>
- <assertion id="i" implied="true">
- <text>When bean discovery occurs, the container considers any Java class in any archive or directory in the classpath that has a |beans.xml| file in the metadata directory (jar in |WEB-INF/lib| of standalone WAR)</text>
+ <assertion id="b">
+ <text>For each Java class in any bean deployment archive, the container must create an |AnnotatedType| representing the class and fire an event of type |ProcessAnnotatedType|, as defined in Section
+11.5.5, "ProcessAnnotatedType event".</text>
</assertion>
- <assertion id="j" implied="true">
- <text>When bean discovery occurs, the container considers any Java class in any archive or directory in the classpath that has a |beans.xml| file in the metadata directory (WAR in EAR)</text>
+ <assertion id="c">
+ <text>For each Java class in any bean deployment archive, the container must inspect the class metadata to determine if it is a bean or other Java EE component class supporting injection.</text>
</assertion>
- <assertion id="k" implied="true">
- <text>When bean discovery occurs, the container considers any Java class in any archive or directory in the classpath that has a |beans.xml| file in the metadata directory (jar in |WEB-INF/lib| of WAR in EAR)</text>
+ <assertion id="d">
+ <text>For each Java class in any bean deployment archive, the container must detect definition errors by validating the class and its metadata.</text>
</assertion>
- <assertion id="l" implied="true">
- <text>When bean discovery occurs, the container considers any Java class in any archive or directory in the classpath that has a |beans.xml| file in the metadata directory (ejb-jar)</text>
+ <assertion id="e">
+ <text>For each Java class in any bean deployment archive, the container must, if the class is a managed bean, session bean, producer method or field, or other Java EE component class supporting injection, create an |InjectionTarget| for the class, as defined in Section 11.4.1, "The InjectionTarget interface", and fire an event of type |ProcessInjectionTarget|, as defined in Section 11.5.6, "ProcessInjectionTarget event"</text>
</assertion>
-
- <assertion id="m" implied="true">
- <text>When bean discovery occurs, the container considers any Java class in any archive or directory in the classpath that has a |beans.xml| file in the metadata directory (jar in EAR lib dir)</text>
- </assertion>
-
- <assertion id="n">
- <text>First, the container discovers all binding types~, stereotypes and interceptor binding types~ declared in XML, according to the rules of Section 9.4, "Stereotype, binding type and interceptor binding type declarations".</text>
- </assertion>
- <assertion id="o">
- <text>First, the container discovers all ~binding types~, stereotypes ~and interceptor binding types~ declared in XML, according to the rules of Section 9.4, "Stereotype, binding type and interceptor binding type declarations".</text>
+ <assertion id="f">
+ <text>For each Java class in any bean deployment archive, the container must, if the class is a bean, create a |Bean| object that implements the rules defined in Chapter 7, "Bean lifecycle", and fire an event of type |ProcessBean|, as defined in Section 11.5.7, "ProcessBean event".</text>
</assertion>
-
- <assertion id="p">
- <text>First, the container discovers all ~binding types, stereotypes and~ interceptor binding types declared in XML, according to the rules of Section 9.4, "Stereotype, binding type and interceptor binding type declarations".</text>
- </assertion>
-
- <assertion id="q">
- <text>The container automatically discovers simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") ~and session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?") deployed and/or declared in these locations and searches the bean classes for producer methods, producer fields, disposal methods and observer methods declared using annotations.~</text>
- <note>Check all archive types enumerated above</note>
- </assertion>
-
- <assertion id="r">
- <text>The container automatically discovers ~simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") and~ session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?")~ deployed and/or declared in these locations and searches the bean classes for producer methods, producer fields, disposal methods and observer methods declared using annotations.~</text>
- <note>Check all archive types enumerated above</note>
- </assertion>
-
- <assertion id="s">
- <text>The container automatically discovers ~simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") and session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?") deployed and/or declared in these locations and searches the bean classes for~ producer methods, ~producer fields, disposal methods and observer methods~ declared using annotations.</text>
- <note>Check all archive types enumerated above, and session beans and simple beans</note>
- </assertion>
-
- <assertion id="t">
- <text>The container automatically discovers ~simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") and session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?") deployed and/or declared in these locations and searches the bean classes for producer methods~, producer fields~, disposal methods and observer methods~ declared using annotations.</text>
- <note>Check all archive types enumerated above, and session beans and simple beans</note>
- </assertion>
-
- <assertion id="u">
- <text>The container automatically discovers ~simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") and session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?") deployed and/or declared in these locations and searches the bean classes for producer methods, producer fields,~ disposal methods~ and observer methods~ declared using annotations.</text>
- <note>Check all archive types enumerated above, and session beans and simple beans</note>
- </assertion>
-
- <assertion id="v">
- <text>The container automatically discovers~ simple beans (according to the rules of Section 3.2.1, "Which Java classes are beans?") and session beans (according to the rules of Section 3.3.2, "Which EJBs are beans?") deployed and/or declared in these locations and searches the bean classes for producer methods, producer fields, disposal methods and~ observer methods declared using annotations.</text>
- <note>Check all archive types enumerated above, and session beans and simple beans</note>
- </assertion>
- <assertion id="z">
- <text>Next, the container determines which beans~, interceptors and decorators are enabled,~ according to the rules defined in Section 2.5.6, "Enabled deployment types", Section A.3.7, "Interceptor enablement and ordering" and Section A.5.5, "Decorator enablement and ordering", taking into account any |<Deploy>|, ~|<Interceptors>| and |<Decorators>|~ declarations in the |beans.xml| files.</text>
+ <assertion id="g">
+ <text>If the class is a bean, the container must search the class for producer methods and fields, and for each producer method or field create an InjectionTarget, as defined in Section 11.4.1, "The InjectionTarget interface", for the producer method or field and fire an event of type |ProcessInjectionTarget|, as defined in Section 11.5.6, "ProcessInjectionTarget event".</text>
</assertion>
- <assertion id="ac">
- <text>For each enabled bean that is not an interceptor or decorator, the container creates an instance of |Bean|, and registers it by calling |Manager.addBean()|</text>
- <note>Check that interceptors aren't registered as beans, decorators aren't registered as beans, that disabled beans aren't registered and that simple beans, session beans, producer methods and producer fields are registered</note>
+ <assertion id="h">
+ <text>If the class is a bean, the container must search the class for producer methods and fields, and for each producer method or field create a Bean object that implements the rules defined in Chapter 7, Bean lifecycle and fire an event of type |ProcessBean|, as defined in Section 11.5.7, "ProcessBean event".</text>
</assertion>
- <assertion id="af">
- <text>For each observer method of an enabled bean, the container creates an instance of |Observer| that implements the rules of Section 7.5.8, "Observer object for an observer method" and registers it by calling |Manager.addObserver()|</text>
+ <assertion id="i">
+ <text>If the class is a bean, the container must search the class for observer methods, and for each observer method create an Observer, as defined in Section 10.6.1, �Observer method notification�, for the observer method and fire an event of type ProcessObserver, as defined in Section 11.5.8, �ProcessObserver event�.</text>
</assertion>
- </section>
- <section id="11.5" title="Initialization and Deployment Events">
- <assertion id="a">
- <text>Container fires event of type Manager with binding type @Initialized after bean discovery but before deployment problems are detected.</text>
- </assertion>
-
- <assertion id="b">
- <text>The container must fire a second event of type Manager with binding type @Deployed after it has validated that there are no deployment problems and before the deployment begins processing requests.</text>
- </assertion>
-
- <assertion id="c">
- <text>The container must not allow any request to be processed by the deployment until all observers of this event return.</text>
- </assertion>
-
- <assertion id="d">
- <text>The request and application contexts are active when these events are fired.</text>
- </assertion>
-
- <assertion id="aa">
- <text>If any observer method of the @Initialized event throws an exception, the exception is treated as a definition error by the container.</text>
- </assertion>
-
- <assertion id="ba">
- <text> f any observer method of the @Deployed event throws an exception, the exception is treated as a deployment problem by the container.</text>
- </assertion>
- </section>
-
- <section id="11.6" title="Activities">
-
- <assertion id="a" testable="false">
- <text>The method |createActivity()| creates a new child activity of an activity:</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="b">
- <text>Every bean belonging to a parent activity also belongs to the child activity~, is eligible for injection into other beans belonging to the child activity and may be obtained by dynamic lookup via the child activity~</text>
- </assertion>
-
- <assertion id="c">
- <text>Every bean belonging to a parent activity ~also belongs to the child activity,~ is eligible for injection into other beans belonging to the child activity~ and may be obtained by dynamic lookup via the child activity~</text>
- </assertion>
-
- <assertion id="d">
- <text>Every bean belonging to a parent activity ~also belongs to the child activity, is eligible for injection into other beans belonging to the child activity and~ may be obtained by dynamic lookup via the child activity</text>
- </assertion>
-
<assertion id="j">
- <text>Every observer belonging to a parent activity also belongs to the child activity ~and receives events fired via the child activity~</text>
+ <text>For each session bean declared in |ejb-jar.xml| in any bean deployment archive the container must create a |Bean| object that implements the rules defined in Chapter 7, "Bean lifecycle" and fire an event of type ProcessBean.</text>
</assertion>
<assertion id="k">
- <text>Every observer belonging to a parent activity ~also belongs to the child activity and~ receives events fired via the child activity</text>
+ <text>The container determines which beans, interceptors and decorators are enabled, according to the rules defined in Section 2.5.5, "Enabled deployment types", Section 9.4, "Interceptor enablement and ordering" and Section 8.2, "Decorator enablement and ordering", taking into account any <Deploy>, <Interceptors> and <Decorators> declarations in the |beans.xml| files, and registers the |Bean| and |Observer| objects.</text>
</assertion>
-
+
<assertion id="l">
- <text>Every context object belonging to the parent activity also belongs to the child activity</text>
+ <text>For each enabled bean that is not an interceptor or decorator, the container creates and registers an instance of |Bean| that implements the rules of Chapter 7, "Bean lifecycle".</text>
</assertion>
<assertion id="m">
- <text>|Beans| ~and observers~ may be registered with an activity by calling |addBean()| ~or |addObserver()|~ on the |Manager| object that represents the activity.</text>
+ <text>For each enabled interceptor, the container creates and registers an instance of |Interceptor|, as defined in Section 11.1.2, "The Interceptor interface".</text>
</assertion>
<assertion id="n">
- <text>~|Beans| and~ observers may be registered with an activity by calling ~|addBean()| or~ |addObserver()| on the |Manager| object that represents the activity.</text>
- </assertion>
-
- <assertion id="o">
- <text>A bean registered with the child activity is not available for injection into any bean registered with a parent activity</text>
+ <text>For each enabled decorator, the container creates and registers an instance of |Decorator|, as defined in Section 11.1.1, "The Decorator interface".</text>
</assertion>
- <assertion id="p">
- <text>A bean registered with a child activity is not available for injection into a ~servlet or~ EJB</text>
+ <assertion id="o">
+ <text>For each observer method of an enabled bean, the container creates and registers an instance of |Observer| that implements the rules of Section 10.6.1, "Observer method notification".</text>
</assertion>
-
- <assertion id="q">
- <text>A bean registered with a child activity is not available for injection into a servlet ~or EJB~</text>
- </assertion>
-
- <assertion id="r">
- <text>A bean registered with a child activity may not be obtained by dynamic lookup via the parent activity</text>
- </assertion>
-
- <assertion id="s">
- <text>An observer registered with the child activity does not receive events fired via a parent activity</text>
- </assertion>
-
- <assertion id="t">
- <text>If a bean registered with a child activity has the bean type and all bindings of some injection point of some bean registered with a direct ~or indirect~ parent activity, a |DeploymentException| is throw by the container at deployment time.</text>
- </assertion>
-
- <assertion id="u">
- <text>If a bean registered with a child activity has the bean type and all bindings of some injection point of some bean registered with a~ direct or~ indirect parent activity, a |DeploymentException| is throw by the container at deployment time.</text>
- </assertion>
-
</section>
- <section id="11.6.1" title="Current Activity">
- <assertion id="a" testable="false">
- <text>An activity may be associated with the current context for a normal scope by calling |setCurrent()|, passing the normal scope type</text>
- <note>A statement of intent</note>
+ <section id="12.4" title="Problems detected automatically by the container">
+ <assertion id="a">
+ <text>Definition errors may be detected by tooling at development time, and are also detected by the container at initialization time. If a definition error exists in a deployment, initialization will be aborted by the container.</text>
</assertion>
<assertion id="b">
- <text>If the given scope is inactive when |setCurrent()| is called, a |ContextNotActiveException| is thrown.</text>
+ <text>Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will be aborted by the container.</text>
</assertion>
<assertion id="c">
- <text>If the given scope type is not a normal scope, an |IllegalArgumentException| is thrown.</text>
+ <text>Execution errors are represented by instances of |javax.enterprise.inject.InjectionException| and its subclasses.</text>
</assertion>
-
- <assertion id="d">
- <text>All EL evaluations (as defined Section 5.10, "EL name resolution")~, all calls to any injected |Manager| object or |Manager| object obtained via JNDI lookup (as defined by Section 5.7, "The Manager object"), all calls to any injected |Event| object (as defined in Section 7.6, "The Event interface") and all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic lookup")~ are processed by the current activity</text>
- </assertion>
-
- <assertion id="e">
- <text>~All EL evaluations (as defined Section 5.10, "EL name resolution"),~ all calls to any injected |Manager| object ~or |Manager| object obtained via JNDI lookup (as defined by Section 5.7, "The Manager object"), all calls to any injected |Event| object (as defined in Section 7.6, "The Event interface") and all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic lookup")~ are processed by the current activity</text>
- </assertion>
-
- <assertion id="f">
- <text>~All EL evaluations (as defined Section 5.10, "EL name resolution"),~ all calls to any ~injected |Manager| object or~ |Manager| object obtained via JNDI lookup~ (as defined by Section 5.7, "The Manager object"), all calls to any injected |Event| object (as defined in Section 7.6, "The Event interface") and all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic lookup")~ are processed by the current activity</text>
- </assertion>
-
- <assertion id="g">
- <text>~All EL evaluations (as defined Section 5.10, "EL name resolution"), all calls to any injected |Manager| object or |Manager| object obtained via JNDI lookup (as defined by Section 5.7, "The Manager object"),~ all calls to any injected |Event| object (as defined in Section 7.6, "The Event interface") ~and all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic lookup")~ are processed by the current activity</text>
- </assertion>
-
- <assertion id="h">
- <text>~All EL evaluations (as defined Section 5.10, "EL name resolution"), all calls to any injected |Manager| object or |Manager| object obtained via JNDI lookup (as defined by Section 5.7, "The Manager object"), all calls to any injected |Event| object (as defined in Section 7.6, "The Event interface") and ~all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic lookup") are processed by the current activity</text>
- </assertion>
-
- <assertion id="m">
- <text>A bean registered with an activity is only available to Unified EL expressions that are evaluated when that activity or one of its children is the current activity.</text>
- <note>This is a statement of intent</note>
- </assertion>
</section>
</specification>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2801 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-09 19:47:01 -0400 (Tue, 09 Jun 2009)
New Revision: 2801
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
added section 11 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-09 17:55:58 UTC (rev 2800)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-09 23:47:01 UTC (rev 2801)
@@ -4044,6 +4044,744 @@
<text>For every event mapping, the container must send a message containing the serialized event and its event bindings to every mapped topic whenever an event with the mapped event type and bindings is fired, and monitor every mapped topic for messages containing events of that mapped event type and bindings and notify all local observers whenever a message containing an event is received. Thus, events with the mapped event type and bindings are distributed to other processes which have the same event mapping.</text>
</assertion>
</section>
+
+ <section id="11" title="Portable extensions and the bean manager">
+ <assertion id="a">
+ <text>A portable extension way integrate with the container by providing its own beans, interceptors and decorators to the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A portable extension way integrate with the container by injecting dependencies into its own objects using the dependency injection service.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A portable extension way integrate with the container by providing a context implementation for a custom scope.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Bean definitions provided by a portable extension may be associated with a certain activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Integration with portable extensions is enabled via the important SPI interfaces Bean and BeanManager.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1" title="The Bean interface">
+ <assertion id="a">
+ <text>Implementations of |Bean| must also implement the inherited operations defined by the |Contextual| interface defined in Section 6.1, "The Contextual interface".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The methods |getTypes()|, |getBindings()|, |getScopeType()|, |getDeploymentType()|, |getName()|, |getStereotypes()| and |getInterceptorBindings()| must return the bean types, bindings, scope type, deployment type, EL name, stereotypes and interceptor bindings of the bean, as defined in Chapter 2, Bean definition.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getInjectionPoints()| returns a set of |InjectionPoint| objects, defined in Section 5.4.9, "Injection point
+metadata", representing injection points of the bean, that will be validated by the container at initialization time.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |isPassivationCapable()| must return |true| if the bean is passivation capable, as defined in Section 6.6.1, "Passivation capable beans", and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The method |isNullable()| must return |true| if the method |create()| sometimes returns a |null| value, and |false| otherwise, as defined in Section 5.1.3, "Primitive types and null values".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>An instance of |Bean| exists for every enabled bean in a deployment.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>An application or portable extension may add support for new kinds of beans beyond those defined by the this specification (managed beans, session beans, producer methods and fields, resources and message destinations) by implementing |Bean| and registering beans with the container, using the mechanism defined in Section 11.2.6, "Bean registration".</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.1" title="The Decorator interface">
+ <assertion id="a">
+ <text>The |Bean| object for a decorator must implement the interface |javax.enterprise.inject.spi.Decorator|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getDecoratedTypes()| returns the decorated types of the decorator.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The methods |getDelegateType()| and |getDelegateBindings()| return the delegate type and bindings of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.1.2" title="The Interceptor interface">
+ <assertion id="a">
+ <text>The |Bean| object for an interceptor must implement |javax.enterprise.inject.spi.Interceptor|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getInterceptorBindingTypes()| returns the interceptor bindings of the interceptor.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |intercepts()| returns |true| if the interceptor intercepts callbacks or business methods of the given type, and |false| otherwise.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |intercept()| invokes the specified kind of lifecycle callback or business method upon the given instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An |InterceptionType| identifies the kind of lifecycle callback or business method.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2" title="The BeanManager object">
+ <assertion id="a">
+ <text>The container provides a built-in bean with bean type |BeanManager|, scope |@Dependent|, deployment type |@Standard| and binding |@Current|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any bean may obtain an instance of |BeanManager| by injecting it.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A framework may obtain the |BeanManager| object from JNDI. The container must register an instance of |BeanManager| with name |java:app/BeanManager| in JNDI at initialization time.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any operation of |BeanManager| may be called at any time during the execution of the application.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.1" title="Obtaining a contextual reference for a bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getReference()| returns a contextual reference for a given bean and bean type, as defined in Section 6.5.3, "Contextual reference for a bean".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the |Bean| object representing the bean. The second parameter represents the bean type that must be implemented by any client proxy that is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.2" title="Obtaining an injectable reference">
+ <assertion id="a">
+ <text>The method |BeanManager.getInjectableReference()| returns an injectable reference for a given injection point, as defined in Section 5.4.1, "Injectable references".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the |InjectionPoint| represents a decorator delegate injection point, |getInjectableReference()| returns a delegate, as
+defined in Section 8.1.2, "Decorator delegate injection points".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Implementations of |Bean| usually maintain a reference to an instance of |BeanManager|. When the |Bean| implementation performs dependency injection, it must obtain the contextual instances to inject by calling |BeanManager.getInjectableReference()|, passing an instance of |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.3" title="Obtaining a Bean by type">
+ <assertion id="a">
+ <text>The |getBeans()| method of the |BeanManager| interface returns the result of the typesafe resolution algorithm defined in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is a required bean type. The remaining parameters are required bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no bindings are passed to |getBeans()|, the default binding |@Current| is assumed.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a parameterized type with a type parameter or wildcard is passed to |getBeans()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If two instances of the same binding type are passed to |getBeans()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If an instance of an annotation that is not a binding type is passed to |getBeans()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.4" title="Obtaining a Bean by name">
+ <assertion id="a">
+ <text>The |getBeans()| method of the |BeanManager| interface returns the result of the name resolution algorithm defined in Section 5.2, "EL name resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The parameter is a bean EL name.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.5" title="Obtaining the most specialized bean">
+ <assertion id="a">
+ <text>The method |BeanManager.getMostSpecializedBean()| returns the |Bean| object representing the most specialized enabled bean registered with the container that specializes the given bean, as defined in Section 4.3.2, "Most specialized enabled bean for a bean".</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.6" title="Bean registration">
+ <assertion id="a">
+ <text>The |BeanManager.addBean()| method registers a new bean with the container, thereby making it available for injection into other beans.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |Bean| parameter may represent an interceptor or decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.7" title="Observer registration">
+ <assertion id="a">
+ <text>An observer instance may be registered with the container by calling |BeanManager.addObserver()|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter is the observer object. The second parameter is the observed event type. The remaining parameters are optional observed event bindings. The observer is notified when an event object that is assignable to the observed event type is raised with the observed event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An observer instance may be deregistered by calling |BeanManager.removeObserver()|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |addObserver()| or |removeObserver()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |addObserver()| or |removeObserver()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.8" title="Firing an event">
+ <assertion id="a">
+ <text>The method |BeanManager.fireEvent()| fires an event and notifies observers, according to Section 10.6, "Observer notification".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the event object. The remaining parameters are event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object passed to |fireEvent()| contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |fireEvent()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |fireEvent()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.9" title="Observer resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveObservers()| resolves observers for an event according to the observer resolution algorithm defined in Section 10.2, "Observer resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first parameter of |resolveObservers()| is the event object. The remaining parameters are event bindings.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the runtime type of the event object passed to |resolveObservers()| contains a type variable, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If two instances of the same binding type are passed to |resolveObservers()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If an instance of an annotation that is not a binding type is passed to |resolveObservers()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.10" title="Decorator resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveDecorators()| returns the ordered list of enabled decorators for a set of bean types and a set of bindings, as defined in Section 8.3, "Decorator resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The first argument is the set of bean types of the decorated bean. The annotations are bindings declared by the decorated bean.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If two instances of the same binding type are passed to |resolveDecorators()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not a binding type is passed to |resolveDecorators()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the set of bean types is empty, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.11" title="Interceptor resolution">
+ <assertion id="a">
+ <text>The method |BeanManager.resolveInterceptors()| returns the ordered list of enabled interceptors for a set of interceptor bindings, as defined in Section 9.5, "Interceptor resolution".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If two instances of the same interceptor binding type are passed to |resolveInterceptors()|, a |DuplicateBindingTypeException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If no interceptor binding type instance is passed to |resolveInterceptors()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If an instance of an annotation that is not an interceptor binding type is passed to |resolveInterceptors()|, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.12" title="Dependency validation">
+ <assertion id="a">
+ <text>The |BeanManager.validate()| operation validates a dependency.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |validate()| validates the dependency and throws an |InjectionException| if there is a deployment problem (for example, an unsatisfied or ambiguous dependency) associated with the injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.13" title="Enabled deployment types">
+ <assertion id="a">
+ <text>The method |BeanManager.getEnabledDeploymentTypes()| exposes the list of enabled deployment types, in order of lower to higher precedence, as defined by Section 2.5.5, "Enabled deployment types".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Portable extensions may use this method to inspect meta-annotations that appear on the deployment types and thereby discover information about the deployment.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.14" title="Registering a Context">
+ <assertion id="a">
+ <text>A custom implementation of |Context| may be associated with a scope type by calling |BeanManager.addContext()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.2.15" title="Obtaining the active Context for a scope">
+ <assertion id="a">
+ <text>The method |BeanManager.getContext()| retrieves an active context object associated with the a given scope, as defined in Section 6.5.1, "The active context object for a scope".</text>
+ </assertion>
+ </section>
+
+ <section id="11.3" title="Alternative metadata sources">
+ <assertion id="a">
+ <text>The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|, |AnnotatedConstructor| and |AnnotatedParameter| in the package |javax.enterprise.inject.spi| allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The interface |Annotated| exposes the overriding annotations and type declarations.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4" title="Helper objects for Bean implementations">
+ <assertion id="a">
+ <text>The BeanManager provides access to helper objects which parse and validate the standard metadata defined by this specification and perform injection upon an object according to the standard injection lifecycle defined in Section 5.4.3, "Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |createInjectionTarget()| returns a container provided instance of |InjectionTarget| for the given type or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |createManagedBean()| returns an instance of |ManagedBean| representing the given managed bean type, or throws an |IllegalArgumentException| if there is any kind of definition error associated with the type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When an |AnnotatedType| is passed to |createInjectionTarget()| or |createManagedBean()| the container ignores the annotations and types declared by the elements of the actual Java class and uses the metadata provided via the |Annotated| interface instead.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.1" title="The InjectionTarget interface">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.InjectionTarget| provides operations for instantiating and performing dependency injection on instances of a type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |produce()| calls the constructor annotated |@Initializer| if it exists, or the constructor with no parameters otherwise, as defined in Section 5.4.3, "Injection using the bean constructor".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |inject()| performs dependency injection upon the given object. First, the container performs Java EE component environment
+injection according to the semantics required by the Java EE platform specification. Next, it sets the value all injected fields, and then calls all the initializer methods, as defined in Section 5.4.4, "Injection of fields and initializer methods". Finally, it calls the |@PostConstruct| callback, if it exists, according to the semantics required by the Java EE platform specification.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |dispose()| calls the |@PreDestroy| callback, if it exists, according to the semantics required by the Java EE platform
+specification.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |destroy()| destroys dependent objects of the given instance, as defined in Section 5.4.5, "Destruction of dependent objects".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>For any container provided implementation of |InjectionTarget| that represents a class, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all injected fields, bean constructor parameters and initializer method parameters.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, produce() calls the producer method on, or accesses the producer field of, either the given instance or a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.4.6, "Invocation of producer or disposal methods".</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |inject()| does nothing.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |dispose()| calls the disposal method, if it exists, on either the given instance or a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.4.6, "Invocation of
+producer or disposal methods".</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |destroy()| destroys dependent objects of the given object, as defined in Section 5.4.5, "Destruction of dependent objects".</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>For any container provided implementation of |InjectionTarget| that represents a producer method or field, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all producer and disposal method parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.2" title="ManagedBean and ProducerBean">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.ManagedBean| exposes container provided implementations of |Bean| and |InjectionTarget| for a managed bean class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |getAnnotatedType()| returns the |AnnotatedType| representing the managed bean class.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getInjectionTarget()| returns a container provided implementation of |InjectionTarget| for the managed bean class.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |getProducerBeans()| returns a set of |ProducerBean| objects representing the producer methods and fields of the managed bean.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The method |getObserverMethods()| returns a set of |ObserverMethod| objects representing the observer methods of the bean.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |ProducerBean| interface exposes container provided implementations of |Bean| and |InjectionTarget| for a producer method or field.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The methods |getAnnotatedProducer()| and |getAnnotatedDisposer()| return the |AnnotatedMembers| representing the producer method or field and disposal method respectively.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The method |getDeclaringBean()| returns a container provided implementation of |Bean| for the bean class that declares the producer method or field.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The method |getInjectionTarget()| returns a container provided implementation of |InjectionTarget| for the producer method or field.</text>
+ </assertion>
+ </section>
+
+ <section id="11.4.3" title="The ObserverMethod interface">
+ <assertion id="a">
+ <text>The interface |javax.enterprise.inject.spi.ObserverMethod| exposes a container provided implementation of |Observer| for an observer method, as defined in Section 10.6.1, "Observer method notification" along with the observed event type and bindings and an operation for calling the method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The methods |getAnnotatedMethod()| returns the |AnnotatedMethod| representing the observer method.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getDeclaringBean()| returns a container provided implementation of |Bean| for the bean class that declares the observer method.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |notify()| calls the observer method, upon the given bean instance as defined in Section 5.4.8, "Invocation of observer methods".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The methods |getObservedEventType()| and |getObservedEventBindings()| return the observed event type and bindings of the observer method.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The method |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all injected method parameters.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5" title="Container lifecycle events">
+ <assertion id="a">
+ <text>During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process defined in Section 12.2, "Application initialization lifecycle".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Observers of these events must be service providers of the service |javax.enterprise.inject.spi.Extension| declared in |META-INF/services|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container instantiates a single instance of each service provider at the beginning of the application initialization process and maintains a reference to it until the application shuts down.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.1" title="BeforeBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire an event before it begins the bean discovery process. The event object must be of type |javax.enterprise.inject.spi.BeforeBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The operations of the |BeforeBeanDiscovery| instance allow a portable extension to declare that any annotation as a binding type, scope type, stereotype or interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |BeforeBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.2" title="AfterBeanDiscovery event">
+ <assertion id="a">
+ <text>The container must fire a second event when it has fully completed the bean discovery process, validated that there are no definition errors relating to the discovered beans, and registered |Bean| and |Observer| objects for the discovered beans, but before detecting deployment problems. The event object must be of type |javax.enterprise.inject.spi.AfterBeanDiscovery|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after all observers have been notified.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If any observer method of the |AfterBeanDiscovery| event throws an exception, the exception is treated as a definition error by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.3" title="AfterDeploymentValidation event">
+ <assertion id="a">
+ <text>The container must fire a third event after it has validated that there are no deployment problems and before creating contexts or processing requests. The event object must be of type |javax.enterprise.inject.spi.AfterDeploymentValidation|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The method |addDeploymentProblem()| registers a deployment problem with the container, causing the container to abort deployment after all observers have been notified.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If any observer method of the |AfterDeploymentValidation| event throws an exception, the exception is treated as a deployment problem by the container.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must not allow any request to be processed by the deployment until all observers of this event return.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.4" title="BeforeShutdown event">
+ <assertion id="a">
+ <text>The container must fire a final event after it has finished processing requests and destroyed all contexts. The event object must be of type |javax.enterprise.inject.spi.BeforeShutdown|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If any observer method of the |BeforeShutdown| event throws an exception, the exception is treated as a deployment problem by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.5" title="ProcessAnnotatedType event">
+ <assertion id="a">
+ <text>The container must fire an event for each Java class it discovers, before it reads the declared annotations. The event object must be of type |javax.enterprise.inject.spi.ProcessAnnotatedType<X>|, where |X| is the class.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getAnnotatedType()|/|setAnnotatedType()| property accessor pair provides access to the |AnnotatedType| object that will be used by the container to read the declared annotations.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any observer of this event is permitted to wrap and/or replace the |annotatedType| property of |ProcessAnnotatedType|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must use the final value of this property, after all observers have been called, to read the annotations of this class.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.6" title="ProcessInjectionTarget event">
+ <assertion id="a">
+ <text>The container must fire an event for each managed bean, session bean, Java EE component class supporting injection, producer method or producer field it discovers. The event object must be of type |javax.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |X| is the managed bean class, session bean class or Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getInjectionTarget()|/|setInjectionTarget()| property accessor pair provides access to the |InjectionTarget| object that will be used by the container to perform injection.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getAnnotatedType()| returns the |AnnotatedType| representing the managed bean, session bean or other Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any observer of this event is permitted to wrap and/or replace the |injectionTarget| property of |ProcessInjectionTarget|. The container must use the final value of this property, after all observers have been called, whenever it performs injection upon the managed bean, session bean or other Java EE component class supporting injection.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.7" title="ProcessBean event">
+ <assertion id="a">
+ <text>The container must fire an event for each bean it discovers, before registering the |Bean| object. The event object must be of type |javax.enterprise.inject.spi.ProcessBean|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a managed bean with bean class |X|, the container must raise an event of type |ProcessBean<X>|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>For a session bean with bean class local view |X|, the container must raise an event of type |ProcessBean<X>|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>For a session bean with no bean class local view |X|, the container must raise an event of type |ProcessBean<Object>|.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>For a producer method or field with method return type or field type |X|, the container must raise an event of type |ProcessBean<
+X>|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The |getBean()|/|setBean()| property accessor pair provides access to the |Bean| object that is about to be registered.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The method |getAnnotated()| returns the |AnnotatedType|, |AnnotatedField| or |AnnotatedMethod|.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Any observer of this event is permitted to wrap and/or replace the bean property of |ProcessBean|. When all observers have been called, the container registers the final value of this property. The container must not register any |Bean| object if any observer called |addDefinitionError()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.5.8" title="ProcessObserver event">
+ <assertion id="a">
+ <text>The container must fire an event for each observer method it discovers, before registering the |Observer| object. The event object must be of type |javax.enterprise.inject.spi.ProcessObserver<T>| where |T| is the observed event type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The |getObserver()|/|setObserver()| property accessor pair provides access to the |Observer| object that is about to be registered.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The method |getAnnotatedMethod()| returns the |AnnotatedMethod|.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is complete.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Any observer of this event is permitted to wrap and/or replace the observer property of |ProcessObserver|. When all observers have been called, the container registers the final value of this property. The container must not register any |ObserverMethod| object if any observer called |addDefinitionError()|.</text>
+ </assertion>
+ </section>
+
+ <section id="11.6" title="Activities">
+ <assertion id="a">
+ <text>Activities are represented by instances of |BeanManager|. The method |createActivity()| creates a new child activity of an activity.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A child activity inherits all beans, interceptors, decorators, observers, and contexts defined by its direct and indirect parent activities.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every bean belonging to a parent activity also belongs to the child activity, is eligible for injection into other beans belonging to the child activity and may be obtained by dynamic lookup via the child activity.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every interceptor and decorator belonging to a parent activity also belongs to the child activity and may be applied to any bean belonging to the child activity.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Every observer belonging to a parent activity also belongs to the child activity and receives events fired via the child activity.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Every context object belonging to the parent activity also belongs to the child activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Beans and observers may be registered with an activity by calling |addBean()| or |addObserver()| on the |BeanManager| object that represents the activity.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Beans and observers registered with an activity are visible only to that activity and its children�they are never visible to direct or indirect parent activities, or to other children of the parent activity.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A bean registered with the child activity is not available for injection into any bean registered with a parent activity.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean registered with a child activity is not available for injection into a non-contextual instance.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>A bean registered with a child activity may not be obtained by dynamic lookup via the parent activity.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>An observer registered with the child activity does not receive events fired via a parent activity.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If a bean registered with a child activity has the bean type and all bindings of some injection point of some bean registered with a direct or indirect parent activity, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>Interceptors and decorators may not be registered with a child activity. The |addInterceptor()| and |addDecorator()| methods throw |UnsupportedOperationException| when called on a |BeanManager| object that represents a child activity.</text>
+ </assertion>
+ </section>
+
+ <section id="11.6.1" title="Current activity">
+ <assertion id="a">
+ <text>An activity may be associated with the current context for a normal scope by calling |setCurrent()|, passing the normal scope type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the given scope is inactive when |setCurrent()| is called, a |ContextNotActiveException| is thrown.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the given scope type is not a normal scope, an |IllegalArgumentException| is thrown.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>All EL evaluations (as defined Section 5.6, "Integration with Unified EL"), all calls to any injected |BeanManager| object or |BeanManager| object obtained via JNDI lookup (as defined by Section 11.2, "The BeanManager object"), all calls to any injected |Event| object (as defined in Section 10.4.1, "The Event interface") and all calls to any injected Instance object (as defined by Section 5.5.1, "The Instance interface") are processed by the current activity.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the root activity has no active normal scope such that the current context for that scope has an associated activity, the root activity is the current activity.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If the root activity has exactly one active normal scope such that the current context for that scope has an associated activity, that activity is the current activity.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Otherwise, there is no well-defined current activity, and the behavior is undefined. Portable frameworks and applications should not depend upon the behavior of the container when two different current contexts have an associated activity.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>A bean registered with an activity is only available to Unified EL expressions that are evaluated when that activity or one of its children is the current activity.</text>
+ </assertion>
+ </section>
+
+
+
+
+
+
+
+
<section id="11" title="Packaging and Deployment">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2800 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-09 13:55:58 -0400 (Tue, 09 Jun 2009)
New Revision: 2800
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java
Log:
Fix various tests
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-09 17:19:44 UTC (rev 2799)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-09 17:55:58 UTC (rev 2800)
@@ -16,6 +16,7 @@
*/
package org.jboss.webbeans.bean;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Arrays;
@@ -145,6 +146,7 @@
{
Set<Type> types = new LinkedHashSet<Type>(getTypes());
types.add(EnterpriseBeanInstance.class);
+ types.add(Serializable.class);
ProxyFactory proxyFactory = Proxies.getProxyFactory(types);
@SuppressWarnings("unchecked")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-09 17:19:44 UTC (rev 2799)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-09 17:55:58 UTC (rev 2800)
@@ -39,19 +39,10 @@
public class EnterpriseBeanLifecycleTest extends AbstractJSR299Test
{
- /**
- * When the create() method of a Bean object that represents a stateful
- * session bean that is called, the container creates and returns a session
- * bean proxy, as defined in Section 3.3.9, "Session bean proxies".
- * @throws Exception
- *
- * TODO Check this test once WBRI-269 is fixed
- */
- @Test(groups = { "ri-broken", "enterpriseBeans", "clientProxy", "lifecycle", "integration" })
+ @Test(groups = {"enterpriseBeans", "clientProxy", "lifecycle", "integration" })
@SpecAssertions( {
@SpecAssertion(section = "3.3.8", id = "a"),
@SpecAssertion(section = "3.3.9", id = "a"),
- @SpecAssertion(section = "3.3.9", id = "b"),
@SpecAssertion(section = "6", id = "a"),
@SpecAssertion(section = "6.5", id = "a") })
public void testCreateSFSB() throws Exception
@@ -59,30 +50,40 @@
GrossStadt frankfurt = getInstanceByType(GrossStadt.class);
Bean<KleinStadt> stadtBean = getBeans(KleinStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
- KleinStadt stadtInstance = createBeanInstance(stadtBean);
+ KleinStadt stadtInstance = getInstanceByType(KleinStadt.class, new AnnotationLiteral<Important>() {});
assert stadtInstance != null : "Expected instance to be created by container";
- //assert frankfurt.isKleinStadtCreated() : "PostConstruct should be invoked when bean instance is created";
+ assert frankfurt.isKleinStadtCreated() : "PostConstruct should be invoked when bean instance is created";
frankfurt.resetCreatedFlags();
// Create a second one to make sure create always does create a new session bean
- KleinStadt anotherStadtInstance = createBeanInstance(stadtBean);
+ KleinStadt anotherStadtInstance = getInstanceByType(KleinStadt.class, new AnnotationLiteral<Important>() {});
assert anotherStadtInstance != null : "Expected second instance of session bean";
- //assert frankfurt.isKleinStadtCreated();
+ assert frankfurt.isKleinStadtCreated();
assert anotherStadtInstance != stadtInstance : "create() should not return same bean as before";
// Verify that the instance returned is a proxy by checking for all local interfaces
Set<Class<?>> interfaces = new HashSet<Class<?>>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
assert interfaces.contains(KleinStadt.class);
assert interfaces.contains(SchoeneStadt.class);
+
+ }
+
+ @Test(groups = { "ri-broken", "enterpriseBeans", "clientProxy", "lifecycle", "integration" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "3.3.9", id = "b")
+ })
+ public void testSerializeSFSB() throws Exception
+ {
+ KleinStadt stadtInstance = getInstanceByType(KleinStadt.class, new AnnotationLiteral<Important>() {});
byte[] bytes = serialize(stadtInstance);
- stadtInstance = (KleinStadt) deserialize(bytes);
+ Object object = deserialize(bytes);
+ stadtInstance = (KleinStadt) object;
assert getCurrentConfiguration().getBeans().isProxy(stadtInstance);
- //frankfurt.dispose();
}
- @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration", "ri-broken" })
+ @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration" })
@SpecAssertions({
@SpecAssertion(section = "6.5", id = "b"),
@SpecAssertion(section = "6", id = "e")
@@ -94,6 +95,7 @@
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
KleinStadt kassel = createBeanInstance(stadtBean);
+ kassel.ping();
destroyAndRemoveBeanInstance(stadtBean, kassel);
assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java 2009-06-09 17:19:44 UTC (rev 2799)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java 2009-06-09 17:55:58 UTC (rev 2800)
@@ -2,17 +2,17 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.ejb.Stateful;
+import javax.enterprise.inject.Current;
@Stateful
@Important
-public class Heidelburg implements KleinStadt
+public class Heidelburg implements KleinStadt, SchoeneStadt
{
private String name;
- @EJB
+ @Current
private GrossStadt grossStadt;
@PostConstruct
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java 2009-06-09 17:19:44 UTC (rev 2799)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java 2009-06-09 17:55:58 UTC (rev 2800)
@@ -2,10 +2,10 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Current;
@Stateful
@RequestScoped
@@ -13,7 +13,7 @@
{
private String name;
- @EJB
+ @Current
private GrossStadt grossStadt;
@PostConstruct
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java 2009-06-09 17:19:44 UTC (rev 2799)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java 2009-06-09 17:55:58 UTC (rev 2800)
@@ -14,4 +14,6 @@
public String getName();
public void setName(String name);
+ public void ping();
+
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2799 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/enterprise/remove and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-09 13:19:44 -0400 (Tue, 09 Jun 2009)
New Revision: 2799
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Important.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java
Log:
Fixes to i/c suite
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-09 14:49:53 UTC (rev 2798)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-09 17:19:44 UTC (rev 2799)
@@ -6,6 +6,7 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.Context;
+import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -102,10 +103,13 @@
}
@Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
- @SpecAssertion(section = "6.5", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.5", id = "c"),
+ @SpecAssertion(section = "3.3.1", id = "db")
+ })
public void testRemovedEjbIgnored()
{
- KleinStadt stadtInstance = getInstanceByType(KleinStadt.class);
+ KleinStadt stadtInstance = getInstanceByType(KleinStadt.class, new AnnotationLiteral<Important>() {});
assert stadtInstance != null : "Expected instance to be created by container";
stadtInstance.setName("Kassel-Wilhelmshoehe");
stadtInstance.zustandVergessen();
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java 2009-06-09 17:19:44 UTC (rev 2799)
@@ -0,0 +1,48 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.EJB;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+@Important
+public class Heidelburg implements KleinStadt
+{
+ private String name;
+
+ @EJB
+ private GrossStadt grossStadt;
+
+ @PostConstruct
+ public void begruendet()
+ {
+ grossStadt.kleinStadtCreated();
+ name = "Heidelburg";
+ }
+
+ @Remove
+ public void zustandVergessen()
+ {
+ }
+
+ @PreDestroy
+ public void zustandVerloren()
+ {
+ grossStadt.kleinStadtDestroyed();
+ }
+
+ public void ping() {}
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Important.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Important.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Important.java 2009-06-09 17:19:44 UTC (rev 2799)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+/**
+ * @author Dan Allen
+ */
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@Inherited
+public @interface Important {
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Important.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-06-09 14:49:53 UTC (rev 2798)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-06-09 17:19:44 UTC (rev 2799)
@@ -59,7 +59,7 @@
}.run();
}
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "ri-broken" }, expectedExceptions = UnsupportedOperationException.class)
+ @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" }, expectedExceptions = UnsupportedOperationException.class)
@SpecAssertions({
@SpecAssertion(section = "3.3.1", id = "b"),
@SpecAssertion(section = "3.3.1", id = "c")
@@ -71,25 +71,4 @@
assert false : "Should never reach this assertion";
}
- @Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle" })
- @SpecAssertion(section = "3.3.1", id = "db")
- public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed() throws Exception
- {
- StateKeeper stateKeeper = getInstanceByType(StateKeeper.class);
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- DependentSessionInterface sessionBean = (DependentSessionInterface)
- getCurrentManager().getReference(getCurrentManager().getBeans(DependentSessionInterface.class).iterator().next(),
- DependentSessionInterface.class);
-
- sessionBean.businessMethod();
- }
- }.run();
- assert !stateKeeper.isBeanDestroyed();
- }
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java 2009-06-09 14:49:53 UTC (rev 2798)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java 2009-06-09 17:19:44 UTC (rev 2799)
@@ -1,7 +1,5 @@
package org.jboss.jsr299.tck.tests.lookup.injection.enterprise;
-import javax.enterprise.inject.spi.Bean;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
@@ -28,8 +26,7 @@
@Override
protected void execute() throws Exception
{
- Bean<HenHouseLocal> bean = getBeans(HenHouseLocal.class).iterator().next();
- HenHouseLocal henHouse = getCurrentManager().getContext(bean.getScopeType()).get(bean);
+ HenHouseLocal henHouse = getInstanceByType(HenHouseLocal.class);
assert henHouse.getFox() != null;
assert henHouse.getFox().getName().equals("gavin");
}
@@ -45,8 +42,7 @@
@Override
protected void execute() throws Exception
{
- Bean<HenHouseLocal> bean = getBeans(HenHouseLocal.class, new MegaPoorBinding()).iterator().next();
- HenHouseLocal henHouse = getCurrentManager().getContext(bean.getScopeType()).get(bean);
+ HenHouseLocal henHouse = getInstanceByType(HenHouseLocal.class);
assert henHouse.getFox() != null;
assert henHouse.getFox().getName().equals("gavin");
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2798 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 18 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-09 10:49:53 -0400 (Tue, 09 Jun 2009)
New Revision: 2798
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
Log:
Rename ManagerImpl
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java (from rev 2797, ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -0,0 +1,1158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * 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.jboss.webbeans;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.el.ELResolver;
+import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.context.ScopeType;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.BindingType;
+import javax.enterprise.inject.UnproxyableResolutionException;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.deployment.Standard;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Decorator;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.InterceptionType;
+import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.ManagedBean;
+import javax.enterprise.inject.spi.ObserverMethod;
+import javax.event.Observer;
+import javax.inject.DeploymentException;
+import javax.inject.DuplicateBindingTypeException;
+
+import org.jboss.webbeans.bean.DisposalMethodBean;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.bean.NewEnterpriseBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.proxy.ClientProxyProvider;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.el.Namespace;
+import org.jboss.webbeans.el.WebBeansELResolverImpl;
+import org.jboss.webbeans.event.EventManager;
+import org.jboss.webbeans.event.EventObserver;
+import org.jboss.webbeans.event.ObserverImpl;
+import org.jboss.webbeans.injection.NonContextualInjector;
+import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.injection.resolution.Resolver;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Proxies;
+import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.collections.multi.ConcurrentListHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.ConcurrentListMultiMap;
+import org.jboss.webbeans.util.collections.multi.ConcurrentSetHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.ConcurrentSetMultiMap;
+
+/**
+ * Implementation of the Web Beans Manager.
+ *
+ * Essentially a singleton for registering Beans, Contexts, Observers,
+ * Interceptors etc. as well as providing resolution
+ *
+ * @author Pete Muir
+ *
+ */
+public class BeanManagerImpl implements WebBeansManager, Serializable
+{
+
+ private static class CurrentActivity
+ {
+
+ private final Context context;
+ private final BeanManagerImpl manager;
+
+ public CurrentActivity(Context context, BeanManagerImpl manager)
+ {
+ this.context = context;
+ this.manager = manager;
+ }
+
+ public Context getContext()
+ {
+ return context;
+ }
+
+ public BeanManagerImpl getManager()
+ {
+ return manager;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CurrentActivity)
+ {
+ return this.getContext().equals(((CurrentActivity) obj).getContext());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getContext().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getContext() + " -> " + getManager();
+ }
+ }
+
+ private static final Log log = Logging.getLog(BeanManagerImpl.class);
+
+ private static final long serialVersionUID = 3021562879133838561L;
+
+ // The JNDI key to place the manager under
+ public static final String JNDI_KEY = "java:app/Manager";
+
+ /*
+ * Application scoped services
+ * ****************************
+ */
+ private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
+ private transient final ServiceRegistry services;
+
+ /*
+ * Application scoped data structures
+ * ***********************************
+ */
+ private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
+ private transient final ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts;
+ private final transient Set<CurrentActivity> currentActivities;
+ private transient final ClientProxyProvider clientProxyProvider;
+ private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans;
+ private transient final Map<String, RIBean<?>> riBeans;
+ private final transient Map<Bean<?>, Bean<?>> specializedBeans;
+ private final transient AtomicInteger ids;
+
+ /*
+ * Activity scoped services
+ * *************************
+ */
+ private transient final EventManager eventManager;
+ private transient final Resolver resolver;
+ private final transient NonContextualInjector nonContextualInjector;
+ private final transient ELResolver webbeansELResolver;
+
+ /*
+ * Activity scoped data structures
+ * ********************************
+ */
+ private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
+ private transient List<Bean<?>> beanWithManagers;
+ private final transient Namespace rootNamespace;
+ private final transient ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers;
+ private final transient Set<BeanManagerImpl> childActivities;
+ private final Integer id;
+
+
+ /**
+ * Create a new, root, manager
+ *
+ * @param serviceRegistry
+ * @return
+ */
+ public static BeanManagerImpl newRootManager(ServiceRegistry serviceRegistry)
+ {
+ List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ defaultEnabledDeploymentTypes.add(0, Standard.class);
+ defaultEnabledDeploymentTypes.add(1, Production.class);
+
+ return new BeanManagerImpl(
+ serviceRegistry,
+ new CopyOnWriteArrayList<Bean<?>>(),
+ new ConcurrentSetHashMultiMap<Type, EventObserver<?>>(),
+ new Namespace(),
+ new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>(),
+ new ConcurrentHashMap<String, RIBean<?>>(),
+ new ClientProxyProvider(),
+ new ConcurrentListHashMultiMap<Class<? extends Annotation>, Context>(),
+ new CopyOnWriteArraySet<CurrentActivity>(),
+ new HashMap<Bean<?>, Bean<?>>(),
+ defaultEnabledDeploymentTypes,
+ new AtomicInteger()
+ );
+ }
+
+ /**
+ * Create a new child manager
+ *
+ * @param parentManager
+ * @return
+ */
+ public static BeanManagerImpl newChildManager(BeanManagerImpl parentManager)
+ {
+ List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
+ beans.addAll(parentManager.getBeans());
+
+ ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers = new ConcurrentSetHashMultiMap<Type, EventObserver<?>>();
+ registeredObservers.deepPutAll(parentManager.getRegisteredObservers());
+ Namespace rootNamespace = new Namespace(parentManager.getRootNamespace());
+
+ return new BeanManagerImpl(
+ parentManager.getServices(),
+ beans,
+ registeredObservers,
+ rootNamespace,
+ parentManager.getNewEnterpriseBeanMap(),
+ parentManager.getRiBeans(),
+ parentManager.getClientProxyProvider(),
+ parentManager.getContexts(),
+ parentManager.getCurrentActivities(),
+ parentManager.getSpecializedBeans(),
+ parentManager.getEnabledDeploymentTypes(),
+ parentManager.getIds()
+ );
+ }
+
+ /**
+ * Create a new manager
+ *
+ * @param ejbServices the ejbResolver to use
+ */
+ private BeanManagerImpl(
+ ServiceRegistry serviceRegistry,
+ List<Bean<?>> beans,
+ ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers,
+ Namespace rootNamespace,
+ Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans,
+ Map<String, RIBean<?>> riBeans,
+ ClientProxyProvider clientProxyProvider,
+ ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts,
+ Set<CurrentActivity> currentActivities,
+ Map<Bean<?>, Bean<?>> specializedBeans,
+ List<Class<? extends Annotation>> enabledDeploymentTypes,
+ AtomicInteger ids
+ )
+ {
+ this.services = serviceRegistry;
+ this.beanWithManagers = beans;
+ this.newEnterpriseBeans = newEnterpriseBeans;
+ this.riBeans = riBeans;
+ this.clientProxyProvider = clientProxyProvider;
+ this.contexts = contexts;
+ this.currentActivities = currentActivities;
+ this.specializedBeans = specializedBeans;
+ this.registeredObservers = registeredObservers;
+ setEnabledDeploymentTypes(enabledDeploymentTypes);
+ this.rootNamespace = rootNamespace;
+ this.ids = ids;
+ this.id = ids.incrementAndGet();
+
+ this.resolver = new Resolver(this);
+ this.eventManager = new EventManager(this);
+ this.nonContextualInjector = new NonContextualInjector(this);
+ this.webbeansELResolver = new WebBeansELResolverImpl(this);
+ this.childActivities = new CopyOnWriteArraySet<BeanManagerImpl>();
+ this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
+ {
+ @Override
+ protected Stack<InjectionPoint> initialValue()
+ {
+ return new Stack<InjectionPoint>();
+ }
+ };
+ }
+
+ /**
+ * Set up the enabled deployment types, if none are specified by the user,
+ * the default @Production and @Standard are used. For internal use.
+ *
+ * @param enabledDeploymentTypes The enabled deployment types from
+ * web-beans.xml
+ */
+ protected void checkEnabledDeploymentTypes()
+ {
+ if (!this.enabledDeploymentTypes.get(0).equals(Standard.class))
+ {
+ throw new DeploymentException("@Standard must be the lowest precedence deployment type");
+ }
+ }
+
+ protected void addWebBeansDeploymentTypes()
+ {
+ if (!this.enabledDeploymentTypes.contains(WebBean.class))
+ {
+ this.enabledDeploymentTypes.add(1, WebBean.class);
+ }
+ }
+
+ /**
+ * Registers a bean with the manager
+ *
+ * @param bean The bean to register
+ * @return A reference to manager
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#addBean(javax.inject.manager.Bean)
+ */
+ public void addBean(Bean<?> bean)
+ {
+ if (beanWithManagers.contains(bean))
+ {
+ return;
+ }
+ resolver.clear();
+ beanWithManagers.add(bean);
+ registerBeanNamespace(bean);
+ for (BeanManagerImpl childActivity : childActivities)
+ {
+ childActivity.addBean(bean);
+ }
+ return;
+ }
+
+ /**
+ * Resolve the disposal method for the given producer method. For internal
+ * use.
+ *
+ * @param apiType The API type to match
+ * @param bindings The binding types to match
+ * @return The set of matching disposal methods
+ */
+ public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
+ {
+ // Correct?
+ Set<Bean<?>> beans = getBeans(apiType, bindings);
+ Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof DisposalMethodBean)
+ {
+ disposalBeans.add((DisposalMethodBean<T>) bean);
+ }
+ }
+ return disposalBeans;
+ }
+
+ public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
+ {
+ Class<?> clazz = event.getClass();
+ for (Annotation annotation : bindings)
+ {
+ if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new IllegalArgumentException("Not a binding type " + annotation);
+ }
+ }
+ HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(Arrays.asList(bindings));
+ if (bindingAnnotations.size() < bindings.length)
+ {
+ throw new DuplicateBindingTypeException("Duplicate binding types: " + bindings);
+ }
+ checkEventType(clazz);
+ return eventManager.getObservers(event, bindings);
+ }
+
+ private void checkEventType(Type eventType)
+ {
+ Type[] types;
+ if (eventType instanceof Class)
+ {
+ types = Reflections.getActualTypeArguments((Class<?>) eventType);
+ }
+ else if (eventType instanceof ParameterizedType)
+ {
+ types = ((ParameterizedType) eventType).getActualTypeArguments();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Event type " + eventType + " isn't a concrete type");
+ }
+ for (Type type : types)
+ {
+ if (type instanceof WildcardType)
+ {
+ throw new IllegalArgumentException("Cannot provide an event type parameterized with a wildcard " + eventType);
+ }
+ if (type instanceof TypeVariable)
+ {
+ throw new IllegalArgumentException("Cannot provide an event type parameterized with a type parameter " + eventType);
+ }
+ }
+ }
+
+ /**
+ * A strongly ordered, unmodifiable list of enabled deployment types
+ *
+ * @return The ordered enabled deployment types known to the manager
+ */
+ public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ return Collections.unmodifiableList(enabledDeploymentTypes);
+ }
+
+ /**
+ * Set the enabled deployment types
+ *
+ * @param enabledDeploymentTypes
+ */
+ public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
+ {
+ this.enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>(enabledDeploymentTypes);
+ checkEnabledDeploymentTypes();
+ addWebBeansDeploymentTypes();
+ }
+
+
+ public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
+ {
+ return getBeans(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
+ }
+
+ public Set<Bean<?>> getBeans(AnnotatedItem<?, ?> element, Annotation... bindings)
+ {
+ for (Annotation annotation : element.getAnnotationsAsSet())
+ {
+ if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new IllegalArgumentException("Not a binding type " + annotation);
+ }
+ }
+ for (Type type : element.getActualTypeArguments())
+ {
+ if (type instanceof WildcardType)
+ {
+ throw new IllegalArgumentException("Cannot resolve a type parameterized with a wildcard " + element);
+ }
+ if (type instanceof TypeVariable)
+ {
+ throw new IllegalArgumentException("Cannot resolve a type parameterized with a type parameter " + element);
+ }
+ }
+ if (bindings != null && bindings.length > element.getMetaAnnotations(BindingType.class).size())
+ {
+ throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
+ }
+ return resolver.get(element);
+ }
+
+ public Set<Bean<?>> getBeans(InjectionPoint injectionPoint)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ // TODO Do this properly
+ return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0])));
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Wraps a collection of beans into a thread safe list. Since this overwrites
+ * any existing list of beans in the manager, this should only be done on
+ * startup and other controlled situations. Also maps the beans by
+ * implementation class. For internal use.
+ *
+ * @param beans The set of beans to add
+ * @return A reference to the manager
+ */
+ // TODO Build maps in the deployer :-)
+ public void setBeans(Set<RIBean<?>> beans)
+ {
+ synchronized (beans)
+ {
+ this.beanWithManagers = new CopyOnWriteArrayList<Bean<?>>(beans);
+ for (RIBean<?> bean : beans)
+ {
+ if (bean instanceof NewEnterpriseBean)
+ {
+ newEnterpriseBeans.put(bean.getType(), (EnterpriseBean<?>) bean);
+ }
+ riBeans.put(bean.getId(), bean);
+ registerBeanNamespace(bean);
+ }
+ resolver.clear();
+ }
+ }
+
+ protected void registerBeanNamespace(Bean<?> bean)
+ {
+ if (bean.getName() != null && bean.getName().indexOf('.') > 0)
+ {
+ String name = bean.getName().substring(0, bean.getName().lastIndexOf('.'));
+ String[] hierarchy = name.split("\\.");
+ Namespace namespace = getRootNamespace();
+ for (String s : hierarchy)
+ {
+ namespace = namespace.putIfAbsent(s);
+ }
+ }
+ }
+
+ /**
+ * Gets the class-mapped beans. For internal use.
+ *
+ * @return The bean map
+ */
+ public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
+ {
+ return newEnterpriseBeans;
+ }
+
+ /**
+ * The beans registered with the Web Bean manager. For internal use
+ *
+ * @return The list of known beans
+ */
+ public List<Bean<?>> getBeans()
+ {
+ return Collections.unmodifiableList(beanWithManagers);
+ }
+
+ public Map<String, RIBean<?>> getRiBeans()
+ {
+ return Collections.unmodifiableMap(riBeans);
+ }
+
+ /**
+ * Registers a context with the manager
+ *
+ * @param context The context to add
+ * @return A reference to the manager
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#addContext(javax.enterprise.context.spi.Context)
+ */
+ public void addContext(Context context)
+ {
+ contexts.put(context.getScopeType(), context);
+ }
+
+
+ public void addObserver(Observer<?> observer, Annotation... bindings)
+ {
+ addObserver(observer,eventManager.getTypeOfObserver(observer),bindings);
+ }
+
+ /**
+ * Shortcut to register an ObserverImpl
+ *
+ * @param <T>
+ * @param observer
+ */
+ public <T> void addObserver(ObserverImpl<T> observer)
+ {
+ addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
+ }
+
+ public void addObserver(ObserverMethod<?, ?> observerMethod)
+ {
+ addObserver((Observer<?>)observerMethod, observerMethod.getObservedEventType(),
+ new ArrayList<Annotation>(observerMethod.getObservedEventBindings()).toArray(new Annotation[0]));
+
+ }
+
+
+ /**
+ * Does the actual observer registration
+ *
+ * @param observer
+ * @param eventType
+ * @param bindings
+ * @return
+ */
+ public void addObserver(Observer<?> observer, Type eventType, Annotation... bindings)
+ {
+ checkEventType(eventType);
+ this.eventManager.addObserver(observer, eventType, bindings);
+ for (BeanManagerImpl childActivity : childActivities)
+ {
+ childActivity.addObserver(observer, eventType, bindings);
+ }
+ }
+
+ public void removeObserver(Observer<?> observer)
+ {
+ eventManager.removeObserver(observer);
+ }
+
+
+ /**
+ * Fires an event object with given event object for given bindings
+ *
+ * @param event The event object to pass along
+ * @param bindings The binding types to match
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#fireEvent(java.lang.Object,
+ * java.lang.annotation.Annotation[])
+ */
+ public void fireEvent(Object event, Annotation... bindings)
+ {
+ // Check the event object for template parameters which are not allowed by
+ // the spec.
+ if (Reflections.isParameterizedType(event.getClass()))
+ {
+ throw new IllegalArgumentException("Event type " + event.getClass().getName() + " is not allowed because it is a generic");
+ }
+ // Also check that the binding types are truly binding types
+ for (Annotation binding : bindings)
+ {
+ if (!Reflections.isBindings(binding))
+ {
+ throw new IllegalArgumentException("Event type " + event.getClass().getName() + " cannot be fired with non-binding type " + binding.getClass().getName() + " specified");
+ }
+ }
+
+ // Get the observers for this event. Although resolveObservers is
+ // parameterized, this method is not, so we have to use
+ // Observer<Object> for observers.
+ Set<Observer<Object>> observers = resolveObservers(event, bindings);
+ eventManager.notifyObservers(observers, event);
+ }
+
+ /**
+ * Gets an active context of the given scope. Throws an exception if there
+ * are no active contexts found or if there are too many matches
+ *
+ * @param scopeType The scope to match
+ * @return A single active context of the given scope
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#getContext(java.lang.Class)
+ */
+ public Context getContext(Class<? extends Annotation> scopeType)
+ {
+ List<Context> activeContexts = new ArrayList<Context>();
+ for (Context context : contexts.get(scopeType))
+ {
+ if (context.isActive())
+ {
+ activeContexts.add(context);
+ }
+ }
+ if (activeContexts.isEmpty())
+ {
+ throw new ContextNotActiveException("No active contexts for scope type " + scopeType.getName());
+ }
+ if (activeContexts.size() > 1)
+ {
+ throw new IllegalStateException("More than one context active for scope type " + scopeType.getName());
+ }
+ return activeContexts.iterator().next();
+
+ }
+
+ public Object getInjectableReference(Bean<?> bean, CreationalContext<?> creationalContext)
+ {
+ bean = getMostSpecializedBean(bean);
+ if (getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal())
+ {
+ if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
+ {
+ return clientProxyProvider.getClientProxy(this, bean);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return getContext(bean.getScopeType()).get((Bean) bean, creationalContext);
+ }
+ }
+
+
+ /*
+ * TODO this is not correct, as the current implementation of getInstance does not
+ * pay attention to what type the resulting instance needs to implement
+ */
+ public Object getReference(Bean<?> bean, Type beanType)
+ {
+ return getInjectableReference(bean, CreationalContextImpl.of(bean));
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
+ Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
+ if (getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
+ {
+ throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
+ }
+ if (creationalContext instanceof CreationalContextImpl)
+ {
+ CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
+ if (ctx.containsIncompleteInstance(resolvedBean))
+ {
+ return ctx.getIncompleteInstance(resolvedBean);
+ }
+ else
+ {
+ return getInjectableReference(resolvedBean, ctx.getCreationalContext(resolvedBean));
+ }
+ }
+ else
+ {
+ return getInjectableReference(resolvedBean, creationalContext);
+ }
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Returns an instance by API type and binding types
+ *
+ * @param type The API type to match
+ * @param bindings The binding types to match
+ * @return An instance of the bean
+ *
+ * @deprecated replace with non-contextual injection
+ *
+ */
+ @Deprecated
+ public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
+ {
+ AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings);
+ return (T) getReference(getBean(element, bindings), type);
+ }
+
+ public <T> Bean<T> getBean(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ Set<Bean<?>> beans = getBeans(element, bindings);
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedResolutionException(element + "Unable to resolve any Web Beans");
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousResolutionException(element + "Resolved multiple Web Beans");
+ }
+ Bean<T> bean = (Bean<T>) beans.iterator().next();
+ boolean normalScoped = getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal();
+ if (normalScoped && !Beans.isBeanProxyable(bean))
+ {
+ throw new UnproxyableResolutionException("Normal scoped bean " + bean + " is not proxyable");
+ }
+ return bean;
+ }
+
+ public Set<Bean<?>> getBeans(String name)
+ {
+ return resolver.get(name);
+ }
+
+ /**
+ * Resolves a list of decorators based on API types and binding types Os
+ *
+ * @param types The set of API types to match
+ * @param bindings The binding types to match
+ * @return A list of matching decorators
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#resolveDecorators(java.util.Set,
+ * java.lang.annotation.Annotation[])
+ */
+ public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Resolves a list of interceptors based on interception type and interceptor
+ * bindings
+ *
+ * @param type The interception type to resolve
+ * @param interceptorBindings The binding types to match
+ * @return A list of matching interceptors
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType,
+ * java.lang.annotation.Annotation[])
+ */
+ public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Get the web bean resolver. For internal use
+ *
+ * @return The resolver
+ */
+ public Resolver getResolver()
+ {
+ return resolver;
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Manager\n");
+ buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\n");
+ buffer.append("Registered contexts: " + contexts.keySet() + "\n");
+ buffer.append("Registered beans: " + getBeans().size() + "\n");
+ buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
+ return buffer.toString();
+ }
+
+ public BeanManagerImpl createActivity()
+ {
+ BeanManagerImpl childActivity = newChildManager(this);
+ childActivities.add(childActivity);
+ CurrentManager.add(childActivity);
+ return childActivity;
+ }
+
+ public BeanManagerImpl setCurrent(Class<? extends Annotation> scopeType)
+ {
+ if (!getServices().get(MetaDataCache.class).getScopeModel(scopeType).isNormal())
+ {
+ throw new IllegalArgumentException("Scope must be a normal scope type " + scopeType);
+ }
+ currentActivities.add(new CurrentActivity(getContext(scopeType), this));
+ return this;
+ }
+
+ public BeanManagerImpl getCurrent()
+ {
+ List<CurrentActivity> activeCurrentActivities = new ArrayList<CurrentActivity>();
+ for (CurrentActivity currentActivity : currentActivities)
+ {
+ if (currentActivity.getContext().isActive())
+ {
+ activeCurrentActivities.add(currentActivity);
+ }
+ }
+ if (activeCurrentActivities.size() == 0)
+ {
+ return CurrentManager.rootManager();
+ }
+ else if (activeCurrentActivities.size() == 1)
+ {
+ return activeCurrentActivities.get(0).getManager();
+ }
+ throw new IllegalStateException("More than one current activity for an active context " + currentActivities);
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return services;
+ }
+
+ /**
+ * Accesses the factory used to create each instance of InjectionPoint that
+ * is injected into web beans.
+ *
+ * @return the factory
+ */
+ public InjectionPoint getInjectionPoint()
+ {
+ if (!currentInjectionPoint.get().empty())
+ {
+ return currentInjectionPoint.get().peek();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map<Bean<?>, Bean<?>> getSpecializedBeans()
+ {
+ // TODO make this unmodifiable after deploy!
+ return specializedBeans;
+ }
+
+ // Serialization
+
+ protected Object readResolve()
+ {
+ return CurrentManager.get(id);
+ }
+
+ /**
+ * Provides access to the executor service used for asynchronous tasks.
+ *
+ * @return the ExecutorService for this manager
+ */
+ public ExecutorService getTaskExecutor()
+ {
+ return taskExecutor;
+ }
+
+ public void shutdown()
+ {
+ log.trace("Ending application");
+ shutdownExecutors();
+ ApplicationContext.instance().destroy();
+ ApplicationContext.instance().setActive(false);
+ ApplicationContext.instance().setBeanStore(null);
+ CurrentManager.cleanup();
+ }
+
+ /**
+ * Shuts down any executor services in the manager.
+ */
+ protected void shutdownExecutors()
+ {
+ taskExecutor.shutdown();
+ try
+ {
+ // Wait a while for existing tasks to terminate
+ if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
+ {
+ taskExecutor.shutdownNow(); // Cancel currently executing tasks
+ // Wait a while for tasks to respond to being cancelled
+ if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
+ {
+ // Log the error here
+ }
+ }
+ }
+ catch (InterruptedException ie)
+ {
+ // (Re-)Cancel if current thread also interrupted
+ taskExecutor.shutdownNow();
+ // Preserve interrupt status
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ protected ClientProxyProvider getClientProxyProvider()
+ {
+ return clientProxyProvider;
+ }
+
+ protected ConcurrentListMultiMap<Class<? extends Annotation>, Context> getContexts()
+ {
+ return contexts;
+ }
+
+ protected AtomicInteger getIds()
+ {
+ return ids;
+ }
+
+ protected Set<CurrentActivity> getCurrentActivities()
+ {
+ return currentActivities;
+ }
+
+ public Integer getId()
+ {
+ return id;
+ }
+
+ public ConcurrentSetMultiMap<Type, EventObserver<?>> getRegisteredObservers()
+ {
+ return registeredObservers;
+ }
+
+ public Namespace getRootNamespace()
+ {
+ return rootNamespace;
+ }
+
+
+ public <T> InjectionTarget<T> createInjectionTarget(Class<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> ManagedBean<T> createManagedBean(Class<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+
+
+ public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
+ {
+ Bean<?> key = bean;
+ while (specializedBeans.containsKey(key))
+ {
+ if (key == null)
+ {
+ System.out.println("null key " + bean);
+ }
+ key = specializedBeans.get(key);
+ }
+ return (Bean<X>) key;
+ }
+
+
+ public void validate(InjectionPoint injectionPoint)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+
+ public Set<Annotation> getInterceptorBindingTypeDefinition(
+ Class<? extends Annotation> bindingType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Bean<?> getPassivationCapableBean(String id)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Set<Annotation> getStereotypeDefinition(
+ Class<? extends Annotation> stereotype)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isBindingType(Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isInterceptorBindingType(
+ Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isScopeType(Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isStereotype(Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
+ {
+ if (beans.size() == 1)
+ {
+ return beans.iterator().next();
+ }
+ else if (beans.isEmpty())
+ {
+ return null;
+ }
+
+ // make a copy so that the sort is stable with respect to new deployment types added through the SPI
+ // TODO This code needs to be in Resolver
+ // TODO This needs caching
+ final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
+
+ SortedSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
+ {
+ public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
+ {
+ int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
+ if (diff == 0)
+ {
+ throw new AmbiguousResolutionException();
+ }
+ return diff;
+ }
+ });
+ sortedBeans.addAll(beans);
+ return sortedBeans.last();
+ }
+
+ public ELResolver getELResolver()
+ {
+ return webbeansELResolver;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -63,9 +63,9 @@
public class BeanValidator
{
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public BeanValidator(ManagerImpl manager)
+ public BeanValidator(BeanManagerImpl manager)
{
this.manager = manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -41,12 +41,12 @@
public class CurrentManager
{
- private static class IntegerMangerImplMap extends TypeLiteral<Map<Integer, ManagerImpl>> {}
+ private static class IntegerMangerImplMap extends TypeLiteral<Map<Integer, BeanManagerImpl>> {}
// The root manager instance
- private static Singleton<ManagerImpl> rootManager = SingletonProvider.instance().create(ManagerImpl.class);
+ private static Singleton<BeanManagerImpl> rootManager = SingletonProvider.instance().create(BeanManagerImpl.class);
- private final static Singleton<Map<Integer, ManagerImpl>> managers = SingletonProvider.instance().create(new IntegerMangerImplMap().getRawType());
+ private final static Singleton<Map<Integer, BeanManagerImpl>> managers = SingletonProvider.instance().create(new IntegerMangerImplMap().getRawType());
public static void cleanup()
{
@@ -59,7 +59,7 @@
*
* @return The root manager
*/
- public static ManagerImpl rootManager()
+ public static BeanManagerImpl rootManager()
{
return rootManager.get();
}
@@ -69,22 +69,22 @@
*
* @param managerImpl The root manager
*/
- public static void setRootManager(ManagerImpl managerImpl)
+ public static void setRootManager(BeanManagerImpl managerImpl)
{
rootManager.set(managerImpl);
if (managers.get() == null)
{
- managers.set(new ConcurrentHashMap<Integer, ManagerImpl>());
+ managers.set(new ConcurrentHashMap<Integer, BeanManagerImpl>());
}
managers.get().put(managerImpl.getId(), managerImpl);
}
- public static ManagerImpl get(Integer key)
+ public static BeanManagerImpl get(Integer key)
{
return managers.get().get(key);
}
- public static Integer add(ManagerImpl manager)
+ public static Integer add(BeanManagerImpl manager)
{
Integer id = manager.getId();
managers.get().put(id, manager);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -45,7 +45,7 @@
// The binding types the helper operates on
private final Set<? extends Annotation> bindings;
// The Web Beans manager
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
// The type of the operation
private final Type type;
@@ -55,7 +55,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- protected FacadeImpl(Type type, ManagerImpl manager, Set<? extends Annotation> bindings)
+ protected FacadeImpl(Type type, BeanManagerImpl manager, Set<? extends Annotation> bindings)
{
this.manager = manager;
this.type = type;
@@ -92,7 +92,7 @@
return result.toArray(EMPTY_BINDINGS);
}
- protected ManagerImpl getManager()
+ protected BeanManagerImpl getManager()
{
return manager.getCurrent();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -38,12 +38,12 @@
private static final long serialVersionUID = -376721889693284887L;
- public static <I> Instance<I> of(Type type, ManagerImpl manager, Set<Annotation> annotations)
+ public static <I> Instance<I> of(Type type, BeanManagerImpl manager, Set<Annotation> annotations)
{
return new InstanceImpl<I>(type, manager, annotations);
}
- private InstanceImpl(Type type, ManagerImpl manager, Set<Annotation> bindings)
+ private InstanceImpl(Type type, BeanManagerImpl manager, Set<Annotation> bindings)
{
super(type, manager, bindings);
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -1,1158 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * 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.jboss.webbeans;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.Stack;
-import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.el.ELResolver;
-import javax.enterprise.context.ContextNotActiveException;
-import javax.enterprise.context.ScopeType;
-import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.UnproxyableResolutionException;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.deployment.Standard;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Decorator;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.inject.spi.InterceptionType;
-import javax.enterprise.inject.spi.Interceptor;
-import javax.enterprise.inject.spi.ManagedBean;
-import javax.enterprise.inject.spi.ObserverMethod;
-import javax.event.Observer;
-import javax.inject.DeploymentException;
-import javax.inject.DuplicateBindingTypeException;
-
-import org.jboss.webbeans.bean.DisposalMethodBean;
-import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.bean.NewEnterpriseBean;
-import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.bean.proxy.ClientProxyProvider;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.context.ApplicationContext;
-import org.jboss.webbeans.context.CreationalContextImpl;
-import org.jboss.webbeans.el.Namespace;
-import org.jboss.webbeans.el.WebBeansELResolverImpl;
-import org.jboss.webbeans.event.EventManager;
-import org.jboss.webbeans.event.EventObserver;
-import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.injection.NonContextualInjector;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
-import org.jboss.webbeans.injection.resolution.Resolver;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-import org.jboss.webbeans.metadata.MetaDataCache;
-import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Proxies;
-import org.jboss.webbeans.util.Reflections;
-import org.jboss.webbeans.util.collections.multi.ConcurrentListHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.ConcurrentListMultiMap;
-import org.jboss.webbeans.util.collections.multi.ConcurrentSetHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.ConcurrentSetMultiMap;
-
-/**
- * Implementation of the Web Beans Manager.
- *
- * Essentially a singleton for registering Beans, Contexts, Observers,
- * Interceptors etc. as well as providing resolution
- *
- * @author Pete Muir
- *
- */
-public class ManagerImpl implements WebBeansManager, Serializable
-{
-
- private static class CurrentActivity
- {
-
- private final Context context;
- private final ManagerImpl manager;
-
- public CurrentActivity(Context context, ManagerImpl manager)
- {
- this.context = context;
- this.manager = manager;
- }
-
- public Context getContext()
- {
- return context;
- }
-
- public ManagerImpl getManager()
- {
- return manager;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof CurrentActivity)
- {
- return this.getContext().equals(((CurrentActivity) obj).getContext());
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- return getContext().hashCode();
- }
-
- @Override
- public String toString()
- {
- return getContext() + " -> " + getManager();
- }
- }
-
- private static final Log log = Logging.getLog(ManagerImpl.class);
-
- private static final long serialVersionUID = 3021562879133838561L;
-
- // The JNDI key to place the manager under
- public static final String JNDI_KEY = "java:app/Manager";
-
- /*
- * Application scoped services
- * ****************************
- */
- private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
- private transient final ServiceRegistry services;
-
- /*
- * Application scoped data structures
- * ***********************************
- */
- private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
- private transient final ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts;
- private final transient Set<CurrentActivity> currentActivities;
- private transient final ClientProxyProvider clientProxyProvider;
- private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans;
- private transient final Map<String, RIBean<?>> riBeans;
- private final transient Map<Bean<?>, Bean<?>> specializedBeans;
- private final transient AtomicInteger ids;
-
- /*
- * Activity scoped services
- * *************************
- */
- private transient final EventManager eventManager;
- private transient final Resolver resolver;
- private final transient NonContextualInjector nonContextualInjector;
- private final transient ELResolver webbeansELResolver;
-
- /*
- * Activity scoped data structures
- * ********************************
- */
- private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
- private transient List<Bean<?>> beanWithManagers;
- private final transient Namespace rootNamespace;
- private final transient ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers;
- private final transient Set<ManagerImpl> childActivities;
- private final Integer id;
-
-
- /**
- * Create a new, root, manager
- *
- * @param serviceRegistry
- * @return
- */
- public static ManagerImpl newRootManager(ServiceRegistry serviceRegistry)
- {
- List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- defaultEnabledDeploymentTypes.add(0, Standard.class);
- defaultEnabledDeploymentTypes.add(1, Production.class);
-
- return new ManagerImpl(
- serviceRegistry,
- new CopyOnWriteArrayList<Bean<?>>(),
- new ConcurrentSetHashMultiMap<Type, EventObserver<?>>(),
- new Namespace(),
- new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>(),
- new ConcurrentHashMap<String, RIBean<?>>(),
- new ClientProxyProvider(),
- new ConcurrentListHashMultiMap<Class<? extends Annotation>, Context>(),
- new CopyOnWriteArraySet<CurrentActivity>(),
- new HashMap<Bean<?>, Bean<?>>(),
- defaultEnabledDeploymentTypes,
- new AtomicInteger()
- );
- }
-
- /**
- * Create a new child manager
- *
- * @param parentManager
- * @return
- */
- public static ManagerImpl newChildManager(ManagerImpl parentManager)
- {
- List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
- beans.addAll(parentManager.getBeans());
-
- ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers = new ConcurrentSetHashMultiMap<Type, EventObserver<?>>();
- registeredObservers.deepPutAll(parentManager.getRegisteredObservers());
- Namespace rootNamespace = new Namespace(parentManager.getRootNamespace());
-
- return new ManagerImpl(
- parentManager.getServices(),
- beans,
- registeredObservers,
- rootNamespace,
- parentManager.getNewEnterpriseBeanMap(),
- parentManager.getRiBeans(),
- parentManager.getClientProxyProvider(),
- parentManager.getContexts(),
- parentManager.getCurrentActivities(),
- parentManager.getSpecializedBeans(),
- parentManager.getEnabledDeploymentTypes(),
- parentManager.getIds()
- );
- }
-
- /**
- * Create a new manager
- *
- * @param ejbServices the ejbResolver to use
- */
- private ManagerImpl(
- ServiceRegistry serviceRegistry,
- List<Bean<?>> beans,
- ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers,
- Namespace rootNamespace,
- Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans,
- Map<String, RIBean<?>> riBeans,
- ClientProxyProvider clientProxyProvider,
- ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts,
- Set<CurrentActivity> currentActivities,
- Map<Bean<?>, Bean<?>> specializedBeans,
- List<Class<? extends Annotation>> enabledDeploymentTypes,
- AtomicInteger ids
- )
- {
- this.services = serviceRegistry;
- this.beanWithManagers = beans;
- this.newEnterpriseBeans = newEnterpriseBeans;
- this.riBeans = riBeans;
- this.clientProxyProvider = clientProxyProvider;
- this.contexts = contexts;
- this.currentActivities = currentActivities;
- this.specializedBeans = specializedBeans;
- this.registeredObservers = registeredObservers;
- setEnabledDeploymentTypes(enabledDeploymentTypes);
- this.rootNamespace = rootNamespace;
- this.ids = ids;
- this.id = ids.incrementAndGet();
-
- this.resolver = new Resolver(this);
- this.eventManager = new EventManager(this);
- this.nonContextualInjector = new NonContextualInjector(this);
- this.webbeansELResolver = new WebBeansELResolverImpl(this);
- this.childActivities = new CopyOnWriteArraySet<ManagerImpl>();
- this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
- {
- @Override
- protected Stack<InjectionPoint> initialValue()
- {
- return new Stack<InjectionPoint>();
- }
- };
- }
-
- /**
- * Set up the enabled deployment types, if none are specified by the user,
- * the default @Production and @Standard are used. For internal use.
- *
- * @param enabledDeploymentTypes The enabled deployment types from
- * web-beans.xml
- */
- protected void checkEnabledDeploymentTypes()
- {
- if (!this.enabledDeploymentTypes.get(0).equals(Standard.class))
- {
- throw new DeploymentException("@Standard must be the lowest precedence deployment type");
- }
- }
-
- protected void addWebBeansDeploymentTypes()
- {
- if (!this.enabledDeploymentTypes.contains(WebBean.class))
- {
- this.enabledDeploymentTypes.add(1, WebBean.class);
- }
- }
-
- /**
- * Registers a bean with the manager
- *
- * @param bean The bean to register
- * @return A reference to manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#addBean(javax.inject.manager.Bean)
- */
- public void addBean(Bean<?> bean)
- {
- if (beanWithManagers.contains(bean))
- {
- return;
- }
- resolver.clear();
- beanWithManagers.add(bean);
- registerBeanNamespace(bean);
- for (ManagerImpl childActivity : childActivities)
- {
- childActivity.addBean(bean);
- }
- return;
- }
-
- /**
- * Resolve the disposal method for the given producer method. For internal
- * use.
- *
- * @param apiType The API type to match
- * @param bindings The binding types to match
- * @return The set of matching disposal methods
- */
- public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
- {
- // Correct?
- Set<Bean<?>> beans = getBeans(apiType, bindings);
- Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
- for (Bean<?> bean : beans)
- {
- if (bean instanceof DisposalMethodBean)
- {
- disposalBeans.add((DisposalMethodBean<T>) bean);
- }
- }
- return disposalBeans;
- }
-
- public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
- {
- Class<?> clazz = event.getClass();
- for (Annotation annotation : bindings)
- {
- if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new IllegalArgumentException("Not a binding type " + annotation);
- }
- }
- HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(Arrays.asList(bindings));
- if (bindingAnnotations.size() < bindings.length)
- {
- throw new DuplicateBindingTypeException("Duplicate binding types: " + bindings);
- }
- checkEventType(clazz);
- return eventManager.getObservers(event, bindings);
- }
-
- private void checkEventType(Type eventType)
- {
- Type[] types;
- if (eventType instanceof Class)
- {
- types = Reflections.getActualTypeArguments((Class<?>) eventType);
- }
- else if (eventType instanceof ParameterizedType)
- {
- types = ((ParameterizedType) eventType).getActualTypeArguments();
- }
- else
- {
- throw new IllegalArgumentException("Event type " + eventType + " isn't a concrete type");
- }
- for (Type type : types)
- {
- if (type instanceof WildcardType)
- {
- throw new IllegalArgumentException("Cannot provide an event type parameterized with a wildcard " + eventType);
- }
- if (type instanceof TypeVariable)
- {
- throw new IllegalArgumentException("Cannot provide an event type parameterized with a type parameter " + eventType);
- }
- }
- }
-
- /**
- * A strongly ordered, unmodifiable list of enabled deployment types
- *
- * @return The ordered enabled deployment types known to the manager
- */
- public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
- {
- return Collections.unmodifiableList(enabledDeploymentTypes);
- }
-
- /**
- * Set the enabled deployment types
- *
- * @param enabledDeploymentTypes
- */
- public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
- {
- this.enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>(enabledDeploymentTypes);
- checkEnabledDeploymentTypes();
- addWebBeansDeploymentTypes();
- }
-
-
- public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
- {
- return getBeans(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
- }
-
- public Set<Bean<?>> getBeans(AnnotatedItem<?, ?> element, Annotation... bindings)
- {
- for (Annotation annotation : element.getAnnotationsAsSet())
- {
- if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new IllegalArgumentException("Not a binding type " + annotation);
- }
- }
- for (Type type : element.getActualTypeArguments())
- {
- if (type instanceof WildcardType)
- {
- throw new IllegalArgumentException("Cannot resolve a type parameterized with a wildcard " + element);
- }
- if (type instanceof TypeVariable)
- {
- throw new IllegalArgumentException("Cannot resolve a type parameterized with a type parameter " + element);
- }
- }
- if (bindings != null && bindings.length > element.getMetaAnnotations(BindingType.class).size())
- {
- throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
- }
- return resolver.get(element);
- }
-
- public Set<Bean<?>> getBeans(InjectionPoint injectionPoint)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- // TODO Do this properly
- return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0])));
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Wraps a collection of beans into a thread safe list. Since this overwrites
- * any existing list of beans in the manager, this should only be done on
- * startup and other controlled situations. Also maps the beans by
- * implementation class. For internal use.
- *
- * @param beans The set of beans to add
- * @return A reference to the manager
- */
- // TODO Build maps in the deployer :-)
- public void setBeans(Set<RIBean<?>> beans)
- {
- synchronized (beans)
- {
- this.beanWithManagers = new CopyOnWriteArrayList<Bean<?>>(beans);
- for (RIBean<?> bean : beans)
- {
- if (bean instanceof NewEnterpriseBean)
- {
- newEnterpriseBeans.put(bean.getType(), (EnterpriseBean<?>) bean);
- }
- riBeans.put(bean.getId(), bean);
- registerBeanNamespace(bean);
- }
- resolver.clear();
- }
- }
-
- protected void registerBeanNamespace(Bean<?> bean)
- {
- if (bean.getName() != null && bean.getName().indexOf('.') > 0)
- {
- String name = bean.getName().substring(0, bean.getName().lastIndexOf('.'));
- String[] hierarchy = name.split("\\.");
- Namespace namespace = getRootNamespace();
- for (String s : hierarchy)
- {
- namespace = namespace.putIfAbsent(s);
- }
- }
- }
-
- /**
- * Gets the class-mapped beans. For internal use.
- *
- * @return The bean map
- */
- public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
- {
- return newEnterpriseBeans;
- }
-
- /**
- * The beans registered with the Web Bean manager. For internal use
- *
- * @return The list of known beans
- */
- public List<Bean<?>> getBeans()
- {
- return Collections.unmodifiableList(beanWithManagers);
- }
-
- public Map<String, RIBean<?>> getRiBeans()
- {
- return Collections.unmodifiableMap(riBeans);
- }
-
- /**
- * Registers a context with the manager
- *
- * @param context The context to add
- * @return A reference to the manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#addContext(javax.enterprise.context.spi.Context)
- */
- public void addContext(Context context)
- {
- contexts.put(context.getScopeType(), context);
- }
-
-
- public void addObserver(Observer<?> observer, Annotation... bindings)
- {
- addObserver(observer,eventManager.getTypeOfObserver(observer),bindings);
- }
-
- /**
- * Shortcut to register an ObserverImpl
- *
- * @param <T>
- * @param observer
- */
- public <T> void addObserver(ObserverImpl<T> observer)
- {
- addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
- }
-
- public void addObserver(ObserverMethod<?, ?> observerMethod)
- {
- addObserver((Observer<?>)observerMethod, observerMethod.getObservedEventType(),
- new ArrayList<Annotation>(observerMethod.getObservedEventBindings()).toArray(new Annotation[0]));
-
- }
-
-
- /**
- * Does the actual observer registration
- *
- * @param observer
- * @param eventType
- * @param bindings
- * @return
- */
- public void addObserver(Observer<?> observer, Type eventType, Annotation... bindings)
- {
- checkEventType(eventType);
- this.eventManager.addObserver(observer, eventType, bindings);
- for (ManagerImpl childActivity : childActivities)
- {
- childActivity.addObserver(observer, eventType, bindings);
- }
- }
-
- public void removeObserver(Observer<?> observer)
- {
- eventManager.removeObserver(observer);
- }
-
-
- /**
- * Fires an event object with given event object for given bindings
- *
- * @param event The event object to pass along
- * @param bindings The binding types to match
- *
- * @see javax.enterprise.inject.spi.BeanManager#fireEvent(java.lang.Object,
- * java.lang.annotation.Annotation[])
- */
- public void fireEvent(Object event, Annotation... bindings)
- {
- // Check the event object for template parameters which are not allowed by
- // the spec.
- if (Reflections.isParameterizedType(event.getClass()))
- {
- throw new IllegalArgumentException("Event type " + event.getClass().getName() + " is not allowed because it is a generic");
- }
- // Also check that the binding types are truly binding types
- for (Annotation binding : bindings)
- {
- if (!Reflections.isBindings(binding))
- {
- throw new IllegalArgumentException("Event type " + event.getClass().getName() + " cannot be fired with non-binding type " + binding.getClass().getName() + " specified");
- }
- }
-
- // Get the observers for this event. Although resolveObservers is
- // parameterized, this method is not, so we have to use
- // Observer<Object> for observers.
- Set<Observer<Object>> observers = resolveObservers(event, bindings);
- eventManager.notifyObservers(observers, event);
- }
-
- /**
- * Gets an active context of the given scope. Throws an exception if there
- * are no active contexts found or if there are too many matches
- *
- * @param scopeType The scope to match
- * @return A single active context of the given scope
- *
- * @see javax.enterprise.inject.spi.BeanManager#getContext(java.lang.Class)
- */
- public Context getContext(Class<? extends Annotation> scopeType)
- {
- List<Context> activeContexts = new ArrayList<Context>();
- for (Context context : contexts.get(scopeType))
- {
- if (context.isActive())
- {
- activeContexts.add(context);
- }
- }
- if (activeContexts.isEmpty())
- {
- throw new ContextNotActiveException("No active contexts for scope type " + scopeType.getName());
- }
- if (activeContexts.size() > 1)
- {
- throw new IllegalStateException("More than one context active for scope type " + scopeType.getName());
- }
- return activeContexts.iterator().next();
-
- }
-
- public Object getInjectableReference(Bean<?> bean, CreationalContext<?> creationalContext)
- {
- bean = getMostSpecializedBean(bean);
- if (getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal())
- {
- if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
- {
- return clientProxyProvider.getClientProxy(this, bean);
- }
- else
- {
- return null;
- }
- }
- else
- {
- return getContext(bean.getScopeType()).get((Bean) bean, creationalContext);
- }
- }
-
-
- /*
- * TODO this is not correct, as the current implementation of getInstance does not
- * pay attention to what type the resulting instance needs to implement
- */
- public Object getReference(Bean<?> bean, Type beanType)
- {
- return getInjectableReference(bean, CreationalContextImpl.of(bean));
- }
-
- @SuppressWarnings("unchecked")
- public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
- Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
- if (getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
- {
- throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
- }
- if (creationalContext instanceof CreationalContextImpl)
- {
- CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
- if (ctx.containsIncompleteInstance(resolvedBean))
- {
- return ctx.getIncompleteInstance(resolvedBean);
- }
- else
- {
- return getInjectableReference(resolvedBean, ctx.getCreationalContext(resolvedBean));
- }
- }
- else
- {
- return getInjectableReference(resolvedBean, creationalContext);
- }
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Returns an instance by API type and binding types
- *
- * @param type The API type to match
- * @param bindings The binding types to match
- * @return An instance of the bean
- *
- * @deprecated replace with non-contextual injection
- *
- */
- @Deprecated
- public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
- {
- AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings);
- return (T) getReference(getBean(element, bindings), type);
- }
-
- public <T> Bean<T> getBean(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- Set<Bean<?>> beans = getBeans(element, bindings);
- if (beans.size() == 0)
- {
- throw new UnsatisfiedResolutionException(element + "Unable to resolve any Web Beans");
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousResolutionException(element + "Resolved multiple Web Beans");
- }
- Bean<T> bean = (Bean<T>) beans.iterator().next();
- boolean normalScoped = getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal();
- if (normalScoped && !Beans.isBeanProxyable(bean))
- {
- throw new UnproxyableResolutionException("Normal scoped bean " + bean + " is not proxyable");
- }
- return bean;
- }
-
- public Set<Bean<?>> getBeans(String name)
- {
- return resolver.get(name);
- }
-
- /**
- * Resolves a list of decorators based on API types and binding types Os
- *
- * @param types The set of API types to match
- * @param bindings The binding types to match
- * @return A list of matching decorators
- *
- * @see javax.enterprise.inject.spi.BeanManager#resolveDecorators(java.util.Set,
- * java.lang.annotation.Annotation[])
- */
- public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindings)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Resolves a list of interceptors based on interception type and interceptor
- * bindings
- *
- * @param type The interception type to resolve
- * @param interceptorBindings The binding types to match
- * @return A list of matching interceptors
- *
- * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType,
- * java.lang.annotation.Annotation[])
- */
- public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Get the web bean resolver. For internal use
- *
- * @return The resolver
- */
- public Resolver getResolver()
- {
- return resolver;
- }
-
- /**
- * Gets a string representation
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Manager\n");
- buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\n");
- buffer.append("Registered contexts: " + contexts.keySet() + "\n");
- buffer.append("Registered beans: " + getBeans().size() + "\n");
- buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
- return buffer.toString();
- }
-
- public ManagerImpl createActivity()
- {
- ManagerImpl childActivity = newChildManager(this);
- childActivities.add(childActivity);
- CurrentManager.add(childActivity);
- return childActivity;
- }
-
- public ManagerImpl setCurrent(Class<? extends Annotation> scopeType)
- {
- if (!getServices().get(MetaDataCache.class).getScopeModel(scopeType).isNormal())
- {
- throw new IllegalArgumentException("Scope must be a normal scope type " + scopeType);
- }
- currentActivities.add(new CurrentActivity(getContext(scopeType), this));
- return this;
- }
-
- public ManagerImpl getCurrent()
- {
- List<CurrentActivity> activeCurrentActivities = new ArrayList<CurrentActivity>();
- for (CurrentActivity currentActivity : currentActivities)
- {
- if (currentActivity.getContext().isActive())
- {
- activeCurrentActivities.add(currentActivity);
- }
- }
- if (activeCurrentActivities.size() == 0)
- {
- return CurrentManager.rootManager();
- }
- else if (activeCurrentActivities.size() == 1)
- {
- return activeCurrentActivities.get(0).getManager();
- }
- throw new IllegalStateException("More than one current activity for an active context " + currentActivities);
- }
-
- public ServiceRegistry getServices()
- {
- return services;
- }
-
- /**
- * Accesses the factory used to create each instance of InjectionPoint that
- * is injected into web beans.
- *
- * @return the factory
- */
- public InjectionPoint getInjectionPoint()
- {
- if (!currentInjectionPoint.get().empty())
- {
- return currentInjectionPoint.get().peek();
- }
- else
- {
- return null;
- }
- }
-
- /**
- *
- * @return
- */
- public Map<Bean<?>, Bean<?>> getSpecializedBeans()
- {
- // TODO make this unmodifiable after deploy!
- return specializedBeans;
- }
-
- // Serialization
-
- protected Object readResolve()
- {
- return CurrentManager.get(id);
- }
-
- /**
- * Provides access to the executor service used for asynchronous tasks.
- *
- * @return the ExecutorService for this manager
- */
- public ExecutorService getTaskExecutor()
- {
- return taskExecutor;
- }
-
- public void shutdown()
- {
- log.trace("Ending application");
- shutdownExecutors();
- ApplicationContext.instance().destroy();
- ApplicationContext.instance().setActive(false);
- ApplicationContext.instance().setBeanStore(null);
- CurrentManager.cleanup();
- }
-
- /**
- * Shuts down any executor services in the manager.
- */
- protected void shutdownExecutors()
- {
- taskExecutor.shutdown();
- try
- {
- // Wait a while for existing tasks to terminate
- if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
- {
- taskExecutor.shutdownNow(); // Cancel currently executing tasks
- // Wait a while for tasks to respond to being cancelled
- if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
- {
- // Log the error here
- }
- }
- }
- catch (InterruptedException ie)
- {
- // (Re-)Cancel if current thread also interrupted
- taskExecutor.shutdownNow();
- // Preserve interrupt status
- Thread.currentThread().interrupt();
- }
- }
-
- protected ClientProxyProvider getClientProxyProvider()
- {
- return clientProxyProvider;
- }
-
- protected ConcurrentListMultiMap<Class<? extends Annotation>, Context> getContexts()
- {
- return contexts;
- }
-
- protected AtomicInteger getIds()
- {
- return ids;
- }
-
- protected Set<CurrentActivity> getCurrentActivities()
- {
- return currentActivities;
- }
-
- public Integer getId()
- {
- return id;
- }
-
- public ConcurrentSetMultiMap<Type, EventObserver<?>> getRegisteredObservers()
- {
- return registeredObservers;
- }
-
- public Namespace getRootNamespace()
- {
- return rootNamespace;
- }
-
-
- public <T> InjectionTarget<T> createInjectionTarget(Class<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> ManagedBean<T> createManagedBean(Class<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
-
-
- public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
- {
- Bean<?> key = bean;
- while (specializedBeans.containsKey(key))
- {
- if (key == null)
- {
- System.out.println("null key " + bean);
- }
- key = specializedBeans.get(key);
- }
- return (Bean<X>) key;
- }
-
-
- public void validate(InjectionPoint injectionPoint)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
-
- public Set<Annotation> getInterceptorBindingTypeDefinition(
- Class<? extends Annotation> bindingType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public Bean<?> getPassivationCapableBean(String id)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public Set<Annotation> getStereotypeDefinition(
- Class<? extends Annotation> stereotype)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isBindingType(Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isInterceptorBindingType(
- Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isScopeType(Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isStereotype(Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
- {
- if (beans.size() == 1)
- {
- return beans.iterator().next();
- }
- else if (beans.isEmpty())
- {
- return null;
- }
-
- // make a copy so that the sort is stable with respect to new deployment types added through the SPI
- // TODO This code needs to be in Resolver
- // TODO This needs caching
- final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
-
- SortedSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
- {
- public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
- {
- int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
- if (diff == 0)
- {
- throw new AmbiguousResolutionException();
- }
- return diff;
- }
- });
- sortedBeans.addAll(beans);
- return sortedBeans.last();
- }
-
- public ELResolver getELResolver()
- {
- return webbeansELResolver;
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -34,7 +34,7 @@
import javax.event.Event;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentInstancesStore;
import org.jboss.webbeans.conversation.ConversationImpl;
@@ -64,7 +64,7 @@
private static final Annotation ANY_BINDING = new AnyLiteral();
@SuppressWarnings("unchecked")
- private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, ManagerImpl.class, ConversationImpl.class));
+ private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, BeanManagerImpl.class, ConversationImpl.class));
private boolean proxyable;
@@ -114,7 +114,7 @@
// If the type a primitive?
private boolean primitive;
// The Web Beans manager
- protected ManagerImpl manager;
+ protected BeanManagerImpl manager;
protected boolean _serializable;
@@ -130,7 +130,7 @@
*
* @param manager The Web Beans manager
*/
- public AbstractBean(ManagerImpl manager)
+ public AbstractBean(BeanManagerImpl manager)
{
super(manager);
this.manager = manager;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -32,7 +32,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
@@ -74,7 +74,7 @@
* @param type The type
* @param manager The Web Beans manager
*/
- protected AbstractClassBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected AbstractClassBean(AnnotatedClass<T> type, BeanManagerImpl manager)
{
super(manager);
this.annotatedItem = type;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -38,7 +38,7 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.context.DependentContext;
@@ -72,7 +72,7 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- public AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public AbstractProducerBean(AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(manager);
this.declaringBean = declaringBean;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -33,7 +33,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
@@ -53,7 +53,7 @@
protected Set<AnnotatedInjectionPoint<?, ?>> disposalInjectionPoints;
private final String id;
- protected DisposalMethodBean(ManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
+ protected DisposalMethodBean(BeanManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
super(manager);
this.disposalMethodInjectionPoint = MethodInjectionPoint.of(this, disposalMethod);
@@ -79,7 +79,7 @@
return disposalMethodInjectionPoint;
}
- public static <T> DisposalMethodBean<T> of(ManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
+ public static <T> DisposalMethodBean<T> of(BeanManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
return new DisposalMethodBean<T>(manager, disposalMethod, declaringBean);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -34,7 +34,7 @@
import javax.inject.DefinitionException;
import javax.interceptor.Interceptor;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanInstance;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanProxyMethodHandler;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
@@ -76,7 +76,7 @@
* @param manager the current manager
* @return An Enterprise Web Bean
*/
- public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager, BeanDeployerEnvironment environment)
+ public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
return new EnterpriseBean<T>(clazz, manager, environment);
}
@@ -87,7 +87,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected EnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager, BeanDeployerEnvironment environment)
+ protected EnterpriseBean(AnnotatedClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
super(type, manager);
initType();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.deployment.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.literal.NewLiteral;
@@ -45,7 +45,7 @@
* @param manager The Web Beans manager
* @return a new NewEnterpriseBean instance
*/
- public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager, BeanDeployerEnvironment environment)
+ public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
return new NewEnterpriseBean<T>(clazz, manager, environment);
}
@@ -56,7 +56,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewEnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager, BeanDeployerEnvironment environment)
+ protected NewEnterpriseBean(AnnotatedClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
super(type, manager, environment);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.deployment.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.literal.NewLiteral;
@@ -44,7 +44,7 @@
* @param manager The Web Beans manager
* @return a new NewSimpleBean instance
*/
- public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
{
return new NewSimpleBean<T>(clazz, manager);
}
@@ -55,7 +55,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewSimpleBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected NewSimpleBean(AnnotatedClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -20,7 +20,7 @@
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.util.Names;
@@ -46,7 +46,7 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <T> ProducerFieldBean<T> of(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ProducerFieldBean<T> of(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
return new ProducerFieldBean<T>(field, declaringBean, manager);
}
@@ -58,7 +58,7 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- protected ProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ protected ProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(declaringBean, manager);
this.field = field;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
@@ -63,12 +63,12 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
return new ProducerMethodBean<T>(method, declaringBean, manager);
}
- protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(declaringBean, manager);
this.method = MethodInjectionPoint.of(this, method);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -39,9 +39,9 @@
private static final ConcurrentMap<String, AtomicInteger> ids = new ConcurrentHashMap<String, AtomicInteger>();
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- protected RIBean(ManagerImpl manager)
+ protected RIBean(BeanManagerImpl manager)
{
this.manager = manager;
// TODO better ID strategy (human readable)
@@ -53,7 +53,7 @@
return prefix + "-" + i;
}
- protected ManagerImpl getManager()
+ protected BeanManagerImpl getManager()
{
return manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.enterprise.inject.Initializer;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
@@ -84,7 +84,7 @@
* @param manager the current manager
* @return A Web Bean
*/
- public static <T> SimpleBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> SimpleBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
{
return new SimpleBean<T>(clazz, manager);
}
@@ -95,7 +95,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected SimpleBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected SimpleBean(AnnotatedClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
initType();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -31,7 +31,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.deployment.Production;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -66,7 +66,7 @@
* @param bindings the bindings of bean
* @param type the concrete type of the bean
*/
- protected AbstractJavaEEResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type)
+ protected AbstractJavaEEResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type)
{
this(manager, deploymentType, bindings, type, type);
}
@@ -77,7 +77,7 @@
* @param bindings the bindings of bean
* @param type the concrete type of the bean
*/
- protected AbstractJavaEEResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, Type... types)
+ protected AbstractJavaEEResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, Type... types)
{
super(manager);
if (deploymentType != null)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -20,7 +20,7 @@
import java.lang.reflect.Type;
import java.util.Set;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -31,7 +31,7 @@
private final String jndiName;
private final String mappedName;
- protected AbstractResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, Type... types)
+ protected AbstractResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, Type... types)
{
super(manager, deploymentType, bindings, type, types);
this.jndiName = jndiName;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import javax.persistence.EntityManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -35,7 +35,7 @@
private final String id;
private final String unitName;
- public PersistenceContextBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
+ public PersistenceContextBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
{
super(manager, deploymentType, bindings, EntityManager.class);
this.unitName = unitName;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import javax.persistence.EntityManagerFactory;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -35,7 +35,7 @@
private final String id;
private final String unitName;
- public PersistenceUnitBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
+ public PersistenceUnitBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
{
super(manager, deploymentType, bindings, EntityManagerFactory.class);
this.unitName = unitName;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -21,7 +21,7 @@
import javassist.util.proxy.MethodHandler;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -33,7 +33,7 @@
private final String id;
private final String ejbLink;
- public RemoteEjbBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String ejbLink)
+ public RemoteEjbBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String ejbLink)
{
super(manager, deploymentType, bindings, type, jndiName, mappedName, type);
this.ejbLink = ejbLink;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -21,7 +21,7 @@
import javassist.util.proxy.MethodHandler;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -32,7 +32,7 @@
private final String id;
- public ResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName)
+ public ResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName)
{
super(manager, deploymentType, bindings, type, jndiName, mappedName, type);
this.id = createId("Resource-");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -21,7 +21,7 @@
import javassist.util.proxy.MethodHandler;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -33,7 +33,7 @@
private final String id;
private final String wsdlLocation;
- public WebServiceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String wsdlLocation)
+ public WebServiceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String wsdlLocation)
{
super(manager, deploymentType, bindings, type, jndiName, mappedName, type);
this.wsdlLocation = wsdlLocation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.jms.QueueSender;
import javax.jms.QueueSession;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractResourceBean;
@@ -47,7 +47,7 @@
* @param bindings
* @param type
*/
- public JmsQueueBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
+ public JmsQueueBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
{
super(manager,
deploymentType,
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractResourceBean;
/**
@@ -46,7 +46,7 @@
* @param bindings
* @param type
*/
- public JmsTopicBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
+ public JmsTopicBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
{
super(manager,
deploymentType,
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -50,7 +50,7 @@
// The bean index in the manager
private final int beanIndex;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
private static final ThreadLocal<CreationalContextImpl<?>> currentCreationalContext = new ThreadLocal<CreationalContextImpl<?>>();
@@ -60,7 +60,7 @@
* @param bean The bean to proxy
* @param beanIndex The index to the bean in the manager bean list
*/
- public ClientProxyMethodHandler(Bean<?> bean, ManagerImpl manager, int beanIndex)
+ public ClientProxyMethodHandler(Bean<?> bean, BeanManagerImpl manager, int beanIndex)
{
this.bean = bean;
this.beanIndex = beanIndex;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.collections.ConcurrentCache;
@@ -70,7 +70,7 @@
* @throws InstantiationException When the proxy couldn't be created
* @throws IllegalAccessException When the proxy couldn't be created
*/
- private static <T> T createClientProxy(Bean<T> bean, ManagerImpl manager, int beanIndex) throws RuntimeException
+ private static <T> T createClientProxy(Bean<T> bean, BeanManagerImpl manager, int beanIndex) throws RuntimeException
{
try
@@ -106,7 +106,7 @@
* @param bean The bean to get a proxy to
* @return the client proxy for the bean
*/
- public <T> T getClientProxy(final ManagerImpl manager, final Bean<T> bean)
+ public <T> T getClientProxy(final BeanManagerImpl manager, final Bean<T> bean)
{
return pool.putIfAbsent(bean, new Callable<T>()
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -35,7 +35,7 @@
private static final Log log = Logging.getLog(AbstractFacadeBean.class);
- protected AbstractFacadeBean(ManagerImpl manager)
+ protected AbstractFacadeBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.deployment.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -40,7 +40,7 @@
private final String id;
- protected AbstractStandardBean(ManagerImpl manager)
+ protected AbstractStandardBean(BeanManagerImpl manager)
{
super(manager);
this.id = getClass().getSimpleName();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.event.Event;
import javax.inject.Obtains;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
import org.jboss.webbeans.literal.AnyLiteral;
@@ -42,12 +42,12 @@
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
- public static AbstractFacadeBean<Event<?>> of(ManagerImpl manager)
+ public static AbstractFacadeBean<Event<?>> of(BeanManagerImpl manager)
{
return new EventBean(manager);
}
- protected EventBean(ManagerImpl manager)
+ protected EventBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* Bean for InjectionPoint metadata
@@ -47,12 +47,12 @@
* @param manager The RI manager implementation
* @return a new bean for this injection point
*/
- public static InjectionPointBean of(ManagerImpl manager)
+ public static InjectionPointBean of(BeanManagerImpl manager)
{
return new InjectionPointBean(manager);
}
- protected InjectionPointBean(ManagerImpl manager)
+ protected InjectionPointBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.inject.Obtains;
import org.jboss.webbeans.InstanceImpl;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
import org.jboss.webbeans.literal.ObtainsLiteral;
@@ -42,12 +42,12 @@
public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(TYPE, OBTAINS);
- public static AbstractFacadeBean<Instance<?>> of(ManagerImpl manager)
+ public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
{
return new InstanceBean(manager);
}
- protected InstanceBean(ManagerImpl manager)
+ protected InstanceBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,32 +24,32 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.BeanManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
-public class ManagerBean extends AbstractStandardBean<ManagerImpl>
+public class ManagerBean extends AbstractStandardBean<BeanManagerImpl>
{
- private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(ManagerImpl.class, BeanManager.class));
+ private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(BeanManagerImpl.class, BeanManager.class));
- public static final ManagerBean of(ManagerImpl manager)
+ public static final ManagerBean of(BeanManagerImpl manager)
{
return new ManagerBean(manager);
}
- protected ManagerBean(ManagerImpl manager)
+ protected ManagerBean(BeanManagerImpl manager)
{
super(manager);
}
- public ManagerImpl create(CreationalContext<ManagerImpl> creationalContext)
+ public BeanManagerImpl create(CreationalContext<BeanManagerImpl> creationalContext)
{
return getManager().getCurrent();
}
@Override
- public Class<ManagerImpl> getType()
+ public Class<BeanManagerImpl> getType()
{
- return ManagerImpl.class;
+ return BeanManagerImpl.class;
}
public Set<Type> getTypes()
@@ -57,7 +57,7 @@
return TYPES;
}
- public void destroy(ManagerImpl instance, CreationalContext<ManagerImpl> creationalContext)
+ public void destroy(BeanManagerImpl instance, CreationalContext<BeanManagerImpl> creationalContext)
{
// No-op
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -30,7 +30,7 @@
import javax.event.Observes;
import javax.inject.Realizes;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.bean.DisposalMethodBean;
import org.jboss.webbeans.bean.EnterpriseBean;
@@ -64,11 +64,11 @@
private final BeanDeployerEnvironment environment;
private final Set<AnnotatedClass<?>> classes;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
private final ClassTransformer classTransformer;
- public BeanDeployer(ManagerImpl manager, EjbDescriptorCache ejbDescriptors)
+ public BeanDeployer(BeanManagerImpl manager, EjbDescriptorCache ejbDescriptors)
{
this.manager = manager;
this.environment = new BeanDeployerEnvironment(ejbDescriptors);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -22,7 +22,7 @@
import org.jboss.webbeans.BeanValidator;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractJavaEEResourceBean;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InjectionPointBean;
@@ -87,7 +87,7 @@
}
// The Web Beans manager
- private ManagerImpl manager;
+ private BeanManagerImpl manager;
public WebBeansBootstrap()
{
// initialize default services
@@ -124,7 +124,7 @@
}
addImplementationServices();
createContexts();
- this.manager = ManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
+ this.manager = BeanManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
CurrentManager.setRootManager(manager);
initializeContexts();
}
@@ -142,7 +142,7 @@
getServices().add(MetaDataCache.class, new MetaDataCache(getServices().get(ClassTransformer.class)));
}
- public ManagerImpl getManager()
+ public BeanManagerImpl getManager()
{
return manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.ExecutionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* An EL-resolver against the named beans
@@ -51,9 +51,9 @@
}
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public WebBeansELResolverImpl(ManagerImpl manager)
+ public WebBeansELResolverImpl(BeanManagerImpl manager)
{
this.manager = manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.event.Observer;
import org.jboss.webbeans.FacadeImpl;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.util.Strings;
@@ -41,7 +41,7 @@
private static final long serialVersionUID = 656782657242515455L;
- public static <E> Event<E> of(Type eventType, ManagerImpl manager, Set<Annotation> bindings)
+ public static <E> Event<E> of(Type eventType, BeanManagerImpl manager, Set<Annotation> bindings)
{
return new EventImpl<E>(eventType, manager, bindings);
}
@@ -54,7 +54,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- public EventImpl(Type eventType, ManagerImpl manager, Set<Annotation> bindings)
+ public EventImpl(Type eventType, BeanManagerImpl manager, Set<Annotation> bindings)
{
super(eventType, manager, removeBindings(bindings, new AnyLiteral()));
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.event.Observer;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -41,13 +41,13 @@
{
private static Log log = Logging.getLog(EventManager.class);
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
/**
* Initializes a new instance of the EventManager.
*/
- public EventManager(ManagerImpl manager)
+ public EventManager(BeanManagerImpl manager)
{
this.manager = manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.event.Observer;
import javax.inject.DuplicateBindingTypeException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
@@ -49,7 +49,7 @@
private final Type eventType;
private final List<Annotation> eventBindings;
private final Observer<T> observer;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
/**
* Constructs a new wrapper for an observer.
@@ -58,7 +58,7 @@
* @param eventType The class of event being observed
* @param eventBindings The array of annotation event bindings, if any
*/
- public EventObserver(final Observer<T> observer, final Type eventType, ManagerImpl manager, final Annotation... eventBindings)
+ public EventObserver(final Observer<T> observer, final Type eventType, BeanManagerImpl manager, final Annotation... eventBindings)
{
this.observer = observer;
this.eventType = eventType;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -16,7 +16,7 @@
*/
package org.jboss.webbeans.event;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -37,7 +37,7 @@
* @param manager The Web Beans manager
* @return An observer implementation built from the method abstraction
*/
- public static <T> ObserverImpl<T> create(AnnotatedMethod<?> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ObserverImpl<T> create(AnnotatedMethod<?> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
ObserverImpl<T> result = null;
if (manager.getServices().contains(TransactionServices.class) && TransactionalObserverImpl.isObserverMethodTransactional(method))
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -34,7 +34,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.context.DependentContext;
@@ -62,7 +62,7 @@
protected final MethodInjectionPoint<?> observerMethod;
private final boolean conditional;
private final boolean asynchronous;
- protected ManagerImpl manager;
+ protected BeanManagerImpl manager;
private final Type eventType;
private final Annotation[] bindings;
@@ -74,7 +74,7 @@
* @param observerBean The observer bean
* @param manager The Web Beans manager
*/
- protected ObserverImpl(final AnnotatedMethod<?> observer, final RIBean<?> observerBean, final ManagerImpl manager)
+ protected ObserverImpl(final AnnotatedMethod<?> observer, final RIBean<?> observerBean, final BeanManagerImpl manager)
{
this.manager = manager;
this.observerBean = observerBean;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.inject.DefinitionException;
import javax.transaction.Synchronization;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -72,7 +72,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverImpl(AnnotatedMethod<?> observer, RIBean<?> observerBean, ManagerImpl manager)
+ protected TransactionalObserverImpl(AnnotatedMethod<?> observer, RIBean<?> observerBean, BeanManagerImpl manager)
{
super(observer, observerBean, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -30,7 +30,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedConstructor;
@@ -96,7 +96,7 @@
return delegate().getBindings();
}
- public T newInstance(ManagerImpl manager, CreationalContext<?> creationalContext)
+ public T newInstance(BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
try
{
@@ -156,7 +156,7 @@
* @param manager The Web Beans manager
* @return The object array of looked up values
*/
- protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Object specialVal, Class<? extends Annotation> specialParam, ManagerImpl manager, CreationalContext<?> creationalContext)
+ protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Object specialVal, Class<? extends Annotation> specialParam, BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<ParameterInjectionPoint<?>> iterator = parameters.iterator();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.ForwardingAnnotatedField;
@@ -69,7 +69,7 @@
return delegate().getAnnotationStore().getBindings();
}
- public void inject(Object declaringInstance, ManagerImpl manager, CreationalContext<?> creationalContext)
+ public void inject(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
try
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -29,7 +29,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedMethod;
@@ -95,7 +95,7 @@
return delegate().getBindings();
}
- public T invoke(Object declaringInstance, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invoke(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -117,7 +117,7 @@
}
@SuppressWarnings("unchecked")
- public T invokeWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invokeWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -138,7 +138,7 @@
return null;
}
- public T invokeOnInstance(Object declaringInstance, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invokeOnInstance(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -168,7 +168,7 @@
}
@SuppressWarnings("unchecked")
- public T invokeOnInstanceWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invokeOnInstanceWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -247,7 +247,7 @@
* @param manager The Web Beans manager
* @return The object array of looked up values
*/
- protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Class<? extends Annotation> specialParam, Object specialVal, ManagerImpl manager, CreationalContext<?> creationalContext)
+ protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Class<? extends Annotation> specialParam, Object specialVal, BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<ParameterInjectionPoint<?>> iterator = parameters.iterator();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -28,7 +28,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.resources.ClassTransformer;
@@ -41,9 +41,9 @@
private final Bean<?> nonContextualBean;
private final ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>> instances;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public NonContextualInjector(ManagerImpl manager)
+ public NonContextualInjector(BeanManagerImpl manager)
{
this.instances = new ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>>();
this.manager = manager;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedParameter;
@@ -78,7 +78,7 @@
}
@SuppressWarnings("unchecked")
- public T getValueToInject(ManagerImpl manager, CreationalContext<?> creationalContext)
+ public T getValueToInject(BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
return (T) manager.getInjectableReference(this, creationalContext);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -29,7 +29,7 @@
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InstanceBean;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -56,14 +56,14 @@
// The resolved names
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
// The Web Beans manager
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
private final Set<AnnotatedItemTransformer> transformers;
/**
* Constructor
*
*/
- public Resolver(ManagerImpl manager)
+ public Resolver(BeanManagerImpl manager)
{
this.manager = manager;
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
@@ -183,7 +183,7 @@
* @throws InstantiationException
* @throws IllegalArgumentException
*
- * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)
+ * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(BeanManagerImpl)
*/
public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -22,7 +22,7 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* Meta model for the merged stereotype for a bean
@@ -42,14 +42,14 @@
// The supported scopes
private final Set<Class<? extends Annotation>> supportedScopes;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
/**
* Constructor
*
* @param stereotypeAnnotations The stereotypes to merge
*/
- public MergedStereotypes(Set<Annotation> stereotypeAnnotations, ManagerImpl manager)
+ public MergedStereotypes(Set<Annotation> stereotypeAnnotations, BeanManagerImpl manager)
{
this.possibleDeploymentTypes = new HashMap<Class<? extends Annotation>, Annotation>();
this.possibleScopeTypes = new HashSet<Annotation>();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.injection.FieldInjectionPoint;
@@ -47,7 +47,7 @@
* @param bean The bean to inspect
* @return True if passivating, false otherwise
*/
- public static boolean isPassivatingBean(Bean<?> bean, ManagerImpl manager)
+ public static boolean isPassivatingBean(Bean<?> bean, BeanManagerImpl manager)
{
if (bean instanceof EnterpriseBean)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import java.util.List;
import java.util.Set;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractJavaEEResourceBean;
import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
@@ -43,14 +43,14 @@
private final Iterable<URL> beansXmlUrls;
private final EjbDescriptorCache ejbDescriptors;
private final Set<AbstractJavaEEResourceBean<?>> resourceBeans;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public XmlEnvironment(ServiceRegistry serviceRegistry, EjbDescriptorCache ejbDescriptors, ManagerImpl manager)
+ public XmlEnvironment(ServiceRegistry serviceRegistry, EjbDescriptorCache ejbDescriptors, BeanManagerImpl manager)
{
this(serviceRegistry, serviceRegistry.get(WebBeanDiscovery.class).discoverWebBeansXml(), ejbDescriptors, manager);
}
- protected XmlEnvironment(ServiceRegistry serviceRegistry, Iterable<URL> beanXmlUrls, EjbDescriptorCache ejbDescriptors, ManagerImpl manager)
+ protected XmlEnvironment(ServiceRegistry serviceRegistry, Iterable<URL> beanXmlUrls, EjbDescriptorCache ejbDescriptors, BeanManagerImpl manager)
{
this.classes = new ArrayList<AnnotatedClass<?>>();
this.annotations = new ArrayList<AnnotatedAnnotation<?>>();
@@ -116,7 +116,7 @@
return resourceBeans;
}
- public ManagerImpl getManager()
+ public BeanManagerImpl getManager()
{
return manager;
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -18,7 +18,7 @@
import org.jboss.testharness.AbstractTest;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.mock.el.EL;
import org.jboss.webbeans.util.EnumerationIterable;
@@ -62,7 +62,7 @@
protected static final int BUILT_IN_BEANS = 3;
- private ManagerImpl manager;
+ private BeanManagerImpl manager;
public static boolean visited = false;
@@ -136,7 +136,7 @@
return in.readObject();
}
- protected ManagerImpl getCurrentManager()
+ protected BeanManagerImpl getCurrentManager()
{
return manager;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -9,7 +9,7 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.mock.MockServletLifecycle;
@@ -22,7 +22,7 @@
{
private MockServletLifecycle lifecycle;
- private ManagerImpl manager;
+ private BeanManagerImpl manager;
@BeforeClass
public void beforeClass() throws Throwable
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -6,7 +6,7 @@
import javax.event.Observes;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -42,7 +42,7 @@
@Test
public void testEventUsingManager()
{
- ManagerImpl manager = getCurrentManager();
+ BeanManagerImpl manager = getCurrentManager();
manager.fireEvent("Fired using Manager Interface with AnnotationLiteral.",
new AnnotationLiteral<Updated>(){});
@@ -61,7 +61,7 @@
@Test
public void testEventUsingEvent()
{
- ManagerImpl manager = getCurrentManager();
+ BeanManagerImpl manager = getCurrentManager();
App app = manager.getInstanceByType(App.class);
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -14,7 +14,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@@ -100,7 +100,7 @@
public void testRootManagerSerializability() throws Exception
{
Integer rootManagerId = getCurrentManager().getId();
- ManagerImpl deserializedRootManager = (ManagerImpl) deserialize(serialize(getCurrentManager()));
+ BeanManagerImpl deserializedRootManager = (BeanManagerImpl) deserialize(serialize(getCurrentManager()));
assert deserializedRootManager.getId().equals(rootManagerId);
assert getCurrentManager().getBeans(Foo.class).size() == 1;
assert deserializedRootManager.getBeans(Foo.class).size() == 1;
@@ -110,11 +110,11 @@
@Test
public void testChildManagerSerializability() throws Exception
{
- ManagerImpl childManager = getCurrentManager().createActivity();
+ BeanManagerImpl childManager = getCurrentManager().createActivity();
Bean<?> dummyBean = new DummyBean();
childManager.addBean(dummyBean);
Integer childManagerId = childManager.getId();
- ManagerImpl deserializedChildManager = (ManagerImpl) deserialize(serialize(childManager));
+ BeanManagerImpl deserializedChildManager = (BeanManagerImpl) deserialize(serialize(childManager));
assert deserializedChildManager.getId().equals(childManagerId);
assert childManager.getBeans(Dummy.class).size() == 1;
assert deserializedChildManager.getBeans(Dummy.class).size() == 1;
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -12,7 +12,7 @@
import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -64,7 +64,7 @@
XmlParser parser = new XmlParser(parserEnv);
parser.parse();
- ManagerImpl manager = parserEnv.getManager();
+ BeanManagerImpl manager = parserEnv.getManager();
Set<Bean<?>> beansSet = manager.getBeans(Order.class);
List<Class<? extends Annotation>> dTypes = manager.getEnabledDeploymentTypes();
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2797 - ri/trunk/impl/src/main/java/org/jboss/webbeans.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-09 10:47:32 -0400 (Tue, 09 Jun 2009)
New Revision: 2797
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
Log:
remove broken impls
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-09 14:27:57 UTC (rev 2796)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans;
-import java.io.InputStream;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
@@ -50,14 +49,12 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.Stereotype;
import javax.enterprise.inject.UnproxyableResolutionException;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
@@ -68,7 +65,6 @@
import javax.event.Observer;
import javax.inject.DeploymentException;
import javax.inject.DuplicateBindingTypeException;
-import javax.interceptor.InterceptorBindingType;
import org.jboss.webbeans.bean.DisposalMethodBean;
import org.jboss.webbeans.bean.EnterpriseBean;
@@ -91,7 +87,6 @@
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.metadata.MetaDataCache;
-import org.jboss.webbeans.metadata.StereotypeModel;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
@@ -781,6 +776,8 @@
* @param bindings The binding types to match
* @return An instance of the bean
*
+ * @deprecated replace with non-contextual injection
+ *
*/
@Deprecated
public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
@@ -872,11 +869,6 @@
return buffer.toString();
}
- public BeanManager parse(InputStream xmlStream)
- {
- throw new UnsupportedOperationException();
- }
-
public ManagerImpl createActivity()
{
ManagerImpl childActivity = newChildManager(this);
@@ -1079,61 +1071,51 @@
public void validate(InjectionPoint injectionPoint)
{
- throw new RuntimeException("Not yet implemented");
+ throw new UnsupportedOperationException("Not yet implemented");
}
public Set<Annotation> getInterceptorBindingTypeDefinition(
Class<? extends Annotation> bindingType)
{
- throw new RuntimeException("Not yet implemented");
+ throw new UnsupportedOperationException("Not yet implemented");
}
public Bean<?> getPassivationCapableBean(String id)
{
- throw new RuntimeException("Not yet implemented");
+ throw new UnsupportedOperationException("Not yet implemented");
}
public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType)
{
- return scopeType.getAnnotation(ScopeType.class);
+ throw new UnsupportedOperationException("Not yet implemented");
}
public Set<Annotation> getStereotypeDefinition(
Class<? extends Annotation> stereotype)
{
- StereotypeModel<? extends Annotation> model =
- getServices().get(MetaDataCache.class).getStereotype(stereotype);
- Set<Annotation> results = new HashSet<Annotation>();
- if (model.getDefaultDeploymentType() != null)
- results.add(model.getDefaultDeploymentType());
- if (model.getDefaultScopeType() != null)
- results.add(model.getDefaultScopeType());
- if (model.getInterceptorBindings() != null)
- results.addAll(model.getInterceptorBindings());
-
- return results;
+ throw new UnsupportedOperationException("Not yet implemented");
}
public boolean isBindingType(Class<? extends Annotation> annotationType)
{
- return annotationType.isAnnotationPresent(BindingType.class);
+ throw new UnsupportedOperationException("Not yet implemented");
}
public boolean isInterceptorBindingType(
Class<? extends Annotation> annotationType)
{
- return annotationType.isAnnotationPresent(InterceptorBindingType.class);
+ throw new UnsupportedOperationException("Not yet implemented");
}
public boolean isScopeType(Class<? extends Annotation> annotationType)
{
- return annotationType.isAnnotationPresent(ScopeType.class);
+ throw new UnsupportedOperationException("Not yet implemented");
}
public boolean isStereotype(Class<? extends Annotation> annotationType)
{
- return annotationType.isAnnotationPresent(Stereotype.class);
+ throw new UnsupportedOperationException("Not yet implemented");
}
public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
15 years, 6 months