use of jakarta.enterprise.inject.spi.AnnotatedType in project myfaces by apache.
the class CDIInjectionProviderImpl method postConstruct.
@Override
public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException {
AnnotatedType annoType = beanManager.createAnnotatedType(instance.getClass());
InjectionTarget target = beanManager.createInjectionTarget(annoType);
target.postConstruct(instance);
}
use of jakarta.enterprise.inject.spi.AnnotatedType in project myfaces by apache.
the class PushContextCDIExtension method beforeBeanDiscovery.
void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event, BeanManager beanManager) {
// Register PushContextFactoryBean as a bean with CDI annotations, so the system
// can take it into account, and use it later when necessary.
AnnotatedType wcbean = beanManager.createAnnotatedType(WebsocketChannelTokenBuilderBean.class);
event.addAnnotatedType(wcbean, wcbean.getJavaClass().getName());
AnnotatedType sessionhandlerbean = beanManager.createAnnotatedType(WebsocketSessionBean.class);
event.addAnnotatedType(sessionhandlerbean, sessionhandlerbean.getJavaClass().getName());
AnnotatedType viewTokenBean = beanManager.createAnnotatedType(WebsocketViewBean.class);
event.addAnnotatedType(viewTokenBean, viewTokenBean.getJavaClass().getName());
AnnotatedType apphandlerbean = beanManager.createAnnotatedType(WebsocketApplicationBean.class);
event.addAnnotatedType(apphandlerbean, apphandlerbean.getJavaClass().getName());
}
use of jakarta.enterprise.inject.spi.AnnotatedType in project core by weld.
the class WeldClassTest method testMemberClassWithGenericTypes.
/*
* description = "WELD-216"
*/
@Test
public void testMemberClassWithGenericTypes() {
final AnnotatedType<?> at = transformer.getEnhancedAnnotatedType(new Kangaroo().procreate().getClass(), AnnotatedTypeIdentifier.NULL_BDA_ID);
transformer.getEnhancedAnnotatedType(new ForwardingAnnotatedType() {
@Override
public AnnotatedType delegate() {
return at;
}
}, AnnotatedTypeIdentifier.NULL_BDA_ID);
}
use of jakarta.enterprise.inject.spi.AnnotatedType in project core by weld.
the class WeldClassTest method testLocalClassWithGenericTypes.
/*
* description = "WELD-216"
*/
@Test
public /*
* Not isolated, depends on someone else initializing Containers.
*
* getUnproxyableClassException() catch(NoSuchMethodException)
* InstantiatorFactory.useInstantiators() <-- Needs Containers
*/
void testLocalClassWithGenericTypes() {
final AnnotatedType<?> at = transformer.getEnhancedAnnotatedType(new Koala().procreate().getClass(), AnnotatedTypeIdentifier.NULL_BDA_ID);
transformer.getEnhancedAnnotatedType(new ForwardingAnnotatedType() {
@Override
public AnnotatedType delegate() {
return at;
}
}, AnnotatedTypeIdentifier.NULL_BDA_ID);
}
use of jakarta.enterprise.inject.spi.AnnotatedType in project core by weld.
the class WeldClassTest method testAnonymousClassWithGenericTypes.
/*
* description = "WELD-216"
*/
@Test
public /*
* Not isolated, depends on someone else initializing Containers.
*
* getUnproxyableClassException() catch(NoSuchMethodException)
* InstantiatorFactory.useInstantiators() <-- Needs Containers
*/
void testAnonymousClassWithGenericTypes() {
final AnnotatedType<?> at = transformer.getEnhancedAnnotatedType(new Possum().procreate().getClass(), AnnotatedTypeIdentifier.NULL_BDA_ID);
transformer.getEnhancedAnnotatedType(new ForwardingAnnotatedType() {
@Override
public AnnotatedType delegate() {
return at;
}
}, AnnotatedTypeIdentifier.NULL_BDA_ID);
}
Aggregations