Dets the proxy class to use for generic collection classes implementing the {@link java.util.Collection} interface.

@param collectionProxyClass The proxy class
166338
public void setCollectionProxyClass(Class collectionProxyClass)
    {
        _collectionProxyConstructor = retrieveCollectionProxyConstructor(collectionProxyClass, Collection.class, "CollectionProxyClass");
        // we also require the class to be a subclass of ManageableCollection
        if(!ManageableCollection.class.isAssignableFrom(collectionProxyClass))
        {
            throw new MetadataException("Illegal class "
                    + collectionProxyClass.getName()
                    + " specified for CollectionProxyClass. Must be a concrete subclass of "
                    + ManageableCollection.class.getName());
        }
    }
231835
public static void proxy(Class<?> declaringClass, String methodName, InvocationHandler invocationHandler) {
		assertInvocationHandlerNotNull(invocationHandler);
		if (declaringClass == null) {
			throw new IllegalArgumentException("declaringClass cannot be null");
		}
		if (methodName == null || methodName.length() == 0) {
			throw new IllegalArgumentException("methodName cannot be empty");
		}
		Method[] methods = Whitebox.getMethods(declaringClass, methodName);
		if (methods.length == 0) {
			throw new MethodNotFoundException(String.format("Couldn't find a method with name %s in the class hierarchy of %s", methodName,
					declaringClass.getName()));
		} else if (methods.length > 1) {
			throw new TooManyMethodsFoundException(String.format("Found %d methods with name %s in the class hierarchy of %s.", methods.length,
					methodName, declaringClass.getName()));
		}

		MockRepository.putMethodProxy(methods[0], invocationHandler);
	}
973167
protected void checkProxyPrefetchingLimit(DefBase def, String checkLevel) throws ConstraintException
    {
        if (CHECKLEVEL_NONE.equals(checkLevel))
        {
            return;
        }
        if (def.hasProperty(PropertyHelper.OJB_PROPERTY_PROXY_PREFETCHING_LIMIT))
        {
            if (!def.hasProperty(PropertyHelper.OJB_PROPERTY_PROXY))
            {
                if (def instanceof ClassDescriptorDef)
                {
                    LogHelper.warn(true,
                                   ConstraintsBase.class,
                                   "checkProxyPrefetchingLimit",
                                   "The class "+def.getName()+" has a proxy-prefetching-limit property but no proxy property");
                }
                else
                {    
                    LogHelper.warn(true,
                                   ConstraintsBase.class,
                                   "checkProxyPrefetchingLimit",
                                   "The feature "+def.getName()+" in class "+def.getOwner().getName()+" has a proxy-prefetching-limit property but no proxy property");
                }
            }
    
            String propValue = def.getProperty(PropertyHelper.OJB_PROPERTY_PROXY_PREFETCHING_LIMIT);
    
            try
            {
                int value = Integer.parseInt(propValue);
    
                if (value < 0)
                {
                    if (def instanceof ClassDescriptorDef)
                    {
                        throw new ConstraintException("The proxy-prefetching-limit value of class "+def.getName()+" must be a non-negative number");
                    }
                    else
                    {    
                        throw new ConstraintException("The proxy-prefetching-limit value of the feature "+def.getName()+" in class "+def.getOwner().getName()+" must be a non-negative number");
                    }
                }
            }
            catch (NumberFormatException ex)
            {
                if (def instanceof ClassDescriptorDef)
                {
                    throw new ConstraintException("The proxy-prefetching-limit value of the class "+def.getName()+" is not a number");
                }
                else
                {    
                    throw new ConstraintException("The proxy-prefetching-limit value of the feature "+def.getName()+" in class "+def.getOwner().getName()+" is not a number");
                }
            }
        }
    }
620008
private void collectReceiver(final Class<?> eventClass, final Collection<ReceiverDescriptor> receiverCollection) {

		if (this.receiverMap.get(eventClass) != null) {
			receiverCollection.addAll(this.receiverMap.get(eventClass));
		}
		if (!eventClass.isInterface() && eventClass.getSuperclass() != Object.class) {
			this.collectReceiver(eventClass.getSuperclass(), receiverCollection);
		}
		for (final Class interfaceClass : eventClass.getInterfaces()) {
			this.collectReceiver(interfaceClass, receiverCollection);
		}
	}
878193
@Override
	public Object intercept(Object object, Method method, Object[] args,
			MethodProxy methodProxy) throws Throwable {
		Method delegateMethod = delegateClass.getMethod(method.getName(),
				method.getParameterTypes());
		if ("registerBeanDefinition".equals(method.getName())) {
			if (beanDefinitionMap.containsKey(args[0])) {
				List<BeanDefinition> definitions = beanDefinitionMap
						.get(args[0]);
				definitions.add((BeanDefinition) args[1]);
			} else {
				List<BeanDefinition> beanDefinitions = new ArrayList<BeanDefinition>();
				beanDefinitions.add((BeanDefinition) args[1]);
				beanDefinitionMap.put((String) args[0], beanDefinitions);
			}
		}
		return delegateMethod.invoke(delegate, args);
	}
