Examples of OwbCustomObjectInputStream


Examples of org.apache.webbeans.util.OwbCustomObjectInputStream

        oos.flush();
    }
   
    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
    {
        final ObjectInputStream inputStream = new OwbCustomObjectInputStream(in, WebBeansUtil.getCurrentClassLoader());
        this.eventType = (Type)inputStream.readObject();
        this.injectedBindings = (Annotation[])inputStream.readObject();

        this.webBeansContext = WebBeansContext.currentInstance();
    }
View Full Code Here

Examples of org.apache.webbeans.util.OwbCustomObjectInputStream

    }
   
    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
    {
        this.webBeansContext = WebBeansContext.currentInstance();
        final ObjectInputStream inputStream = new OwbCustomObjectInputStream(in, WebBeansUtil.getCurrentClassLoader());
        this.injectionClazz = (Type)inputStream.readObject();
        this.qualifierAnnotations = (Set<Annotation>)inputStream.readObject();
        this.injectionPointClazz = (Class<?>) inputStream.readObject();       
    }
View Full Code Here

Examples of org.apache.webbeans.util.OwbCustomObjectInputStream

            return ip.isTransient();
        }

        private void readObject(final ObjectInputStream inp) throws IOException, ClassNotFoundException
        {
            final OwbCustomObjectInputStream owbCustomObjectInputStream = new OwbCustomObjectInputStream(inp, WebBeansUtil.getCurrentClassLoader());
            type = Type.class.cast(owbCustomObjectInputStream.readObject());
            ip = InjectionPoint.class.cast(owbCustomObjectInputStream.readObject());
        }
View Full Code Here

Examples of org.apache.webbeans.util.OwbCustomObjectInputStream

    }
   
    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
    {
        webBeansContext = WebBeansContext.currentInstance();
        final ObjectInputStream inputStream = new OwbCustomObjectInputStream(in, WebBeansUtil.getCurrentClassLoader());
        injectionClazz = (Type)inputStream.readObject();
        qualifierAnnotations = (Set<Annotation>)inputStream.readObject();
        injectionPoint = (InjectionPoint) inputStream.readObject();
        parentCreationalContext = webBeansContext.getBeanManagerImpl().createCreationalContext(null); // TODO: check what we can do
    }
View Full Code Here

Examples of org.apache.webbeans.util.OwbCustomObjectInputStream

   
    @SuppressWarnings("unchecked")
    private void readObject(java.io.ObjectInputStream inp) throws IOException, ClassNotFoundException
    {

        ObjectInputStream in = new OwbCustomObjectInputStream(inp, WebBeansUtil.getCurrentClassLoader());

        Class<?> beanClass = (Class<?>)in.readObject();
        Set<Annotation> anns = new HashSet<Annotation>();
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        AnnotatedElementFactory annotatedElementFactory = webBeansContext.getAnnotatedElementFactory();

        while(!in.readObject().equals('~'))   // read throw-away '-' or '~' terminal delimiter.
        {
            Annotation ann = (Annotation) in.readObject()// now read the annotation.
            anns.add(ann);
        }
       
        //process annotations
        ownerBean = webBeansContext.getBeanManagerImpl().getBeans(beanClass, anns.toArray(new Annotation[anns.size()])).iterator().next();
        qualifierAnnotations = anns;
       
        // determine type of injection point member (0=field, 1=method, 2=constructor) and read...
        int c = in.readByte();
        if(c == 0)
        {
            String fieldName = in.readUTF();
            Field field = webBeansContext.getSecurityService().doPrivilegedGetDeclaredField(beanClass, fieldName);

            injectionMember = field;
           
            AnnotatedType<?> annotatedType = annotatedElementFactory.newAnnotatedType(beanClass);
            annotated = annotatedElementFactory.newAnnotatedField(field, annotatedType);
            injectionType = field.getGenericType();
           
        }
        else if(c == 1)
        {
            String methodName = in.readUTF();
            Class<?>[] parameters = (Class<?>[])in.readObject();
           
            Method method = webBeansContext.getSecurityService().doPrivilegedGetDeclaredMethod(beanClass, methodName, parameters);
            injectionMember = method;
           
            AnnotatedType<?> annotatedType = annotatedElementFactory.newAnnotatedType(beanClass);
            AnnotatedMethod<Object> am =  (AnnotatedMethod<Object>)annotatedElementFactory.
                                    newAnnotatedMethod((Method) injectionMember,annotatedType);
            List<AnnotatedParameter<Object>> annParameters = am.getParameters();

            annotated = annParameters.get(in.readByte());
            injectionType = annotated.getBaseType();
           
        }
        else if(c == 2)
        {
            Class<?>[] parameters = (Class<?>[])in.readObject();           
            try
            {
                injectionMember = beanClass.getConstructor(parameters);

            }
            catch(NoSuchMethodException e)
            {
                injectionMember = null;
            }

            AnnotatedType<Object> annotatedType = (AnnotatedType<Object>)annotatedElementFactory.newAnnotatedType(beanClass);
            AnnotatedConstructor<Object> am =  annotatedElementFactory
                                            .newAnnotatedConstructor((Constructor<Object>) injectionMember,annotatedType);
            List<AnnotatedParameter<Object>> annParameters = am.getParameters();

            annotated = annParameters.get(in.readByte());
            injectionType = annotated.getBaseType();
        }

        delegate = in.readBoolean();
        transientt = in.readBoolean();
        
    }
View Full Code Here

Examples of org.apache.webbeans.util.OwbCustomObjectInputStream

    }
   
    private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
    {
        webBeansContext = WebBeansContext.currentInstance();
        final ObjectInputStream inputStream = new OwbCustomObjectInputStream(in, WebBeansUtil.getCurrentClassLoader());
        injectionClazz = (Type)inputStream.readObject();
        qualifierAnnotations = (Set<Annotation>)inputStream.readObject();
        injectionPointClazz = (Class<?>) inputStream.readObject();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.