Package org.apache.commons.proxy.exception

Examples of org.apache.commons.proxy.exception.ProxyFactoryException


                return Object.class;
            case 1:
                final Class superclass = superclasses[0];
                if( Modifier.isFinal( superclass.getModifiers() ) )
                {
                    throw new ProxyFactoryException(
                            "Proxy class cannot extend " + superclass.getName() + " as it is final." );
                }
                if( !hasSuitableDefaultConstructor( superclass ) )
                {
                    throw new ProxyFactoryException( "Proxy class cannot extend " + superclass.getName() +
                                                     ", because it has no visible \"default\" constructor." );
                }
                return superclass;
            default:
                final StringBuffer errorMessage = new StringBuffer( "Proxy class cannot extend " );
                for( int i = 0; i < superclasses.length; i++ )
                {
                    Class c = superclasses[i];
                    errorMessage.append( c.getName() );
                    if( i != superclasses.length - 1 )
                    {
                        errorMessage.append( ", " );
                    }
                }
                errorMessage.append( "; multiple inheritance not allowed." );
                throw new ProxyFactoryException( errorMessage.toString() );
        }
    }
View Full Code Here


                }
                return proxyClass.toClass( classLoader );
            }
            catch( CannotCompileException e )
            {
                throw new ProxyFactoryException( "Could not compile class.", e );
            }
        }
View Full Code Here

                }
                return proxyClass.toClass( classLoader );
            }
            catch( CannotCompileException e )
            {
                throw new ProxyFactoryException( "Could not compile class.", e );
            }
        }
View Full Code Here

            return clazz.getConstructor( new Class[]{ ObjectProvider.class } )
                    .newInstance( new Object[]{ targetProvider } );
        }
        catch( Exception e )
        {
            throw new ProxyFactoryException( "Unable to instantiate proxy from generated proxy class.", e );
        }
    }
View Full Code Here

            return clazz.getConstructor( new Class[]{ Method[].class, Object.class, Interceptor.class } )
                    .newInstance( new Object[]{ methods, target, interceptor } );
        }
        catch( Exception e )
        {
            throw new ProxyFactoryException( "Unable to instantiate proxy class instance.", e );
        }
    }
View Full Code Here

            return clazz.getConstructor( new Class[]{ Method[].class, Invoker.class } )
                    .newInstance( new Object[]{ methods, invoker } );
        }
        catch( Exception e )
        {
            throw new ProxyFactoryException( "Unable to instantiate proxy from generated proxy class.", e );
        }
    }
View Full Code Here

                }
                return proxyClass.toClass( classLoader );
            }
            catch( CannotCompileException e )
            {
                throw new ProxyFactoryException( "Could not compile class.", e );
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.proxy.exception.ProxyFactoryException

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.