Package com.cedarsolutions.exception

Examples of com.cedarsolutions.exception.CedarRuntimeException


        if (!this.contextMap.containsKey(clazz.getName())) {
            try {
                JAXBContext context = JAXBContext.newInstance(clazz);
                this.contextMap.put(clazz.getName(), context);
            } catch (Exception e) {
                throw new CedarRuntimeException("Error obtaining JAXB context: " + e.getMessage(), e);
            }
        }

        return this.contextMap.get(clazz.getName());
    }
View Full Code Here


            StringWriter writer = new StringWriter();
            marshaller.marshal(value, writer);
            return writer.toString();
        } catch (JAXBException e) {
            throw new CedarRuntimeException("Error marshalling XML: " + e.getMessage(), e);
        }
    }
View Full Code Here

            JAXBContext context = this.getJaxbContext(type);
            SchemaResolver resolver = new SchemaResolver();
            context.generateSchema(resolver);
            return resolver.getWriter().toString();
        } catch (IOException e) {
            throw new CedarRuntimeException("Error generating schema: " + e.getMessage(), e);
        }
    }
View Full Code Here

                return (T) ois.readObject();
            } finally {
                ois.close();
            }
        } catch (Exception e) {
            throw new CedarRuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

                return new String(Base64.encodeBase64(baos.toByteArray()));
            } finally {
                oos.close();
            }
        } catch (Exception e) {
            throw new CedarRuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

     */
    public static Object parseJsonString(String jsonString, String className) {
        try {
            return getGson().fromJson(jsonString, Class.forName(className));
        } catch (ClassNotFoundException e) {
            throw new CedarRuntimeException("Could not find class: " + className);
        }
    }
View Full Code Here

                return new CommandLineResult(process.exitValue(), output.toString());
            } else {
                return new CommandLineResult(process.exitValue());
            }
        } catch (Exception e) {
            throw new CedarRuntimeException("Failed to execute command: " + e.getMessage(), e);
        }
    }
View Full Code Here

        case SINGLE_LINE:
            return ToStringBuilder.reflectionToString(obj, SINGLE_LINE_STYLE);
        case MULTI_LINE:
            return ToStringBuilder.reflectionToString(obj, MULTI_LINE_STYLE);
        default:
            throw new CedarRuntimeException("Unknown string style: " + stringStyle);
        }
    }
View Full Code Here

    public void sendMessage(Message message) {
        try {
            // This method can't really be unit tested, because we can't mock Transport.
            Transport.send(message);
        } catch (Exception e) {
            throw new CedarRuntimeException("Failed to send message: " + e.getMessage(), e);
        }
    }
View Full Code Here

     */
    public InternetAddress createInternetAddress(EmailAddress address) {
        try {
            return createInternetAddress(address.getAddress(), address.getName());
        } catch (NullPointerException e) {
            throw new CedarRuntimeException("Unable to create internet address: " + e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of com.cedarsolutions.exception.CedarRuntimeException

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.