Package org.crank.core

Examples of org.crank.core.CrankException


        this.useProperties.clear();
        this.map = null;
    try {
      prototype = type.newInstance();
    } catch (Exception e) {
      throw new CrankException(e, "Unable to instantiate class=%s", type);
    }
        MessageManagerUtils.getCurrentInstance().addStatusMessage("Bulk update complete.");
    }
View Full Code Here


                    if (addToParentMethod == null) {
                        if (childCollection instanceof Collection) {
                            Collection col = (Collection) childCollection;
                            col.add( child );
                        } else {
                            throw new CrankException(methodNotFoundException, "Unable to add child %s to parent %s because %s",
                                    child, parent, methodNotFoundException.getMessage());
                        }
                    }
                    return;
                }
            }

            /*
             * Invoke the addMethod on parent passing the child as an argument.
             */               
            addToParentMethod.invoke(parent, new Object[]{child});                   
           
        } catch (Exception ex) {
            /* If there are any problems throw a nested exception. */
            throw new CrankException(ex, "Unable to add child to parent");
        }
    }
View Full Code Here

                            col.remove( child );
                            logger.debug(String.format("After child removed from collection = %s",col));
   
                        } else {
                            logger.debug("The object retrieved was not a Collection so we will throw the original exception's stack");
                            throw new CrankException(methodNotFoundException, "Unable to remove child %s from parent %s because %s",
                                    child, parent, methodNotFoundException.getMessage());
                        }
                        return;
                    }
                }
            }
            /*
             * Invoke the removeMethod on parent passing the child as an argument.
             */
            removeFromParentMethod.invoke(parent, new Object[]{child});           
        } catch (Exception ex) {
            /* If there are any problems throw a nested exception. */
            throw new CrankException(ex, "Unable to remove child");
        }
    }
View Full Code Here

            }

            CrudManagedObject cmo = managedObjects.get(capKey);

            if (cmo==null) {
                throw new CrankException("Can't find managed object for key %s in %s", capKey, managedObjects);
            }
           
           try {
                deferredResourceCreator.createResource(map, cmo);
           } catch (Exception ex) {
               try {
                deferredResourceCreator.createResource(map,  cmo);
               } catch(Exception ex2)  {
                   throw new CrankException(ex, "Problem getting resource out of map key=%s message=%s ex type=%s", key, ex.getMessage(), ex.getClass().getName());
               }
           }
        }
        return (V) map.get(key);
    }
View Full Code Here

TOP

Related Classes of org.crank.core.CrankException

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.