Package org.impalaframework.exception

Examples of org.impalaframework.exception.InvalidStateException


  private K castKeyName(Object keyName) {
    K contributionKeyName = null;
    try {
      contributionKeyName = (K) keyName;
    } catch (RuntimeException e) {
      throw new InvalidStateException("key " + contributionKeyName + " could not be cast to the correct type", e);
    }
    return contributionKeyName;
  }
View Full Code Here


  private V castBean(Object beanObject) {
    V bean = null;
    try {
      bean = (V) beanObject;
    } catch (ClassCastException e) {
      throw new InvalidStateException("bean " + beanObject + " coudld not be cast to the correct type", e);
    }
    return bean;
  }
View Full Code Here

                if (exists) {
                   
                    stream = bundleResource.getInputStream();
                   
                    if (stream == null) {
                        throw new InvalidStateException("Unable to get stream when attempting to install bundle from resource: " + bundleResource.getDescription());
                    }
                   
                    bundle = bundleContext.installBundle(bundleLocation, stream);
                }
            }
View Full Code Here

                if (bundleResource.exists()) {
               
                    stream = bundleResource.getInputStream();
               
                    if (stream == null) {
                        throw new InvalidStateException("Unable to get stream when attempting to update bundle '"
                                + bundle.getSymbolicName() + "' from resource: " + bundleResource.getDescription());
                    }
                   
                    bundle.update(stream);
                   
View Full Code Here

        return true;
    }

    public static void checkBundle(ModuleDefinition moduleDefinition, Bundle bundle) {
        if (bundle == null) {
            throw new InvalidStateException("Unable to find bundle with name corresponding with module '" + moduleDefinition + "'. Check to see whether this module installed properly.");
        }
    }
View Full Code Here

        if (logger.isDebugEnabled()) {
            logger.debug("Capturing root module definition from " + o);
        }
       
        if (!(o instanceof Serializable)) {
            throw new InvalidStateException("Attempting to inject non-serializable module definition class '" + o.getClass().getName() + "'");
        }

        final Object clone = clone(o);
        try {          
            rootModuleDefinition = ObjectUtils.cast(clone, RootModuleDefinition.class);
View Full Code Here

        operation.execute(input);

        ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(facade.getModuleStateHolder());

        if (context == null) {
            throw new InvalidStateException("Root application context is null");
        }
       
        if (!(context instanceof WebApplicationContext)) {
            throw new InvalidStateException("Application context " + context + " has class "
                    + context.getClass().getName() + " which is not an instance of "
                    + WebApplicationContext.class.getName());
        }

        return (WebApplicationContext) context;
View Full Code Here

            else {
                String parentName = parent.getName();
                newParent = newRootDefinition.findChildDefinition(parentName, true);

                if (newParent == null) {
                    throw new InvalidStateException("Unable to find parent module '" + parentName + "' in " + newRootDefinition);
                }
            }

            newParent.addChildModuleDefinition(moduleDefinition);
           
View Full Code Here

    operation.execute(input);

    ConfigurableApplicationContext context = facade.getModuleStateHolder().getRootModuleContext();

    if (context == null) {
      throw new InvalidStateException("Root application context is null");
    }
   
    if (!(context instanceof WebApplicationContext)) {
      throw new InvalidStateException("Application context " + context + " has class "
          + context.getClass().getName() + " which is not an instance of "
          + WebApplicationContext.class.getName());
    }

    return (WebApplicationContext) context;
View Full Code Here

                    TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, newRootDefinition);
                    TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
                    return transitionResultSet;
                }
                else {
                    throw new InvalidStateException("Module to remove does not have a parent module. "
                            + "This is unexpected state and may indicate a bug");
                }
            }
        }
        return new TransitionResultSet();
View Full Code Here

TOP

Related Classes of org.impalaframework.exception.InvalidStateException

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.