955150
public ProxyBuilder<T> withInterface(Class<?> interfaceClass, Object interfaceImpl) {
    this.interfacesToImplementations.put(interfaceClass, interfaceImpl);
    return this;
  }
277207
@Deprecated
    public Class<?> getClassFromCollection(final String collection) {
        final Set<MappedClass> mcs = mappedClassesByCollection.get(collection);
        if (mcs == null || mcs.isEmpty()) {
            throw new MappingException(format("The collection '%s' is not mapped to a java class.", collection));
        }
        if (mcs.size() > 1) {
            if (LOG.isInfoEnabled()) {
                LOG.info(format("Found more than one class mapped to collection '%s'%s", collection, mcs));
            }
        }
        return mcs.iterator().next().getClazz();
    }
963810
public JsTopicControls getJsTopicControlsFromProxyClass(Class<?> proxy) {
		Class<?> realClass = unProxyClassServices.getRealClass(proxy);
		return realClass.getAnnotation(JsTopicControls.class);
	}
867661
@Override
  public <T> void createCollection(Class<T> entityClass) {
    createCollection(Util.determineCollectionName(entityClass));
  }
534651
@SuppressWarnings("unchecked")
    protected <A> A createProxy(Class<A> cl, Expression<?> path) {
        Enhancer enhancer = new Enhancer();
        enhancer.setClassLoader(AliasFactory.class.getClassLoader());
        if (cl.isInterface()) {
            enhancer.setInterfaces(new Class<?>[] {cl, ManagedObject.class});
        } else {
            enhancer.setSuperclass(cl);
            enhancer.setInterfaces(new Class<?>[] {ManagedObject.class});
        }
        // creates one handler per proxy
        MethodInterceptor handler = new PropertyAccessInvocationHandler(path, this, pathFactory, typeSystem);
        enhancer.setCallback(handler);
        return (A) enhancer.create();
    }
1047654
public static <K, T extends Collection<K>> Collection<K> instantiateCollectionType(Class<T> collectionType) {
        return instantiateCollectionType(collectionType, DEFAULT_COLLECTION_SIZE);
    }
209182
@SuppressWarnings("unchecked")
    public static <T> T createProxyObject(Class<T> proxyClass) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(proxyClass);
        enhancer.setCallback(new InvokeInterceptor(proxyClass));
        return (T) enhancer.create();
    }
198302
public <T> T forService(Class<T> serviceClazz, ClientErrorMapper errorMapper) {
    // noinspection unchecked
    return (T)
        proxyMap.computeIfAbsent(
            serviceClazz,
            (clazz) -> {
              Map<Method, MethodInfo> methods = Reflect.methodsInfo(serviceClazz);
              return Proxy.newProxyInstance(
                  serviceClazz.getClassLoader(),
                  new Class[] {serviceClazz},
                  new RemoteInvocationHandler(transport, methods, codec, errorMapper));
            }
896320
@SuppressWarnings("unchecked")
    public <T> T proxy(final Object delegate, Class<?> [] interfaces)
    {
        return (T)Proxy.newProxyInstance
            (delegate.getClass().getClassLoader(),
             interfaces,
             new ProxyInvocationHandler(delegate));
    }
655713
public static <T> T buildProxy(String proxyType, Class<T> clazz, Invoker proxyInvoker) throws Exception {
        try {
            ExtensionClass<Proxy> ext = ExtensionLoaderFactory.getExtensionLoader(Proxy.class)
                .getExtensionClass(proxyType);
            if (ext == null) {
                throw ExceptionUtils.buildRuntime("consumer.proxy", proxyType,
                    "Unsupported proxy of client!");
            }
            Proxy proxy = ext.getExtInstance();
            return proxy.getProxy(clazz, proxyInvoker);
        } catch (SofaRpcRuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new SofaRpcRuntimeException(e.getMessage(), e);
        }
    }
514368
@SuppressWarnings("unchecked")
    static <T, A extends BindingCollectionAdapter<T>> A createClass(Class<? extends BindingCollectionAdapter> adapterClass, ItemBinding<T> itemBinding) {
        try {
            return (A) adapterClass.getConstructor(ItemBinding.class).newInstance(itemBinding);
        } catch (Exception e1) {
            throw new RuntimeException(e1);
        }
    }
1174256
public <T> void dereference(T instance, Class<T> type, Annotation qualifier)
            throws ProviderMissingException {
        if (uiThreadRunner.isOnUiThread()) {

        } else {
            uiThreadRunner.post(new Runnable() {
                @Override
                public void run() {

                }
            });
        }

        graph.dereference(instance, type, qualifier, Inject.class);
    }