[webbeans-commits] Webbeans SVN: r3530 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 13:08:30 -0400 (Sun, 16 Aug 2009)
New Revision: 3530
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorFactoryBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/PrincipalBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBeanLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBeanLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
tck/trunk/impl/pom.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
Log:
Add in support for Principal, Validator, ValidatorFactory (not yet supported in JBoss AS)
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,71 @@
+/*
+ * 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.bean.builtin;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.validation.Validator;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.util.collections.Arrays2;
+import org.jboss.webbeans.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class DefaultValidatorBean extends AbstractBuiltInBean<Validator>
+{
+
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet(Object.class, Validator.class);
+
+ public DefaultValidatorBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Class<Validator> getType()
+ {
+ return Validator.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return TYPES;
+ }
+
+ public Validator create(CreationalContext<Validator> creationalContext)
+ {
+ if (getManager().getServices().contains(ValidationServices.class))
+ {
+ return getManager().getServices().get(ValidationServices.class).getDefaultValidatorFactory().getValidator();
+ }
+ else
+ {
+ throw new IllegalStateException("ValidationServices not available");
+ }
+ }
+
+ public void destroy(Validator instance, CreationalContext<Validator> creationalContext)
+ {
+ // No-op
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorFactoryBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorFactoryBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorFactoryBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,71 @@
+/*
+ * 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.bean.builtin;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.util.collections.Arrays2;
+import org.jboss.webbeans.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class DefaultValidatorFactoryBean extends AbstractBuiltInBean<ValidatorFactory>
+{
+
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet(Object.class, ValidatorFactory.class);
+
+ public DefaultValidatorFactoryBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Class<ValidatorFactory> getType()
+ {
+ return ValidatorFactory.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return TYPES;
+ }
+
+ public ValidatorFactory create(CreationalContext<ValidatorFactory> creationalContext)
+ {
+ if (getManager().getServices().contains(ValidationServices.class))
+ {
+ return getManager().getServices().get(ValidationServices.class).getDefaultValidatorFactory();
+ }
+ else
+ {
+ throw new IllegalStateException("ValidationServices not available");
+ }
+ }
+
+ public void destroy(ValidatorFactory instance, CreationalContext<ValidatorFactory> creationalContext)
+ {
+ // No-op
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/DefaultValidatorFactoryBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/PrincipalBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/PrincipalBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/PrincipalBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,71 @@
+/*
+ * 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.bean.builtin;
+
+import java.lang.reflect.Type;
+import java.security.Principal;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.security.spi.SecurityServices;
+import org.jboss.webbeans.util.collections.Arrays2;
+
+/**
+ * @author pmuir
+ *
+ */
+public class PrincipalBean extends AbstractBuiltInBean<Principal>
+{
+
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet(Object.class, Principal.class);
+
+ public PrincipalBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Class<Principal> getType()
+ {
+ return Principal.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return TYPES;
+ }
+
+ public Principal create(CreationalContext<Principal> creationalContext)
+ {
+ if (getManager().getServices().contains(SecurityServices.class))
+ {
+ return getManager().getServices().get(SecurityServices.class).getPrincipal();
+ }
+ else
+ {
+ throw new IllegalStateException("SecurityServices not available");
+ }
+ }
+
+ public void destroy(Principal instance, CreationalContext<Principal> creationalContext)
+ {
+ // No-op
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/PrincipalBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -53,7 +53,14 @@
public UserTransaction create(CreationalContext<UserTransaction> creationalContext)
{
- return getManager().getServices().get(TransactionServices.class).getUserTransaction();
+ if (getManager().getServices().contains(TransactionServices.class))
+ {
+ return getManager().getServices().get(TransactionServices.class).getUserTransaction();
+ }
+ else
+ {
+ throw new IllegalStateException("TransactionServices not available");
+ }
}
public void destroy(UserTransaction instance, CreationalContext<UserTransaction> creationalContext)
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-08-16 17:06:31 UTC (rev 3529)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -29,8 +29,11 @@
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.DeploymentException;
import org.jboss.webbeans.Validator;
+import org.jboss.webbeans.bean.builtin.DefaultValidatorBean;
+import org.jboss.webbeans.bean.builtin.DefaultValidatorFactoryBean;
import org.jboss.webbeans.bean.builtin.InjectionPointBean;
import org.jboss.webbeans.bean.builtin.ManagerBean;
+import org.jboss.webbeans.bean.builtin.PrincipalBean;
import org.jboss.webbeans.bean.builtin.UserTransactionBean;
import org.jboss.webbeans.bean.builtin.facade.EventBean;
import org.jboss.webbeans.bean.builtin.facade.InstanceBean;
@@ -67,10 +70,12 @@
import org.jboss.webbeans.resources.DefaultResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
import org.jboss.webbeans.servlet.HttpSessionManager;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.transaction.spi.TransactionServices;
import org.jboss.webbeans.util.serviceProvider.ServiceLoader;
+import org.jboss.webbeans.validation.spi.ValidationServices;
import org.jboss.webbeans.xml.BeansXmlParser;
/**
@@ -280,6 +285,15 @@
{
beanDeployer.getEnvironment().addBean(new UserTransactionBean(manager));
}
+ if (getServices().contains(SecurityServices.class))
+ {
+ beanDeployer.getEnvironment().addBean(new PrincipalBean(manager));
+ }
+ if (getServices().contains(ValidationServices.class))
+ {
+ beanDeployer.getEnvironment().addBean(new DefaultValidatorBean(manager));
+ beanDeployer.getEnvironment().addBean(new DefaultValidatorFactoryBean(manager));
+ }
beanDeployer.createBeans().deploy();
fireAfterBeanDiscoveryEvent();
log.debug("Web Beans initialized. Validating beans.");
Modified: tck/trunk/impl/pom.xml
===================================================================
--- tck/trunk/impl/pom.xml 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/pom.xml 2009-08-16 17:08:30 UTC (rev 3530)
@@ -49,6 +49,11 @@
</dependency>
<dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.test-audit</groupId>
<artifactId>jboss-test-audit-api</artifactId>
</dependency>
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -1,7 +1,11 @@
package org.jboss.jsr299.tck.tests.implementation.builtin;
+import java.security.Principal;
+
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
@@ -32,10 +36,46 @@
})
public void testUserTransactionBean() throws SystemException
{
- UserTransaction userTransaction = getInstanceByType(InjectedBeanLocal.class).getUserTransaction();
+ UserTransaction userTransaction = getInstanceByType(UserTransactionInjectedBeanLocal.class).getUserTransaction();
assert userTransaction != null;
// Check that the UserTransaction is at least queryable
userTransaction.getStatus();
}
+ @Test(groups="jboss-as-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="3.6", id="c")
+ })
+ public void testDefaultValidatorFactoryBean() throws SystemException
+ {
+ ValidatorFactory defaultValidatorFactory = getInstanceByType(DefaultValidatorFactoryInjectedBeanLocal.class).getDefaultValidatorFactory();
+ assert defaultValidatorFactory != null;
+ // Check that the ValidatorFactory is at least queryable
+ defaultValidatorFactory.getValidator();
+ }
+
+ @Test(groups="jboss-as-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="3.6", id="d")
+ })
+ public void testDefaultValidatorBean() throws SystemException
+ {
+ Validator defaultValidator = getInstanceByType(DefaultValidatorInjectedBeanLocal.class).getDefaultValidator();
+ assert defaultValidator != null;
+ // Check that the ValidatorFactory is at least queryable
+ defaultValidator.getConstraintsForClass(BuiltInBeansTest.class);
+ }
+
+ @Test(groups="jboss-as-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="3.6", id="c")
+ })
+ public void testPrincipalBean() throws SystemException
+ {
+ Principal principal = getInstanceByType(PrincipalInjectedBeanLocal.class).getPrincipal();
+ assert principal != null;
+ // Check that the Principal is at least queryable
+ principal.getName();
+ }
+
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,38 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Current;
+import javax.validation.ValidatorFactory;
+
+/**
+ * @author pmuir
+ *
+ */
+@Stateful
+public class DefaultValidatorFactoryInjectedBean implements DefaultValidatorFactoryInjectedBeanLocal
+{
+
+ @Current transient ValidatorFactory defaultValidatorFactory;
+
+ public ValidatorFactory getDefaultValidatorFactory()
+ {
+ return defaultValidatorFactory;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBeanLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBeanLocal.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,32 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Local;
+import javax.validation.ValidatorFactory;
+
+/**
+ * @author pmuir
+ *
+ */
+@Local
+public interface DefaultValidatorFactoryInjectedBeanLocal
+{
+
+ public ValidatorFactory getDefaultValidatorFactory();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,38 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Current;
+import javax.validation.Validator;
+
+/**
+ * @author pmuir
+ *
+ */
+@Stateful
+public class DefaultValidatorInjectedBean implements DefaultValidatorInjectedBeanLocal
+{
+
+ @Current transient Validator defaultValidator;
+
+ public Validator getDefaultValidator()
+ {
+ return defaultValidator;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBeanLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBeanLocal.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,32 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Local;
+import javax.validation.Validator;
+
+/**
+ * @author pmuir
+ *
+ */
+@Local
+public interface DefaultValidatorInjectedBeanLocal
+{
+
+ public Validator getDefaultValidator();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -1,38 +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.implementation.builtin;
-
-import javax.ejb.Stateful;
-import javax.enterprise.inject.Current;
-import javax.transaction.UserTransaction;
-
-/**
- * @author pmuir
- *
- */
-@Stateful
-public class InjectedBean implements InjectedBeanLocal
-{
-
- @Current transient UserTransaction userTransaction;
-
- public UserTransaction getUserTransaction()
- {
- return userTransaction;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -1,30 +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.implementation.builtin;
-
-import javax.transaction.UserTransaction;
-
-/**
- * @author pmuir
- *
- */
-public interface InjectedBeanLocal
-{
-
- public UserTransaction getUserTransaction();
-
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,40 @@
+/*
+ * 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.implementation.builtin;
+
+import java.security.Principal;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Current;
+
+/**
+ * @author pmuir
+ *
+ */
+@Stateful
+public class PrincipalInjectedBean implements PrincipalInjectedBeanLocal
+{
+
+ @Current transient Principal principal;
+
+ @Override
+ public Principal getPrincipal()
+ {
+ return principal;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,33 @@
+/*
+ * 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.implementation.builtin;
+
+import java.security.Principal;
+
+import javax.ejb.Local;
+
+/**
+ * @author pmuir
+ *
+ */
+@Local
+public interface PrincipalInjectedBeanLocal
+{
+
+ public Principal getPrincipal();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBean.java (from rev 3528, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBean.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,38 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Current;
+import javax.transaction.UserTransaction;
+
+/**
+ * @author pmuir
+ *
+ */
+@Stateful
+public class UserTransactionInjectedBean implements UserTransactionInjectedBeanLocal
+{
+
+ @Current transient UserTransaction userTransaction;
+
+ public UserTransaction getUserTransaction()
+ {
+ return userTransaction;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java (from rev 3528, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,32 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Local;
+import javax.transaction.UserTransaction;
+
+/**
+ * @author pmuir
+ *
+ */
+@Local
+public interface UserTransactionInjectedBeanLocal
+{
+
+ public UserTransaction getUserTransaction();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -1,10 +1,10 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.broken.singletonWithRequestScope;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -17,7 +17,7 @@
@SpecVersion("20090625")
public class SingletonWithRequestScopeTest extends AbstractJSR299Test
{
- @Test(groups = { "incontainer-broken" })
+ @Test(groups = { "jboss-as-broken" })
@SpecAssertion(section = "3.2", id = "da")
public void testSingletonWithRequestScopeFails()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -1,10 +1,10 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.broken.singletonWithSessionScope;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -17,7 +17,7 @@
@SpecVersion("20090625")
public class SingletonWithSessionScopeTest extends AbstractJSR299Test
{
- @Test(groups = { "incontainer-broken" })
+ @Test(groups = { "jboss-as-broken" })
@SpecAssertion(section = "3.2", id = "da")
public void testSingletonWithSessionScopeFails()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -0,0 +1,36 @@
+/*
+ * 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.lookup.manager.jndi;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * @author pmuir
+ *
+ */
+public class JndiBeanManagerInjected
+{
+
+ public BeanManager getManagerFromJndi() throws NamingException
+ {
+ InitialContext ctx = new InitialContext();
+ return (BeanManager) ctx.lookup("java:comp/BeanManager");
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-08-16 17:06:31 UTC (rev 3529)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-08-16 17:08:30 UTC (rev 3530)
@@ -1,7 +1,6 @@
package org.jboss.jsr299.tck.tests.lookup.manager.jndi;
import javax.enterprise.inject.spi.BeanManager;
-import javax.naming.InitialContext;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
@@ -15,13 +14,12 @@
@SpecVersion("20090625")
public class ManagerTest extends AbstractJSR299Test
{
- @Test(groups = { "manager", "ejb3", "integration", "rewrite", "jboss-as-broken" })
- //TODO This test needs to use an EJB component that looks up the JNDI manager (java:comp)
+ @Test(groups = { "manager", "ejb3", "integration", "jboss-as-broken" })
@SpecAssertion(section = "11.3", id = "da")
public void testManagerLookupInJndi() throws Exception
{
- InitialContext ctx = new InitialContext();
- BeanManager beanManager = (BeanManager) ctx.lookup("java:comp/BeanManager");
+ BeanManager beanManager = getInstanceByType(JndiBeanManagerInjected.class).getManagerFromJndi();
assert beanManager != null;
+ assert beanManager.equals(getCurrentManager());
}
}
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3529 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-16 13:06:31 -0400 (Sun, 16 Aug 2009)
New Revision: 3529
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionSynchronizedRunnable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
Log:
Fixed bug in RI for transactional observers and re-enabled a few of the tests.
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionSynchronizedRunnable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionSynchronizedRunnable.java 2009-08-16 16:17:19 UTC (rev 3528)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionSynchronizedRunnable.java 2009-08-16 17:06:31 UTC (rev 3529)
@@ -50,15 +50,17 @@
}
/*
- * (non-Javadoc)
- *
- * @see javax.transaction.Synchronization#afterCompletion(int)
- */
+ * (non-Javadoc)
+ * @see javax.transaction.Synchronization#afterCompletion(int)
+ */
public void afterCompletion(int status)
{
- if ((desiredStatus == Status.SUCCESS && status == STATUS_COMMITTED) || (desiredStatus == Status.FAILURE && status != STATUS_COMMITTED) || (desiredStatus == Status.ALL))
+ if (!before)
{
- task.run();
+ if ((desiredStatus == Status.SUCCESS && status == STATUS_COMMITTED) || (desiredStatus == Status.FAILURE && status != STATUS_COMMITTED) || (desiredStatus == Status.ALL))
+ {
+ task.run();
+ }
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-08-16 16:17:19 UTC (rev 3528)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-08-16 17:06:31 UTC (rev 3529)
@@ -32,6 +32,10 @@
jsr299Manager.fireEvent(event);
userTransaction.commit();
}
+ catch (EJBException ejbException)
+ {
+ throw ejbException;
+ }
catch (Exception e)
{
throw new EJBException("Transaction failure", e);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-08-16 16:17:19 UTC (rev 3528)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-08-16 17:06:31 UTC (rev 3529)
@@ -85,7 +85,7 @@
// assert dog.isCorrectContext();
}
- @Test(groups = { "events", "integration", "broken" })
+ @Test(groups = { "events", "integration" })
@SpecAssertion(section = "10.4.5", id = "c")
public void testAfterTransactionCompletionObserver() throws InterruptedException
{
@@ -98,7 +98,7 @@
assert dog.isCorrectTransactionState();
}
- @Test(groups = { "events", "integration", "broken" })
+ @Test(groups = { "events", "integration" })
@SpecAssertion(section = "10.4.5", id = "d")
public void testAfterTransactionSuccessObserver() throws InterruptedException
{
@@ -123,7 +123,7 @@
assert dog.isCorrectTransactionState();
}
- @Test(groups = { "events", "integration", "broken" })
+ @Test(groups = { "events", "integration" })
@SpecAssertions( {
@SpecAssertion(section = "10.4.5", id = "b"),
@SpecAssertion(section = "10.4.5", id = "e") })
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3528 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 12:17:19 -0400 (Sun, 16 Aug 2009)
New Revision: 3528
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
Add UT test and impl
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java 2009-08-16 16:17:19 UTC (rev 3528)
@@ -0,0 +1,64 @@
+/*
+ * 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.bean.builtin;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.transaction.UserTransaction;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.util.collections.Arrays2;
+
+/**
+ * @author pmuir
+ *
+ */
+public class UserTransactionBean extends AbstractBuiltInBean<UserTransaction>
+{
+
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet(Object.class, UserTransaction.class);
+
+ public UserTransactionBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Class<UserTransaction> getType()
+ {
+ return UserTransaction.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return TYPES;
+ }
+
+ public UserTransaction create(CreationalContext<UserTransaction> creationalContext)
+ {
+ return getManager().getServices().get(TransactionServices.class).getUserTransaction();
+ }
+
+ public void destroy(UserTransaction instance, CreationalContext<UserTransaction> creationalContext)
+ {
+ // No-op
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/UserTransactionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java 2009-08-16 16:16:39 UTC (rev 3527)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java 2009-08-16 16:17:19 UTC (rev 3528)
@@ -50,7 +50,7 @@
@SuppressWarnings("unchecked")
WBClass<Extension> clazz = (WBClass<Extension>) classTransformer.loadClass(extension.getClass());
- ExtensionBean bean = ExtensionBean.of(getManager(), clazz, extension);
+ ExtensionBean bean = new ExtensionBean(getManager(), clazz, extension);
getEnvironment().addBean(bean);
createObserverMethods(bean, clazz);
}
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-08-16 16:16:39 UTC (rev 3527)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-08-16 16:17:19 UTC (rev 3528)
@@ -31,6 +31,7 @@
import org.jboss.webbeans.Validator;
import org.jboss.webbeans.bean.builtin.InjectionPointBean;
import org.jboss.webbeans.bean.builtin.ManagerBean;
+import org.jboss.webbeans.bean.builtin.UserTransactionBean;
import org.jboss.webbeans.bean.builtin.facade.EventBean;
import org.jboss.webbeans.bean.builtin.facade.InstanceBean;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
@@ -171,7 +172,7 @@
verify();
if (!getServices().contains(TransactionServices.class))
{
- log.info("Transactional services not available. Transactional observers will be invoked synchronously.");
+ log.info("Transactional services not available. Injection of @Current UserTransaction not available. Transactional observers will be invoked synchronously.");
}
if (!getServices().contains(EjbServices.class))
{
@@ -263,10 +264,10 @@
synchronized (this)
{
beanDeployer.addClasses(deploymentVisitor.getBeanClasses());
- beanDeployer.getEnvironment().addBean(ManagerBean.of(manager));
- beanDeployer.getEnvironment().addBean(InjectionPointBean.of(manager));
- beanDeployer.getEnvironment().addBean(EventBean.of(manager));
- beanDeployer.getEnvironment().addBean(InstanceBean.of(manager));
+ beanDeployer.getEnvironment().addBean(new ManagerBean(manager));
+ beanDeployer.getEnvironment().addBean(new InjectionPointBean(manager));
+ beanDeployer.getEnvironment().addBean(new EventBean(manager));
+ beanDeployer.getEnvironment().addBean(new InstanceBean(manager));
if (!getEnvironment().equals(Environments.SE))
{
beanDeployer.addClass(ConversationImpl.class);
@@ -275,6 +276,10 @@
beanDeployer.addClass(NumericConversationIdGenerator.class);
beanDeployer.addClass(HttpSessionManager.class);
}
+ if (getServices().contains(TransactionServices.class))
+ {
+ beanDeployer.getEnvironment().addBean(new UserTransactionBean(manager));
+ }
beanDeployer.createBeans().deploy();
fireAfterBeanDiscoveryEvent();
log.debug("Web Beans initialized. Validating beans.");
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java 2009-08-16 16:17:19 UTC (rev 3528)
@@ -0,0 +1,41 @@
+package org.jboss.jsr299.tck.tests.implementation.builtin;
+
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ * Section 3.6
+ *
+ * @author Pete Muir
+ *
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@IntegrationTest
+@SpecVersion("20090625")
+public class BuiltInBeansTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="3.6", id="a")
+ })
+ public void testUserTransactionBean() throws SystemException
+ {
+ UserTransaction userTransaction = getInstanceByType(InjectedBeanLocal.class).getUserTransaction();
+ assert userTransaction != null;
+ // Check that the UserTransaction is at least queryable
+ userTransaction.getStatus();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/BuiltInBeansTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java 2009-08-16 16:17:19 UTC (rev 3528)
@@ -0,0 +1,38 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.ejb.Stateful;
+import javax.enterprise.inject.Current;
+import javax.transaction.UserTransaction;
+
+/**
+ * @author pmuir
+ *
+ */
+@Stateful
+public class InjectedBean implements InjectedBeanLocal
+{
+
+ @Current transient UserTransaction userTransaction;
+
+ public UserTransaction getUserTransaction()
+ {
+ return userTransaction;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java 2009-08-16 16:17:19 UTC (rev 3528)
@@ -0,0 +1,30 @@
+/*
+ * 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.implementation.builtin;
+
+import javax.transaction.UserTransaction;
+
+/**
+ * @author pmuir
+ *
+ */
+public interface InjectedBeanLocal
+{
+
+ public UserTransaction getUserTransaction();
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/builtin/InjectedBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3527 - in ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin: facade and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 12:16:39 -0400 (Sun, 16 Aug 2009)
New Revision: 3527
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java
Log:
Use util method to avoid warnings
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java 2009-08-16 16:15:56 UTC (rev 3526)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java 2009-08-16 16:16:39 UTC (rev 3527)
@@ -37,13 +37,8 @@
private final WBClass<Extension> clazz;
private final Extension instance;
- public static ExtensionBean of(BeanManagerImpl manager, WBClass<Extension> clazz, Extension instance)
+ public ExtensionBean(BeanManagerImpl manager, WBClass<Extension> clazz, Extension instance)
{
- return new ExtensionBean(manager, clazz, instance);
- }
-
- protected ExtensionBean(BeanManagerImpl manager, WBClass<Extension> clazz, Extension instance)
- {
super(manager);
this.clazz = clazz;
this.instance = instance;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java 2009-08-16 16:15:56 UTC (rev 3526)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java 2009-08-16 16:16:39 UTC (rev 3527)
@@ -17,14 +17,13 @@
package org.jboss.webbeans.bean.builtin;
import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.util.collections.Arrays2;
/**
* Bean for InjectionPoint metadata
@@ -35,7 +34,7 @@
public class InjectionPointBean extends AbstractBuiltInBean<InjectionPoint>
{
- private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(new Type[] { InjectionPoint.class }));
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet(InjectionPoint.class, Object.class);
/**
* Creates an InjectionPoint Web Bean for the injection of the containing bean owning
@@ -45,15 +44,9 @@
* @param <S>
* @param field The annotated member field/parameter for the injection
* @param manager The RI manager implementation
- * @return a new bean for this injection point
*/
- public static InjectionPointBean of(BeanManagerImpl manager)
+ public InjectionPointBean(BeanManagerImpl manager)
{
- return new InjectionPointBean(manager);
- }
-
- protected InjectionPointBean(BeanManagerImpl manager)
- {
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java 2009-08-16 16:15:56 UTC (rev 3526)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java 2009-08-16 16:16:39 UTC (rev 3527)
@@ -17,27 +17,21 @@
package org.jboss.webbeans.bean.builtin;
import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.util.collections.Arrays2;
public class ManagerBean extends AbstractBuiltInBean<BeanManagerImpl>
{
- private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(BeanManagerImpl.class, BeanManager.class));
+ private static final Set<Type> TYPES = Arrays2.<Type>asSet(Object.class, BeanManagerImpl.class, BeanManager.class);
- public static final ManagerBean of(BeanManagerImpl manager)
+ public ManagerBean(BeanManagerImpl manager)
{
- return new ManagerBean(manager);
- }
-
- protected ManagerBean(BeanManagerImpl manager)
- {
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java 2009-08-16 16:15:56 UTC (rev 3526)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java 2009-08-16 16:16:39 UTC (rev 3527)
@@ -29,24 +29,19 @@
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.resolution.ResolvableTransformer;
+import org.jboss.webbeans.util.collections.Arrays2;
public class EventBean extends AbstractFacadeBean<Event<?>>
{
- private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>(){}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
- private static final Annotation ANY = new AnyLiteral();
- private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
+ private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>() {}.getRawType();
+ private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(TYPE, Object.class);
+ private static final Annotation ANY = new AnyLiteral();
+ private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
+ public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
-
- public static AbstractFacadeBean<Event<?>> of(BeanManagerImpl manager)
+ public EventBean(BeanManagerImpl manager)
{
- return new EventBean(manager);
- }
-
- protected EventBean(BeanManagerImpl manager)
- {
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java 2009-08-16 16:15:56 UTC (rev 3526)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java 2009-08-16 16:16:39 UTC (rev 3527)
@@ -29,24 +29,19 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.resolution.ResolvableTransformer;
+import org.jboss.webbeans.util.collections.Arrays2;
public class InstanceBean extends AbstractFacadeBean<Instance<?>>
{
private static final Class<Instance<?>> TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
+ private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(TYPE, Object.class);
private static final Any ANY = new AnyLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
-
- public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
+ public InstanceBean(BeanManagerImpl manager)
{
- return new InstanceBean(manager);
- }
-
- protected InstanceBean(BeanManagerImpl manager)
- {
super(manager);
}
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3526 - ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 12:15:56 -0400 (Sun, 16 Aug 2009)
New Revision: 3526
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java
Log:
Add util method
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java 2009-08-16 16:15:27 UTC (rev 3525)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/Arrays2.java 2009-08-16 16:15:56 UTC (rev 3526)
@@ -17,6 +17,8 @@
package org.jboss.webbeans.util.collections;
import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
/**
* @author pmuir
@@ -37,4 +39,14 @@
return containsAll(array, values) && array.length == values.length;
}
+ public static <T> Set<T> asSet(T... types)
+ {
+ Set<T> result = new HashSet<T>();
+ for (T type : types)
+ {
+ result.add(type);
+ }
+ return result;
+ }
+
}
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3525 - in tck/trunk/impl/src/main: resources/META-INF and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 12:15:27 -0400 (Sun, 16 Aug 2009)
New Revision: 3525
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java
tck/trunk/impl/src/main/resources/META-INF/test-unit.properties
Log:
Add incontainer-broken to test groups, enable test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java 2009-08-16 15:37:44 UTC (rev 3524)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/failsDuringValidation/AfterBeanDiscoveryFailureTest.java 2009-08-16 16:15:27 UTC (rev 3525)
@@ -42,7 +42,7 @@
// TODO make this an integration test using Extension
- @Test(groups={"incontainer-broken", "rewrite"} )
+ @Test(groups={"rewrite"} )
@SpecAssertions({
@SpecAssertion(section = "11.5.2", id = "a"),
@SpecAssertion(section = "12.2", id = "e"),
Modified: tck/trunk/impl/src/main/resources/META-INF/test-unit.properties
===================================================================
--- tck/trunk/impl/src/main/resources/META-INF/test-unit.properties 2009-08-16 15:37:44 UTC (rev 3524)
+++ tck/trunk/impl/src/main/resources/META-INF/test-unit.properties 2009-08-16 16:15:27 UTC (rev 3525)
@@ -14,4 +14,4 @@
unimplemented_test_groups=stub,broken
# A comma-separated list of TestNG test groups that are summarised at the end of the report
-summary_test_groups=ri-broken,rewrite,jboss-as-broken, broken
+summary_test_groups=ri-broken,rewrite,jboss-as-broken, broken, incontainer-broken
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3524 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bean/builtin/facade and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 11:37:44 -0400 (Sun, 16 Aug 2009)
New Revision: 3524
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacade.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/FacadeBeanResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceImpl.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
Log:
move facade beans to subpackage
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -1,110 +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.bean.builtin;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.metadata.cache.MetaAnnotationStore;
-
-/**
- * Common implementation for binding-type-based helpers
- *
- * @author Gavin King
- *
- * @param <T>
- */
-public abstract class AbstractFacade<T, X> implements Serializable
-{
-
- private static final long serialVersionUID = 8710258788495459128L;
-
- private static final Annotation[] EMPTY_BINDINGS = new Annotation[0];
-
- // The binding types the helper operates on
- private final Set<? extends Annotation> bindings;
- // The Web Beans manager
- private final BeanManagerImpl manager;
- // The type of the operation
- private final Type type;
-
- /**
- *
- * @param type The event type
- * @param manager The Web Beans manager
- * @param bindings The binding types
- */
- protected AbstractFacade(Type type, BeanManagerImpl manager, Set<? extends Annotation> bindings)
- {
- this.manager = manager;
- this.type = type;
- // Need to make sure the Set is serializable, some sets from Google Collections aren't
- // TODO Work out how to not do this
- this.bindings = new HashSet<Annotation>(bindings);
- }
-
- /**
- * Gets a string representation
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return "Abstract facade implmentation";
- }
-
- protected Annotation[] mergeInBindings(Annotation... newBindings)
- {
- Set<Annotation> result = new HashSet<Annotation>();
- result.addAll(bindings);
- for (Annotation newAnnotation : newBindings)
- {
- if (!getManager().getServices().get(MetaAnnotationStore.class).getBindingTypeModel(newAnnotation.annotationType()).isValid())
- {
- throw new IllegalArgumentException(newAnnotation + " is not a binding for " + this);
- }
- if (result.contains(newAnnotation))
- {
- throw new IllegalArgumentException(newAnnotation + " is already present in the bindings list for " + this);
- }
- result.add(newAnnotation);
- }
- return result.toArray(EMPTY_BINDINGS);
- }
-
- protected BeanManagerImpl getManager()
- {
- return manager.getCurrent();
- }
-
- protected Set<? extends Annotation> getBindings()
- {
- return Collections.unmodifiableSet(bindings);
- }
-
- protected Type getType()
- {
- return type;
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -1,71 +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.bean.builtin;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
-
-public abstract class AbstractFacadeBean<T> extends AbstractBuiltInBean<T>
-{
-
- private static final Log log = Logging.getLog(AbstractFacadeBean.class);
-
- protected AbstractFacadeBean(BeanManagerImpl manager)
- {
- super(manager);
- }
-
- public T create(CreationalContext<T> creationalContext)
- {
- InjectionPoint injectionPoint = this.getManager().getCurrentInjectionPoint();
- if (injectionPoint != null)
- {
- Type genericType = injectionPoint.getType();
- if (genericType instanceof ParameterizedType )
- {
- Type type = ((ParameterizedType) genericType).getActualTypeArguments()[0];
- return newInstance(type, injectionPoint.getBindings());
- }
- else
- {
- throw new IllegalStateException("Must have concrete type argument " + injectionPoint);
- }
- }
- else
- {
- log.warn("Dynamic lookup of " + toString() + " is not supported");
- return null;
- }
- }
-
- public void destroy(T instance, CreationalContext<T> creationalContext)
- {
- // TODO Auto-generated method stub
- }
-
- protected abstract T newInstance(Type type, Set<Annotation> annotations);
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -1,88 +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.bean.builtin;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.TypeLiteral;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.event.EventImpl;
-import org.jboss.webbeans.literal.AnyLiteral;
-import org.jboss.webbeans.resolution.ResolvableTransformer;
-
-public class EventBean extends AbstractFacadeBean<Event<?>>
-{
-
- private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>(){}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
- private static final Annotation ANY = new AnyLiteral();
- private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
-
-
- public static AbstractFacadeBean<Event<?>> of(BeanManagerImpl manager)
- {
- return new EventBean(manager);
- }
-
- protected EventBean(BeanManagerImpl manager)
- {
- super(manager);
- }
-
- @Override
- public Class<Event<?>> getType()
- {
- return TYPE;
- }
-
- @Override
- public Class<?> getBeanClass()
- {
- return EventImpl.class;
- }
-
- public Set<Type> getTypes()
- {
- return DEFAULT_TYPES;
- }
-
- @Override
- public Set<Annotation> getBindings()
- {
- return DEFAULT_BINDINGS;
- }
-
- @Override
- protected Event<?> newInstance(Type type, Set<Annotation> annotations)
- {
- return EventImpl.of(type, getManager(), annotations);
- }
-
- @Override
- public String toString()
- {
- return "Built-in implicit javax.event.Event bean";
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -1,101 +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.bean.builtin;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.inject.Any;
-
-import org.jboss.webbeans.literal.AnyLiteral;
-import org.jboss.webbeans.resolution.ForwardingResolvable;
-import org.jboss.webbeans.resolution.Resolvable;
-import org.jboss.webbeans.resolution.ResolvableTransformer;
-
-/**
- * AnnotatedItem transformer which can be used for FacadeBeans
- *
- * @author Pete Muir
- *
- */
-public class FacadeBeanResolvableTransformer implements ResolvableTransformer
-{
-
- private static final Set<Annotation> bindings;
-
- static
- {
- bindings = new HashSet<Annotation>();
- bindings.add(new AnyLiteral());
- }
-
- private final Class<?> clazz;
- private final HashSet<Type> types;
-
- public FacadeBeanResolvableTransformer(Class<?> clazz)
- {
- this.clazz = clazz;
- this.types = new HashSet<Type>();
- types.add(clazz);
- }
-
- public Resolvable transform(final Resolvable resolvable)
- {
- if (resolvable.isAssignableTo(clazz))
- {
- return new ForwardingResolvable()
- {
-
- @Override
- protected Resolvable delegate()
- {
- return resolvable;
- }
-
- @Override
- public Set<Annotation> getBindings()
- {
- return Collections.unmodifiableSet(bindings);
- }
-
- @Override
- public Set<Type> getTypeClosure()
- {
- return Collections.unmodifiableSet(types);
- }
-
- @Override
- public boolean isAssignableTo(Class<?> c)
- {
- return c.isAssignableFrom(clazz);
- }
-
- @Override
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return Any.class.equals(annotationType);
- }
-
- };
- }
- return resolvable;
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -1,88 +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.bean.builtin;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.TypeLiteral;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.literal.AnyLiteral;
-import org.jboss.webbeans.resolution.ResolvableTransformer;
-
-public class InstanceBean extends AbstractFacadeBean<Instance<?>>
-{
-
- private static final Class<Instance<?>> TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
- private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
- private static final Any ANY = new AnyLiteral();
- private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
-
-
- public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
- {
- return new InstanceBean(manager);
- }
-
- protected InstanceBean(BeanManagerImpl manager)
- {
- super(manager);
- }
-
- @Override
- public Class<Instance<?>> getType()
- {
- return TYPE;
- }
-
- @Override
- public Class<?> getBeanClass()
- {
- return InstanceImpl.class;
- }
-
- public Set<Type> getTypes()
- {
- return DEFAULT_TYPES;
- }
-
- @Override
- public Set<Annotation> getBindings()
- {
- return DEFAULT_BINDINGS;
- }
-
- @Override
- protected Instance<?> newInstance(Type type, Set<Annotation> annotations)
- {
- return InstanceImpl.of(type, getManager(), annotations);
- }
-
- @Override
- public String toString()
- {
- return "Built-in implicit javax.inject.Instance bean";
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -1,136 +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.bean.builtin;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.TypeLiteral;
-import javax.enterprise.inject.spi.Bean;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.resolution.ResolvableWBClass;
-
-/**
- * Helper implementation for Instance for getting instances
- *
- * @author Gavin King
- *
- * @param <T>
- */
-public class InstanceImpl<T> extends AbstractFacade<T, Instance<T>> implements Instance<T>, Serializable
-{
-
- private static final long serialVersionUID = -376721889693284887L;
- private static final Annotation[] EMPTY_BINDINGS = new Annotation[0];
-
- private final Set<Bean<?>> beans;
-
- public static <I> Instance<I> of(Type type, BeanManagerImpl manager, Set<Annotation> annotations)
- {
- return new InstanceImpl<I>(type, manager, annotations);
- }
-
- private InstanceImpl(Type type, BeanManagerImpl manager, Set<Annotation> bindings)
- {
- super(type, manager, bindings);
- this.beans = getManager().getBeans(getType(), bindings.toArray(EMPTY_BINDINGS));
- }
-
- public T get(Annotation... bindings)
- {
- Annotation[] annotations = mergeInBindings(bindings);
- Bean<T> bean = getManager().getBean(ResolvableWBClass.<T>of(getType(), annotations, getManager()), annotations);
-
- @SuppressWarnings("unchecked")
- T instance = (T) getManager().getReference(bean, getType(), getManager().createCreationalContext(bean));
- return instance;
- }
-
- /**
- * Gets a string representation
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return "Obtainable instance for type " + getType() + " and binding types " + getBindings();
- }
-
- private Collection<T> getReferences()
- {
- Collection<T> instances = new ArrayList<T>();
- for (Bean<?> bean : beans)
- {
- Object object = getManager().getReference(bean, getType(), getManager().createCreationalContext(bean));
-
- @SuppressWarnings("unchecked")
- T instance = (T) object;
-
- instances.add(instance);
- }
- return instances;
- }
-
- public Iterator<T> iterator()
- {
- return getReferences().iterator();
- }
-
- public boolean isAmbiguous()
- {
- return beans.size() > 1;
- }
-
- public boolean isUnsatisfied()
- {
- return beans.size() == 0;
- }
-
- public Instance<T> select(Annotation... bindings)
- {
- return selectInstance(this.getType(), bindings);
- }
-
- public <U extends T> Instance<U> select(Class<U> subtype, Annotation... bindings)
- {
- return selectInstance(subtype, bindings);
- }
-
- public <U extends T> Instance<U> select(TypeLiteral<U> subtype, Annotation... bindings)
- {
- return selectInstance(subtype.getType(), bindings);
- }
-
- private <U extends T> Instance<U> selectInstance(Type subtype, Annotation[] bindings)
- {
- return new InstanceImpl<U>(
- subtype,
- this.getManager(),
- new HashSet<Annotation>(Arrays.asList(mergeInBindings(bindings))));
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacade.java (from rev 3523, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacade.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacade.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -0,0 +1,110 @@
+/*
+ * 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.bean.builtin.facade;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.metadata.cache.MetaAnnotationStore;
+
+/**
+ * Common implementation for binding-type-based helpers
+ *
+ * @author Gavin King
+ *
+ * @param <T>
+ */
+public abstract class AbstractFacade<T, X> implements Serializable
+{
+
+ private static final long serialVersionUID = 8710258788495459128L;
+
+ private static final Annotation[] EMPTY_BINDINGS = new Annotation[0];
+
+ // The binding types the helper operates on
+ private final Set<? extends Annotation> bindings;
+ // The Web Beans manager
+ private final BeanManagerImpl manager;
+ // The type of the operation
+ private final Type type;
+
+ /**
+ *
+ * @param type The event type
+ * @param manager The Web Beans manager
+ * @param bindings The binding types
+ */
+ protected AbstractFacade(Type type, BeanManagerImpl manager, Set<? extends Annotation> bindings)
+ {
+ this.manager = manager;
+ this.type = type;
+ // Need to make sure the Set is serializable, some sets from Google Collections aren't
+ // TODO Work out how to not do this
+ this.bindings = new HashSet<Annotation>(bindings);
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return "Abstract facade implmentation";
+ }
+
+ protected Annotation[] mergeInBindings(Annotation... newBindings)
+ {
+ Set<Annotation> result = new HashSet<Annotation>();
+ result.addAll(bindings);
+ for (Annotation newAnnotation : newBindings)
+ {
+ if (!getManager().getServices().get(MetaAnnotationStore.class).getBindingTypeModel(newAnnotation.annotationType()).isValid())
+ {
+ throw new IllegalArgumentException(newAnnotation + " is not a binding for " + this);
+ }
+ if (result.contains(newAnnotation))
+ {
+ throw new IllegalArgumentException(newAnnotation + " is already present in the bindings list for " + this);
+ }
+ result.add(newAnnotation);
+ }
+ return result.toArray(EMPTY_BINDINGS);
+ }
+
+ protected BeanManagerImpl getManager()
+ {
+ return manager.getCurrent();
+ }
+
+ protected Set<? extends Annotation> getBindings()
+ {
+ return Collections.unmodifiableSet(bindings);
+ }
+
+ protected Type getType()
+ {
+ return type;
+ }
+
+}
\ No newline at end of file
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacadeBean.java (from rev 3523, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacadeBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacadeBean.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -0,0 +1,72 @@
+/*
+ * 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.bean.builtin.facade;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.bean.builtin.AbstractBuiltInBean;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
+
+public abstract class AbstractFacadeBean<T> extends AbstractBuiltInBean<T>
+{
+
+ private static final Log log = Logging.getLog(AbstractFacadeBean.class);
+
+ protected AbstractFacadeBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ public T create(CreationalContext<T> creationalContext)
+ {
+ InjectionPoint injectionPoint = this.getManager().getCurrentInjectionPoint();
+ if (injectionPoint != null)
+ {
+ Type genericType = injectionPoint.getType();
+ if (genericType instanceof ParameterizedType )
+ {
+ Type type = ((ParameterizedType) genericType).getActualTypeArguments()[0];
+ return newInstance(type, injectionPoint.getBindings());
+ }
+ else
+ {
+ throw new IllegalStateException("Must have concrete type argument " + injectionPoint);
+ }
+ }
+ else
+ {
+ log.warn("Dynamic lookup of " + toString() + " is not supported");
+ return null;
+ }
+ }
+
+ public void destroy(T instance, CreationalContext<T> creationalContext)
+ {
+ // TODO Auto-generated method stub
+ }
+
+ protected abstract T newInstance(Type type, Set<Annotation> annotations);
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/AbstractFacadeBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java (from rev 3523, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -0,0 +1,88 @@
+/*
+ * 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.bean.builtin.facade;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.TypeLiteral;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.event.EventImpl;
+import org.jboss.webbeans.literal.AnyLiteral;
+import org.jboss.webbeans.resolution.ResolvableTransformer;
+
+public class EventBean extends AbstractFacadeBean<Event<?>>
+{
+
+ private static final Class<Event<?>> TYPE = new TypeLiteral<Event<?>>(){}.getRawType();
+ private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
+ private static final Annotation ANY = new AnyLiteral();
+ private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
+ public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
+
+
+ public static AbstractFacadeBean<Event<?>> of(BeanManagerImpl manager)
+ {
+ return new EventBean(manager);
+ }
+
+ protected EventBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Class<Event<?>> getType()
+ {
+ return TYPE;
+ }
+
+ @Override
+ public Class<?> getBeanClass()
+ {
+ return EventImpl.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return DEFAULT_TYPES;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return DEFAULT_BINDINGS;
+ }
+
+ @Override
+ protected Event<?> newInstance(Type type, Set<Annotation> annotations)
+ {
+ return EventImpl.of(type, getManager(), annotations);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Built-in implicit javax.event.Event bean";
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/EventBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/FacadeBeanResolvableTransformer.java (from rev 3523, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/FacadeBeanResolvableTransformer.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/FacadeBeanResolvableTransformer.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -0,0 +1,101 @@
+/*
+ * 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.bean.builtin.facade;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.Any;
+
+import org.jboss.webbeans.literal.AnyLiteral;
+import org.jboss.webbeans.resolution.ForwardingResolvable;
+import org.jboss.webbeans.resolution.Resolvable;
+import org.jboss.webbeans.resolution.ResolvableTransformer;
+
+/**
+ * AnnotatedItem transformer which can be used for FacadeBeans
+ *
+ * @author Pete Muir
+ *
+ */
+public class FacadeBeanResolvableTransformer implements ResolvableTransformer
+{
+
+ private static final Set<Annotation> bindings;
+
+ static
+ {
+ bindings = new HashSet<Annotation>();
+ bindings.add(new AnyLiteral());
+ }
+
+ private final Class<?> clazz;
+ private final HashSet<Type> types;
+
+ public FacadeBeanResolvableTransformer(Class<?> clazz)
+ {
+ this.clazz = clazz;
+ this.types = new HashSet<Type>();
+ types.add(clazz);
+ }
+
+ public Resolvable transform(final Resolvable resolvable)
+ {
+ if (resolvable.isAssignableTo(clazz))
+ {
+ return new ForwardingResolvable()
+ {
+
+ @Override
+ protected Resolvable delegate()
+ {
+ return resolvable;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return Collections.unmodifiableSet(bindings);
+ }
+
+ @Override
+ public Set<Type> getTypeClosure()
+ {
+ return Collections.unmodifiableSet(types);
+ }
+
+ @Override
+ public boolean isAssignableTo(Class<?> c)
+ {
+ return c.isAssignableFrom(clazz);
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return Any.class.equals(annotationType);
+ }
+
+ };
+ }
+ return resolvable;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/FacadeBeanResolvableTransformer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java (from rev 3523, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -0,0 +1,88 @@
+/*
+ * 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.bean.builtin.facade;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.TypeLiteral;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.literal.AnyLiteral;
+import org.jboss.webbeans.resolution.ResolvableTransformer;
+
+public class InstanceBean extends AbstractFacadeBean<Instance<?>>
+{
+
+ private static final Class<Instance<?>> TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
+ private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
+ private static final Any ANY = new AnyLiteral();
+ private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
+ public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
+
+
+ public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
+ {
+ return new InstanceBean(manager);
+ }
+
+ protected InstanceBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Class<Instance<?>> getType()
+ {
+ return TYPE;
+ }
+
+ @Override
+ public Class<?> getBeanClass()
+ {
+ return InstanceImpl.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return DEFAULT_TYPES;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return DEFAULT_BINDINGS;
+ }
+
+ @Override
+ protected Instance<?> newInstance(Type type, Set<Annotation> annotations)
+ {
+ return InstanceImpl.of(type, getManager(), annotations);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Built-in implicit javax.inject.Instance bean";
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceImpl.java (from rev 3523, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/facade/InstanceImpl.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -0,0 +1,136 @@
+/*
+ * 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.bean.builtin.facade;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.TypeLiteral;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.resolution.ResolvableWBClass;
+
+/**
+ * Helper implementation for Instance for getting instances
+ *
+ * @author Gavin King
+ *
+ * @param <T>
+ */
+public class InstanceImpl<T> extends AbstractFacade<T, Instance<T>> implements Instance<T>, Serializable
+{
+
+ private static final long serialVersionUID = -376721889693284887L;
+ private static final Annotation[] EMPTY_BINDINGS = new Annotation[0];
+
+ private final Set<Bean<?>> beans;
+
+ public static <I> Instance<I> of(Type type, BeanManagerImpl manager, Set<Annotation> annotations)
+ {
+ return new InstanceImpl<I>(type, manager, annotations);
+ }
+
+ private InstanceImpl(Type type, BeanManagerImpl manager, Set<Annotation> bindings)
+ {
+ super(type, manager, bindings);
+ this.beans = getManager().getBeans(getType(), bindings.toArray(EMPTY_BINDINGS));
+ }
+
+ public T get(Annotation... bindings)
+ {
+ Annotation[] annotations = mergeInBindings(bindings);
+ Bean<T> bean = getManager().getBean(ResolvableWBClass.<T>of(getType(), annotations, getManager()), annotations);
+
+ @SuppressWarnings("unchecked")
+ T instance = (T) getManager().getReference(bean, getType(), getManager().createCreationalContext(bean));
+ return instance;
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return "Obtainable instance for type " + getType() + " and binding types " + getBindings();
+ }
+
+ private Collection<T> getReferences()
+ {
+ Collection<T> instances = new ArrayList<T>();
+ for (Bean<?> bean : beans)
+ {
+ Object object = getManager().getReference(bean, getType(), getManager().createCreationalContext(bean));
+
+ @SuppressWarnings("unchecked")
+ T instance = (T) object;
+
+ instances.add(instance);
+ }
+ return instances;
+ }
+
+ public Iterator<T> iterator()
+ {
+ return getReferences().iterator();
+ }
+
+ public boolean isAmbiguous()
+ {
+ return beans.size() > 1;
+ }
+
+ public boolean isUnsatisfied()
+ {
+ return beans.size() == 0;
+ }
+
+ public Instance<T> select(Annotation... bindings)
+ {
+ return selectInstance(this.getType(), bindings);
+ }
+
+ public <U extends T> Instance<U> select(Class<U> subtype, Annotation... bindings)
+ {
+ return selectInstance(subtype, bindings);
+ }
+
+ public <U extends T> Instance<U> select(TypeLiteral<U> subtype, Annotation... bindings)
+ {
+ return selectInstance(subtype.getType(), bindings);
+ }
+
+ private <U extends T> Instance<U> selectInstance(Type subtype, Annotation[] bindings)
+ {
+ return new InstanceImpl<U>(
+ subtype,
+ this.getManager(),
+ new HashSet<Annotation>(Arrays.asList(mergeInBindings(bindings))));
+ }
+
+}
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-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -29,10 +29,10 @@
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.DeploymentException;
import org.jboss.webbeans.Validator;
-import org.jboss.webbeans.bean.builtin.EventBean;
import org.jboss.webbeans.bean.builtin.InjectionPointBean;
-import org.jboss.webbeans.bean.builtin.InstanceBean;
import org.jboss.webbeans.bean.builtin.ManagerBean;
+import org.jboss.webbeans.bean.builtin.facade.EventBean;
+import org.jboss.webbeans.bean.builtin.facade.InstanceBean;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
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-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -26,7 +26,7 @@
import javax.enterprise.inject.TypeLiteral;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.builtin.AbstractFacade;
+import org.jboss.webbeans.bean.builtin.facade.AbstractFacade;
import org.jboss.webbeans.util.Strings;
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-08-16 15:35:33 UTC (rev 3523)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-08-16 15:37:44 UTC (rev 3524)
@@ -24,8 +24,8 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.builtin.EventBean;
-import org.jboss.webbeans.bean.builtin.InstanceBean;
+import org.jboss.webbeans.bean.builtin.facade.EventBean;
+import org.jboss.webbeans.bean.builtin.facade.InstanceBean;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.collections.ConcurrentCache;
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3523 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bean/builtin and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 11:35:33 -0400 (Sun, 16 Aug 2009)
New Revision: 3523
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractBuiltInBean.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
Log:
Rename standard->built in
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin (from rev 3508, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard)
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractBuiltInBean.java (from rev 3508, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractBuiltInBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractBuiltInBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -0,0 +1,121 @@
+/*
+ * 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.bean.builtin;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
+import org.jboss.webbeans.injection.WBInjectionPoint;
+import org.jboss.webbeans.literal.AnyLiteral;
+import org.jboss.webbeans.literal.CurrentLiteral;
+
+public abstract class AbstractBuiltInBean<T> extends RIBean<T>
+{
+
+ private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral(), new AnyLiteral() };
+ private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
+
+ private final String id;
+
+ protected AbstractBuiltInBean(BeanManagerImpl manager)
+ {
+ super(manager);
+ this.id = getClass().getSimpleName();
+ }
+
+ @Override
+ public void initialize(BeanDeployerEnvironment environment)
+ {
+ // No-op
+ }
+
+
+ public Set<Annotation> getBindings()
+ {
+ return DEFAULT_BINDING;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dependent.class;
+ }
+
+ @Override
+ public RIBean<?> getSpecializedBean()
+ {
+ return null;
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Set<Class<? extends Annotation>> getStereotypes()
+ {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ {
+ return Collections.emptySet();
+ }
+
+ public boolean isNullable()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isPrimitive()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isSpecializing()
+ {
+ return false;
+ }
+
+ public boolean isPolicy()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isProxyable()
+ {
+ return false;
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractBuiltInBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacade.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacade.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.io.Serializable;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractFacadeBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
@@ -28,7 +28,7 @@
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
-public abstract class AbstractFacadeBean<T> extends AbstractStandardBean<T>
+public abstract class AbstractFacadeBean<T> extends AbstractBuiltInBean<T>
{
private static final Log log = Logging.getLog(AbstractFacadeBean.class);
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractStandardBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/AbstractStandardBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -1,121 +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.bean.standard;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.context.Dependent;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.WBInjectionPoint;
-import org.jboss.webbeans.literal.AnyLiteral;
-import org.jboss.webbeans.literal.CurrentLiteral;
-
-public abstract class AbstractStandardBean<T> extends RIBean<T>
-{
-
- private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral(), new AnyLiteral() };
- private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
-
- private final String id;
-
- protected AbstractStandardBean(BeanManagerImpl manager)
- {
- super(manager);
- this.id = getClass().getSimpleName();
- }
-
- @Override
- public void initialize(BeanDeployerEnvironment environment)
- {
- // No-op
- }
-
-
- public Set<Annotation> getBindings()
- {
- return DEFAULT_BINDING;
- }
-
- public Class<? extends Annotation> getScopeType()
- {
- return Dependent.class;
- }
-
- @Override
- public RIBean<?> getSpecializedBean()
- {
- return null;
- }
-
- public String getName()
- {
- return null;
- }
-
- public Set<Class<? extends Annotation>> getStereotypes()
- {
- return Collections.emptySet();
- }
-
- @Override
- public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
- {
- return Collections.emptySet();
- }
-
- public boolean isNullable()
- {
- return true;
- }
-
- @Override
- public boolean isPrimitive()
- {
- return false;
- }
-
- @Override
- public boolean isSpecializing()
- {
- return false;
- }
-
- public boolean isPolicy()
- {
- return false;
- }
-
- @Override
- public boolean isProxyable()
- {
- return false;
- }
-
- @Override
- public String getId()
- {
- return id;
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/EventBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ExtensionBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ExtensionBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
@@ -31,7 +31,7 @@
* @author pmuir
*
*/
-public class ExtensionBean extends AbstractStandardBean<Extension>
+public class ExtensionBean extends AbstractBuiltInBean<Extension>
{
private final WBClass<Extension> clazz;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/FacadeBeanResolvableTransformer.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InjectionPointBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.reflect.Type;
import java.util.Arrays;
@@ -32,7 +32,7 @@
* @author David Allen
*
*/
-public class InjectionPointBean extends AbstractStandardBean<InjectionPoint>
+public class InjectionPointBean extends AbstractBuiltInBean<InjectionPoint>
{
private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(new Type[] { InjectionPoint.class }));
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceImpl.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/InstanceImpl.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.io.Serializable;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-08-15 14:05:42 UTC (rev 3508)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/builtin/ManagerBean.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.bean.standard;
+package org.jboss.webbeans.bean.builtin;
import java.lang.reflect.Type;
import java.util.Arrays;
@@ -26,7 +26,7 @@
import org.jboss.webbeans.BeanManagerImpl;
-public class ManagerBean extends AbstractStandardBean<BeanManagerImpl>
+public class ManagerBean extends AbstractBuiltInBean<BeanManagerImpl>
{
private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(BeanManagerImpl.class, BeanManager.class));
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-08-16 15:31:10 UTC (rev 3522)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -34,8 +34,8 @@
import org.jboss.webbeans.bean.ProducerFieldBean;
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.bean.standard.AbstractStandardBean;
-import org.jboss.webbeans.bean.standard.ExtensionBean;
+import org.jboss.webbeans.bean.builtin.AbstractBuiltInBean;
+import org.jboss.webbeans.bean.builtin.ExtensionBean;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.ObserverMethodImpl;
import org.jboss.webbeans.introspector.WBClass;
@@ -113,7 +113,7 @@
beans.add(bean);
}
- public void addBean(AbstractStandardBean<?> bean)
+ public void addBean(AbstractBuiltInBean<?> bean)
{
beans.add(bean);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java 2009-08-16 15:31:10 UTC (rev 3522)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/ExtensionBeanDeployer.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -22,7 +22,7 @@
import javax.enterprise.inject.spi.Extension;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.standard.ExtensionBean;
+import org.jboss.webbeans.bean.builtin.ExtensionBean;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.resources.ClassTransformer;
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-08-16 15:31:10 UTC (rev 3522)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -29,10 +29,10 @@
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.DeploymentException;
import org.jboss.webbeans.Validator;
-import org.jboss.webbeans.bean.standard.EventBean;
-import org.jboss.webbeans.bean.standard.InjectionPointBean;
-import org.jboss.webbeans.bean.standard.InstanceBean;
-import org.jboss.webbeans.bean.standard.ManagerBean;
+import org.jboss.webbeans.bean.builtin.EventBean;
+import org.jboss.webbeans.bean.builtin.InjectionPointBean;
+import org.jboss.webbeans.bean.builtin.InstanceBean;
+import org.jboss.webbeans.bean.builtin.ManagerBean;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
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-08-16 15:31:10 UTC (rev 3522)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -26,7 +26,7 @@
import javax.enterprise.inject.TypeLiteral;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.standard.AbstractFacade;
+import org.jboss.webbeans.bean.builtin.AbstractFacade;
import org.jboss.webbeans.util.Strings;
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-08-16 15:31:10 UTC (rev 3522)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resolution/TypeSafeBeanResolver.java 2009-08-16 15:35:33 UTC (rev 3523)
@@ -24,8 +24,8 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.bean.standard.EventBean;
-import org.jboss.webbeans.bean.standard.InstanceBean;
+import org.jboss.webbeans.bean.builtin.EventBean;
+import org.jboss.webbeans.bean.builtin.InstanceBean;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.collections.ConcurrentCache;
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3522 - in ri/trunk: spi and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-16 11:31:10 -0400 (Sun, 16 Aug 2009)
New Revision: 3522
Added:
ri/trunk/spi/src/main/java/org/jboss/webbeans/security/
ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/
ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/
ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/
ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java
Modified:
ri/trunk/jboss-as/build.properties
ri/trunk/jboss-as/build.xml
ri/trunk/spi/pom.xml
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
ri/trunk/version-matrix/pom.xml
Log:
add SPI for UT, BV and Principal
Modified: ri/trunk/jboss-as/build.properties
===================================================================
--- ri/trunk/jboss-as/build.properties 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/jboss-as/build.properties 2009-08-16 15:31:10 UTC (rev 3522)
@@ -11,3 +11,4 @@
webbeans.version=1.0.0-SNAPSHOT
jboss-ejb3.version=1.0.0
javassist.version=3.11.0.GA
+validation.version=1.0.CR3
Modified: ri/trunk/jboss-as/build.xml
===================================================================
--- ri/trunk/jboss-as/build.xml 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/jboss-as/build.xml 2009-08-16 15:31:10 UTC (rev 3522)
@@ -13,7 +13,7 @@
<delete dir="target" failonerror="false" />
</target>
- <target name="update" depends="install-webbeans.deployer, install-javassist-update" description="Update JBoss 5.x or 6.x for Web Beans" />
+ <target name="update" depends="install-webbeans.deployer, install-javassist-update, install-validation-update" description="Update JBoss 5.x or 6.x for Web Beans" />
<target name="install-webbeans.deployer">
<echo message="Installing Web Beans ${webbeans.version} to ${jboss.home}" />
@@ -85,6 +85,32 @@
</fileset>
</copy>
</target>
+
+ <target name="install-validation-update">
+ <echo message="Upgrading Bean Validation API to ${validation.version} for ${jboss.home}" />
+ <fail unless="jboss.home" message="Please pass in -Djboss.home=..." />
+
+ <artifact:dependencies filesetId="validation.fileset" versionsId="validation.versions">
+ <dependency groupId="javax.validation" artifactId="validation-api" version="${validation.version}" />
+ <remoteRepository id="repository.jboss.org" url="http://repository.jboss.org/maven2" />
+ <remoteRepository id="snapshots.jboss.org" url="http://snapshots.jboss.org/maven2" />
+ </artifact:dependencies>
+
+ <mkdir dir="target/dependency/lib" />
+ <copy todir="target/dependency/lib">
+ <fileset refid="validation.fileset" />
+ <chainedmapper>
+ <flattenmapper />
+ <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${validation.versions}" to="flatten" />
+ </chainedmapper>
+ </copy>
+
+ <copy todir="${jboss.home}/common/lib">
+ <fileset dir="target/dependency/lib">
+ <include name="validation-api.jar" />
+ </fileset>
+ </copy>
+ </target>
<target name="install-jboss-ejb3-update">
Modified: ri/trunk/spi/pom.xml
===================================================================
--- ri/trunk/spi/pom.xml 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/pom.xml 2009-08-16 15:31:10 UTC (rev 3522)
@@ -57,6 +57,11 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
</dependencies>
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -25,10 +25,12 @@
import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.validation.spi.ValidationServices;
/**
- * Various well known environments.
+ * Requirements for various well known environments.
*
* @author Pete Muir
*
@@ -39,12 +41,12 @@
/**
* Java EE5 or Java EE6
*/
- EE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
+ EE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class, SecurityServices.class, ValidationServices.class),
/**
* Java EE6 Web Profile
*/
- EE_WEB_PROFILE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
+ EE_WEB_PROFILE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class, SecurityServices.class, ValidationServices.class),
/**
* Servlet container such as Tomcat
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,42 @@
+/*
+ * 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.security.spi;
+
+import java.security.Principal;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * Responsible for accessing security related functionality the environment can
+ * provide.
+ *
+ * Required in a Java EE environment.
+ *
+ * @author pmuir
+ *
+ */
+public interface SecurityServices extends Service
+{
+
+ /**
+ * Obtain the Principal representing the current caller identity
+ *
+ * @return the Principal representing the current caller identity
+ */
+ public Principal getPrincipal();
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/security/spi/SecurityServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/transaction/spi/TransactionServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.transaction.spi;
import javax.transaction.Synchronization;
+import javax.transaction.UserTransaction;
import org.jboss.webbeans.bootstrap.api.Service;
@@ -11,13 +12,15 @@
* </p>
*
* <p>
- * The event framework specified by JSR-299 includes the ability to create
- * observer methods which are activated based on the phase and status of a
- * currently active transaction. In order to use these abilities, the container
- * must provide these intermediary services which in turn may interact with an
+ * The event framework specified by CDI includes the ability to create observer
+ * methods which are activated based on the phase and status of a currently
+ * active transaction. In order to use these abilities, the container must
+ * provide these intermediary services which in turn may interact with an
* application server and JTA.
* </p>
*
+ * <p>Required in a Java EE environment</p>
+ *
* @author David Allen
*
*/
@@ -39,4 +42,11 @@
* @return true if a transaction is active
*/
public boolean isTransactionActive();
+
+ /**
+ * Obtain a reference to the JTA UserTransaction
+ *
+ * @return a reference to the JTA UserTransaction
+ */
+ public UserTransaction getUserTransaction();
}
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,45 @@
+/*
+ * 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.validation.spi;
+
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.bootstrap.api.Service;
+
+/**
+ * <p>
+ * Responsible for accessing Bean Validation functionality the environment may
+ * provide.
+ * </p>
+ *
+ * <p>
+ * Required in a Java EE environment.
+ * </p>
+ *
+ * @author pmuir
+ *
+ */
+public interface ValidationServices extends Service
+{
+
+ /**
+ * Obtain a reference to the default ValidatorFactory
+ * @return
+ */
+ public ValidatorFactory getDefaultValidatorFactory();
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/validation/spi/ValidationServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -8,7 +8,9 @@
import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.validation.spi.ValidationServices;
import org.testng.annotations.Test;
public class BootstrapTest
@@ -35,6 +37,8 @@
bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
bootstrap.startContainer();
}
@@ -49,9 +53,43 @@
bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
bootstrap.startContainer();
}
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingSecurityServices()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE);
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
+ bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
+ bootstrap.startContainer();
+ }
+
+ @Test(expectedExceptions=IllegalStateException.class)
+ public void testMissingValidationServices()
+ {
+ AbstractBootstrap bootstrap = new MockBootstrap();
+ bootstrap.setEnvironment(Environments.EE);
+ bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
+ bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
+ bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
+ bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
+ bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
+ bootstrap.startContainer();
+ }
+
@Test
public void testEEEnv()
{
@@ -64,6 +102,8 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
bootstrap.startContainer();
}
@@ -79,6 +119,8 @@
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
bootstrap.startContainer();
}
@@ -93,6 +135,8 @@
bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
bootstrap.startContainer();
}
@@ -107,6 +151,8 @@
bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
+ bootstrap.getServices().add(SecurityServices.class, new MockSecurityServices());
+ bootstrap.getServices().add(ValidationServices.class, new MockValidationServices());
bootstrap.startContainer();
}
Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,39 @@
+/*
+ * 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.bootstrap.api.test;
+
+import java.security.Principal;
+
+import org.jboss.webbeans.security.spi.SecurityServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockSecurityServices implements SecurityServices
+{
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.security.spi.SecurityServices#getPrincipal()
+ */
+ public Principal getPrincipal()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockSecurityServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockTransactionServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.bootstrap.api.test;
import javax.transaction.Synchronization;
+import javax.transaction.UserTransaction;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -16,4 +17,9 @@
{
}
+ public UserTransaction getUserTransaction()
+ {
+ return null;
+ }
+
}
Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,35 @@
+/*
+ * 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.bootstrap.api.test;
+
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockValidationServices implements ValidationServices
+{
+
+ public ValidatorFactory getDefaultValidatorFactory()
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockValidationServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -20,7 +20,9 @@
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.persistence.spi.JpaServices;
import org.jboss.webbeans.resources.spi.ResourceServices;
+import org.jboss.webbeans.security.spi.SecurityServices;
import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.validation.spi.ValidationServices;
public class MockEELifecycle extends MockServletLifecycle
{
@@ -34,6 +36,8 @@
getBootstrap().getServices().add(EjbServices.class, new MockEjBServices());
getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getDeployment()));
getBootstrap().getServices().add(ResourceServices.class, new MockResourceServices());
+ getBootstrap().getServices().add(SecurityServices.class, new MockSecurityServices());
+ getBootstrap().getServices().add(ValidationServices.class, new MockValidationServices());
getBootstrap().setEnvironment(Environments.EE);
}
Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,39 @@
+/*
+ * 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.mock;
+
+import java.security.Principal;
+
+import org.jboss.webbeans.security.spi.SecurityServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockSecurityServices implements SecurityServices
+{
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.security.spi.SecurityServices#getPrincipal()
+ */
+ public Principal getPrincipal()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockSecurityServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockTransactionServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -18,6 +18,7 @@
package org.jboss.webbeans.mock;
import javax.transaction.Synchronization;
+import javax.transaction.UserTransaction;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -40,5 +41,10 @@
public void registerSynchronization(Synchronization synchronizedObserver)
{
}
+
+ public UserTransaction getUserTransaction()
+ {
+ return null;
+ }
}
Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java 2009-08-16 15:31:10 UTC (rev 3522)
@@ -0,0 +1,35 @@
+/*
+ * 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.mock;
+
+import javax.validation.ValidatorFactory;
+
+import org.jboss.webbeans.validation.spi.ValidationServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockValidationServices implements ValidationServices
+{
+
+ public ValidatorFactory getDefaultValidatorFactory()
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockValidationServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-08-16 12:36:03 UTC (rev 3521)
+++ ri/trunk/version-matrix/pom.xml 2009-08-16 15:31:10 UTC (rev 3522)
@@ -93,6 +93,12 @@
<artifactId>scannotation</artifactId>
<version>1.0.2</version>
</dependency>
+
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.CR3</version>
+ </dependency>
<dependency>
<groupId>com.google.collections</groupId>
16 years, 8 months
[webbeans-commits] Webbeans SVN: r3521 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-16 08:36:03 -0400 (Sun, 16 Aug 2009)
New Revision: 3521
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java
Log:
Minor fix to test class for new enterprise bean tests.
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java 2009-08-16 11:35:54 UTC (rev 3520)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/ExplicitConstructorSessionBean.java 2009-08-16 12:36:03 UTC (rev 3521)
@@ -2,6 +2,7 @@
import javax.ejb.Stateless;
import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
import javax.enterprise.inject.New;
import org.jboss.jsr299.tck.literals.NewLiteral;
@@ -22,6 +23,7 @@
}
};
+ @Initializer
public ExplicitConstructorSessionBean(@Current SimpleBean bean)
{
constructorCalls++;
16 years, 8 months