Package com.atlassian.xmlrpc

Examples of com.atlassian.xmlrpc.BindingException


    public <T> T bind( Class<T> bindClass, URL url, ConnectionInfo connectionInfo )
        throws BindingException
    {
        if ( !bindClass.isInterface() )
        {
            throw new BindingException( "Class " + bindClass.getName() + "is not an interface" );
        }
        ServiceObject serviceObject = bindClass.getAnnotation( ServiceObject.class );
        if ( serviceObject == null )
        {
            throw new BindingException( "Could not find ServiceObject annotation on " + bindClass.getName() );
        }
        final XmlRpcClient client = getXmlRpcClient( url, connectionInfo );

        XmlRpcInvocationHandler handler = new XmlRpcInvocationHandler( new XmlRpcClientProvider()
        {
            public Object execute( String serviceName, String methodName, Vector arguments )
                throws BindingException
            {
                try
                {
                    return client.execute( serviceName + "." + methodName, arguments );
                }
                catch ( XmlRpcException e )
                {
                    throw new BindingException( e );
                }
            }
        } );

        return (T) Proxy.newProxyInstance( getClass().getClassLoader(), new Class[]{bindClass}, handler );
View Full Code Here

TOP

Related Classes of com.atlassian.xmlrpc.BindingException

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.