Package org.jboss.weld.serialization

Examples of org.jboss.weld.serialization.BeanIdentifierIndex


    private TypeStore typeStore;
    private ServiceRegistry services;

    @BeforeMethod
    public void beforeMethod() {
        BeanIdentifierIndex beanIdentifierIndex = new BeanIdentifierIndex();
        beanIdentifierIndex.build(Collections.<Bean<?>>emptySet());
        this.typeStore = new TypeStore();
        this.classTransformer = new ClassTransformer(typeStore, new SharedObjectCache(), ReflectionCacheFactory.newInstance(typeStore), RegistrySingletonProvider.STATIC_INSTANCE);
        this.services = new SimpleServiceRegistry();
        this.services.add(MetaAnnotationStore.class, new MetaAnnotationStore(classTransformer));
        this.services.add(ContextualStore.class, new ContextualStoreImpl(STATIC_INSTANCE, beanIdentifierIndex));
View Full Code Here


public class BeanIdentifierIndexTest {

    @Test(expected=IllegalStateException.class)
    public void testIndexNotBuilt() {
        new BeanIdentifierIndex().getIdentifier(0);
    }
View Full Code Here

        new BeanIdentifierIndex().getIdentifier(0);
    }

    @Test
    public void testInvalidIndex() {
        BeanIdentifierIndex index = new BeanIdentifierIndex();
        index.build(Collections.<Bean<?>>emptySet());
        try {
            index.getIdentifier(-10);
            fail();
        } catch (IllegalStateException e) {
            // Expected
        }
        try {
            index.getIdentifier(0);
            fail();
        } catch (IllegalStateException e) {
            // Expected
        }
        try {
            index.getIdentifier(10);
            fail();
        } catch (IllegalStateException e) {
            // Expected
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testGetIndex() {
        BeanIdentifierIndex index = new BeanIdentifierIndex();
        index.build(Collections.<Bean<?>>emptySet());
        try {
            index.getIndex(null);
        } catch (IllegalArgumentException e) {
            // Expected
        }
        assertNull(index.getIndex(new StringBeanIdentifier("foo")));
    }
View Full Code Here

        if (services.get(ClassTransformer.class) == null) {
            throw new IllegalStateException(ClassTransformer.class.getSimpleName() + " not installed.");
        }
        services.add(MemberTransformer.class, new MemberTransformer(services.get(ClassTransformer.class)));
        services.add(MetaAnnotationStore.class, new MetaAnnotationStore(services.get(ClassTransformer.class)));
        BeanIdentifierIndex beanIdentifierIndex = new BeanIdentifierIndex();
        services.add(BeanIdentifierIndex.class, beanIdentifierIndex);
        services.add(ContextualStore.class, new ContextualStoreImpl(contextId, beanIdentifierIndex));
        services.add(CurrentInjectionPoint.class, new CurrentInjectionPoint());
        services.add(SLSBInvocationInjectionPoint.class, new SLSBInvocationInjectionPoint());
        services.add(CurrentEventMetadata.class, new CurrentEventMetadata());
View Full Code Here

    }

    protected Collection<ContextHolder<? extends Context>> createContexts(ServiceRegistry services) {
        List<ContextHolder<? extends Context>> contexts = new ArrayList<ContextHolder<? extends Context>>();

        BeanIdentifierIndex beanIdentifierIndex = services.get(BeanIdentifierIndex.class);

        /*
        * Register a full set of bound and unbound contexts. Although we may not use all of
        * these (e.g. if we are running in a servlet environment) they may be
        * useful for an application.
View Full Code Here

TOP

Related Classes of org.jboss.weld.serialization.BeanIdentifierIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.