Package org.jboss.weld.serialization.spi

Examples of org.jboss.weld.serialization.spi.BeanIdentifier


                this.serializable = contextual;
                this.identifier = null;
                this.identifierIndex = null;
            } else {
                this.serializable = null;
                BeanIdentifier beanIdentifier = getId(contextual, contextualStore);
                // The index may not be built yet
                Integer idx = beanIdentifierIndex.isBuilt() ? beanIdentifierIndex.getIndex(beanIdentifier) : null;
                if (idx != null) {
                    this.identifierIndex = idx;
                    this.identifier = null;
View Full Code Here


            }
            if (obj instanceof ManagedBeanIdentifier) {
                ManagedBeanIdentifier that = (ManagedBeanIdentifier) obj;
                return this.typeIdentifier.equals(that.typeIdentifier);
            }
            BeanIdentifier that = (BeanIdentifier) obj;
            return this.asString().equals(that.asString());
        }
        return false;
    }
View Full Code Here

        }
        if (contextual instanceof PassivationCapable) {
            // this is an extension-provided passivation capable bean
            PassivationCapable passivationCapable = (PassivationCapable) contextual;
            String id = passivationCapable.getId();
            BeanIdentifier identifier = new StringBeanIdentifier(id);
            passivationCapableContextuals.putIfAbsent(identifier, contextual);
            return identifier;
        } else {
            BeanIdentifier id = contextuals.get(contextual);
            if (id != null) {
                return id;
            } else {
                synchronized (contextual) {
                    id = contextuals.get(contextual);
View Full Code Here

        }
        //there is a remote chance that this could generate the same
        //proxy name for two interfaces with the same simple name.
        //append the hash code of the bean id to be sure
        if (bean != null) {
            final BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean);
            int idHash = id.hashCode();
            name.append(Math.abs(idHash == Integer.MIN_VALUE ? 0 : idHash));
        }
        className = name.toString();
        return className;
    }
View Full Code Here

    private <T> T createClientProxy(Bean<T> bean) throws RuntimeException {
        return createClientProxy(bean, bean.getTypes());
    }

    private <T> T createClientProxy(Bean<T> bean, Set<Type> types) {
        BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean);
        if (id == null) {
            throw BeanLogger.LOG.beanIdCreationFailed(bean);
        }
        ContextBeanInstance<T> beanInstance = new ContextBeanInstance<T>(bean, id, contextId);
        TypeInfo typeInfo = TypeInfo.of(types);
View Full Code Here

            }
            if (obj instanceof StringBeanIdentifier) {
                StringBeanIdentifier that = (StringBeanIdentifier) obj;
                return this.value.equals(that.value);
            }
            BeanIdentifier that = (BeanIdentifier) obj;
            return this.value.equals(that.asString());
        }
        return false;
    }
View Full Code Here

            }
            if (obj instanceof ProducerMethodIdentifier) {
                ProducerMethodIdentifier that = (ProducerMethodIdentifier) obj;
                return this.typeIdentifier.equals(that.typeIdentifier) && this.memberIndex == that.memberIndex;
            }
            BeanIdentifier that = (BeanIdentifier) obj;
            return this.asString().equals(that.asString());
        }
        return false;
    }
View Full Code Here

            return null;
        }
        if (contextual == null) {
            throw ContextLogger.LOG.contextualIsNull();
        }
        BeanIdentifier id = getId(contextual);
        ContextualInstance<T> beanInstance = beanStore.get(id);
        if (beanInstance != null) {
            return beanInstance.getInstance();
        } else if (creationalContext != null) {
            LockedBean lock = null;
View Full Code Here

            throw ContextLogger.LOG.contextualIsNull();
        }
        if (getBeanStore() == null) {
            throw ContextLogger.LOG.noBeanStoreAvailable(this);
        }
        BeanIdentifier id = getId(contextual);
        ContextualInstance<?> beanInstance = getBeanStore().remove(id);
        if (beanInstance != null) {
            RequestScopedBeanCache.invalidate();
            destroyContextualInstance(beanInstance);
        }
View Full Code Here

            /*
            * Additionally copy anything not in the bean store but in the session
            * into the bean store
            */
            for (String prefixedId : getPrefixedAttributeNames()) {
                BeanIdentifier id = getNamingScheme().deprefix(prefixedId);
                if (!beanStore.contains(id)) {
                    ContextualInstance<?> instance = (ContextualInstance<?>) getAttribute(prefixedId);
                    beanStore.put(id, instance);
                    ContextLogger.LOG.addingDetachedContextualUnderId(instance, id);
                }
View Full Code Here

TOP

Related Classes of org.jboss.weld.serialization.spi.BeanIdentifier

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.