Package org.apache.ivory

Examples of org.apache.ivory.IvoryException


            Unmarshaller unmarshaller = entityType.getUnmarshaller();
            T entity = (T) unmarshaller.unmarshal(xmlStream);
            LOG.info("Parsed Entity: " + entity.getName());
            return entity;
        } catch(Exception e) {
            throw new IvoryException(e);
        }
    }
View Full Code Here


                        + " for cluster: " + clusterName);
            }
        } catch (ValidationException e) {
            throw new ValidationException(e);
        } catch (Exception e) {
            throw new IvoryException(e);
        }
    }
View Full Code Here

                        onAdd(entity);
                    }
                }
            }
        } catch (IOException e) {
            throw new IvoryException("Unable to restore configurations", e);
        }
    }
View Full Code Here

            if (get(type, entity.getName()) != null) {
                persist(type, entity);
                Entity oldEntity = dictionary.get(type).put(entity.getName(), entity);
                onChange(oldEntity, entity);
            } else {
                throw new IvoryException(entity.toShortString() + " doesn't exist");
            }
        } catch (IOException e) {
            throw new StoreAccessException(e);
        }
        AUDIT.info(type + "/" + entity.getName() + " is replaced into config store");
View Full Code Here

    public synchronized void update(EntityType type, Entity entity) throws IvoryException {
        if (updatesInProgress.get() == entity) {
            updateInternal(type, entity);
        } else {
            throw new IvoryException(entity.toShortString() + " is not initialized for update");
        }
    }
View Full Code Here

        }
    }

    public synchronized void initiateUpdate(Entity entity) throws IvoryException {
        if (get(entity.getEntityType(), entity.getName()) == null || updatesInProgress.get() != null) {
            throw new IvoryException("An update for " + entity.toShortString() + " is already in progress or doesn't exist");
        }
        updatesInProgress.set(entity);
    }
View Full Code Here

    public static <T> T getInstance(String classKey) throws IvoryException {
        String clazzName = StartupProperties.get().getProperty(classKey);
        try {
            return ReflectionUtils.<T>getInstanceByClassName(clazzName);
        } catch (IvoryException e) {
            throw new IvoryException("Unable to get instance for key: " + classKey, e);
        }
    }
View Full Code Here

            } catch (IllegalAccessException e) {
                Method method = clazz.getMethod("get");
                return (T) method.invoke(null);
            }
        } catch (Exception e) {
            throw new IvoryException("Unable to get instance for " + clazzName, e);
        }
    }
View Full Code Here

                    Properties origProps = new Properties();
                    origProps.load(resource);
                    if(domain == null) {
                        domain = origProps.getProperty("*.domain");
                        if(domain == null)
                            throw new IvoryException("Domain is not set!");
                    }
                    LOG.info("Initializing properties with domain " + domain);
                   
                    Set<String> keys = getKeys(origProps.keySet());
                    for(String key:keys) {
                        String value = origProps.getProperty(domain + "." + key, origProps.getProperty("*." + key));
                        value = ExpressionHelper.substitute(value);
                        LOG.debug(key + "=" + value);
                        put(key, value);
                    }
                } finally {
                    resource.close();
                }
            }
        } catch (Exception e) {
            throw new IvoryException(e);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public <T> T evaluateFullExpression(String expression, Class<T> clazz) throws IvoryException {
        try {
            return (T) EVALUATOR.evaluate(expression, clazz, resolver, resolver);
        } catch (ELException e) {
            throw new IvoryException("Unable to evaluate " + expression, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ivory.IvoryException

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.