Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * JBoss, Home of Professional Open Source
  * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.jboss.weld.serialization.spi;

Support services related to proxy generation and serialization which are required to be implemented by all containers.

These services are used by all Weld proxy classes to ensure the correct class loaders are used and to aid in the serialization and deserialization of these classes across container instances.

Required in all environments since proxies are always in use. A default implementation will be used if none are provided by the container which will use the information directly from the type of proxy.

ProxyServices is a per-deployment service.

David Allen
public interface ProxyServices extends Service {
Returns the class loader that will load the proxy class which extends or implements the given type. This class loader may simply be the same class loader used for the type, or it may be another class loader designed to hold proxies while still providing access to the given type and any of its ancestors and used types.

proxiedBeanType the base type (class or interface) being proxied
the class loader to use for the proxy class
    ClassLoader getClassLoader(Class<?> proxiedBeanType);


Loads classes or interfaces extended/implemented by a bean or in particular a proxy class for a bean. This includes application types of the bean as well as Weld types used for proxy classes. Thus the class loader(s) used here must be able to resolve both application classes and Weld implementation classes.

This method is only called during deserialization of a proxy object. It does not necessarily need to use the same class loader that the proxy class itself exists in since getClassLoader(java.lang.Class) will still be used to get the correct class loader for the bean type.

className the class name
the corresponding Class object
    Class<?> loadBeanClass(String className);
New to GrepCode? Check out our FAQ X