Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2012, Red Hat, Inc., 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.weld.annotated.slim;
Marker interface for lightweight implementations of javax.enterprise.inject.spi.AnnotatedType.

Parameters:
<T> the type
Author(s):
Jozef Hartinger
public interface SlimAnnotatedType<T> extends AnnotatedType<T>, Identified<AnnotatedTypeIdentifier> {

    
Clear up cached content to save memory. Called after bootstrap is complete.
    void clear();
    public static class SerializationProxy<X> implements Serializable {
        private static final long serialVersionUID = 6800705438537396237L;
        private final AnnotatedTypeIdentifier identifier;
        public SerializationProxy(AnnotatedTypeIdentifier identifier) {
            this. = identifier;
        }
        private Object readResolve() throws ObjectStreamException {
            SlimAnnotatedType<?> type = Container.instance().services().get(ClassTransformer.class).getSlimAnnotatedTypeById();
            if (type == null) {
                type = tryToLoadUnknownBackedAnnotatedType();
            }
            if (type == null) {
                throw ..annotatedTypeDeserializationFailure();
            }
            return type;
        }
        /*
         * It may in theory happen that an app calls BeanManager.createAnnotatedType() for a previously unknown class on node1 and then
         * stores this annotated type in session. On node2, this annotated type is not know. We'll try to load it.
         */
            if (.getSuffix() != null || .isModified()) {
                return null// this is not a backed annotated type
            }
            // first, obtain the BeanManager for a given BDA
            final BeanManagerImpl manager = Container.instance().activityManager(.getBdaId());
            if (manager == null) {
                return null;
            }
            // second, try to load the class
            final ResourceLoader resourceLoader = manager.getServices().get(ResourceLoader.class);
            Class<?> clazz = null;
            try {
                clazz = resourceLoader.classForName(.getClassName());
            } catch (ResourceLoadingException e) {
                ..catchingDebug(e);
                return null;
            }
            // finally, try to load the annotated type
            try {
                return manager.getServices().get(ClassTransformer.class).getBackedAnnotatedType(clazz.getBdaId());
            } catch (ResourceLoadingException e) {
                ..catchingDebug(e);
                return null;
            }
        }
    }
New to GrepCode? Check out our FAQ X