Package org.switchyard

Examples of org.switchyard.SwitchYardException


                encOut.write(encBytes);
            }
            encOut.flush();
            return encOut.toByteArray();
        } catch (Exception e) {
            throw new SwitchYardException(e);
        }
    }
View Full Code Here


                decOut.write(decBytes);
            }
            decOut.flush();
            return toSerializable(decOut.toByteArray());
        } catch (Exception e) {
            throw new SwitchYardException(e);
        }
    }
View Full Code Here

           
            try {
                Schema schema = schemaFactory.newSchema(foundSchemas.toArray(new Source[0]));
                _parserFactory.setSchema(schema);
            } catch (SAXException e) {
                throw new SwitchYardException(e);
            }
        }
    }
View Full Code Here

            validatingParser.parse(new InputSource(new StringReader(input)));
            if (errorHandler.validationFailed()) {
                return invalidResult(formatErrorMessage(errorHandler.getErrors()).toString());
            }
        } catch (SAXException e) {
            throw new SwitchYardException(e);
        } catch (ParserConfigurationException pce) {
            throw new SwitchYardException(pce);
        } catch (IOException ioe) {
            throw new SwitchYardException(ioe);
        }
        return validResult();
    }
View Full Code Here

        e_pre.fillInStackTrace();
        final HandlerException he1_pre = new HandlerException(e_pre);
        he1_pre.fillInStackTrace();
        final RuntimeException re_pre = new RuntimeException("re", he1_pre);
        re_pre.fillInStackTrace();
        final SwitchYardException sye_pre = new SwitchYardException("sye", re_pre);
        sye_pre.fillInStackTrace();
        final HandlerException he2_pre = new HandlerException("he", sye_pre);
        he2_pre.fillInStackTrace();
        // create message
        RemoteMessage msg = new RemoteMessage();
        msg.setContent(he2_pre);
        // serialize and deserialize
        msg = serDeser(msg, RemoteMessage.class);
        // get causes
        final HandlerException he2_post = (HandlerException)msg.getContent();
        final SwitchYardException sye_post = (SwitchYardException)he2_post.getCause();
        final RuntimeException re_post = (RuntimeException)sye_post.getCause();
        final HandlerException he1_post = (HandlerException)re_post.getCause();
        final Exception e_post = (Exception)he1_post.getCause();
        // test wrapper
        Assert.assertEquals(he2_pre.isWrapper(), he2_post.isWrapper());
        Assert.assertEquals(he1_pre.isWrapper(), he1_post.isWrapper());
        // test messages
        Assert.assertEquals(he2_pre.getMessage(), he2_post.getMessage());
        Assert.assertEquals(sye_pre.getMessage(), sye_post.getMessage());
        Assert.assertEquals(re_pre.getMessage(), re_post.getMessage());
        Assert.assertEquals(he1_pre.getMessage(), he1_post.getMessage());
        Assert.assertEquals(e_pre.getMessage(), e_post.getMessage());
        // test stack traces
        Assert.assertEquals(he2_pre.getStackTrace().length, he2_post.getStackTrace().length);
        Assert.assertEquals(sye_pre.getStackTrace().length, sye_post.getStackTrace().length);
        Assert.assertEquals(re_pre.getStackTrace().length, re_post.getStackTrace().length);
        Assert.assertEquals(he1_pre.getStackTrace().length, he1_post.getStackTrace().length);
        Assert.assertEquals(e_pre.getStackTrace().length, e_post.getStackTrace().length);
    }
View Full Code Here

     * @throws SwitchYardException if a service with the specified name does not exist
     */
    public void replaceService(QName name, ExchangeHandler handler) throws SwitchYardException {
        List<Service> services = getServiceDomain().getServices(name);
        if (services.isEmpty()) {
            throw new SwitchYardException("Failed to replace service: " + name
                    + ".  No service is registered with that name.");
        }
       
        // select the service to replace
        Service replacedService = services.get(0);
View Full Code Here

            if (validate) {
                returnModel.assertModelValid();
            }
            return returnModel;
        } catch (java.io.IOException ioEx) {
            throw new SwitchYardException("Failed to read switchyard config.", ioEx);
        }
    }
View Full Code Here

    }
   
    @Test
    public void nonExistentActivatorThrowsException() throws Exception {
        InputStream swConfigStream = null;
        SwitchYardException exception = null;
       
        // Load an app config which references a mock component, but provide no activator
        try {
            swConfigStream = Classes.getResourceAsStream("/switchyard-config-activator-01.xml", getClass());
            Deployment deployment = new Deployment(swConfigStream);
View Full Code Here

TOP

Related Classes of org.switchyard.SwitchYardException

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.