Package org.apache.hivemind

Examples of org.apache.hivemind.ApplicationRuntimeException


                continue;

            AttributeModel keyAm = em.getAttributeModel(key);

            if (keyAm == null)
                throw new ApplicationRuntimeException("Key attribute \'" + key + "\' of element \'"
                        + em.getElementName() + "\' never declared.", em.getLocation(), null);
        }
    }
View Full Code Here


            Method m = findMethod(parent, methodName, parameterTypes);

            m.invoke(parent, parameters);
        }
        catch (InvocationTargetException ex) {
            throw new ApplicationRuntimeException(RulesMessages.errorInvokingMethod(
                    methodName,
                    parent,
                    getLocation(),
                    ex.getTargetException()), getLocation(), ex.getTargetException());
        } catch (Exception ex)
        {
            throw new ApplicationRuntimeException(RulesMessages.errorInvokingMethod(
                    methodName,
                    parent,
                    getLocation(),
                    ex), getLocation(), ex);
        }
View Full Code Here

                try
                {
                    interceptor = c.newInstance(new Object[] { interceptorStack.getServiceLog(), interceptorStack.peek() });
                }
                catch (Exception e) {
                    throw new ApplicationRuntimeException(e);
                }
                interceptorStack.push(interceptor);
            }};
        InterceptorDefinition interceptor = new InterceptorDefinitionImpl(module, "hivemind.LoggingInterceptor", module.getLocation(), constructor);
        sp.addInterceptor(interceptor);
View Full Code Here

      theMethod.setBody("return \"Hello, World!\";");
      theClass.addMethod(theMethod);
      Class clazz = theClass.toClass();
      return ( BeanInterface )clazz.newInstance();
    } catch (Exception e) {
      throw new ApplicationRuntimeException("Cannot construct instance.",
          e);
    }
  }
View Full Code Here

            return core;
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ServiceModelMessages.unableToConstructService(
                    getServicePoint(),
                    ex), ex);
        }
    }
View Full Code Here

        ImplementationConstructionContext context = new ImplementationConstructionContextImpl(definingModule,
                _servicePoint);
        Object result = constructor.constructCoreServiceImplementation(context);

        if (result == null)
            throw new ApplicationRuntimeException(ServiceModelMessages
                    .factoryReturnedNull(_servicePoint), constructor.getLocation(), null);

        // The factory should provice something that either implements the service interface
        // or the declared interface. Again, they are normally the same, but with services
        // defined in terms of a class (not an interface), the service interface is
        // synthetic, and the declared interface is the actual class.

        if (!(serviceInterface.isInstance(result) || declaredInterface.isInstance(result)))
            throw new ApplicationRuntimeException(ServiceModelMessages.factoryWrongInterface(
                    _servicePoint,
                    result,
                    serviceInterface), constructor.getLocation(), null);

        HiveMind.setLocation(result, constructor.getLocation());
View Full Code Here

            return intercepted;
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ServiceModelMessages.unableToConstructService(
                    _servicePoint,
                    ex), ex);
        }

    }
View Full Code Here

            return new PooledService(core);
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ServiceModelMessages.unableToConstructService(
                    getServicePoint(),
                    ex), ex);
        }
    }
View Full Code Here

            Object result = _factoryMethod.invoke(_moduleInstanceProvider.getModuleInstance(), (Object[]) null);
            return result;
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ex.getMessage(), getLocation(), ex);
        }
    }
View Full Code Here

            return result;
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ServiceMessages.failureBuildingService(
                    _serviceId,
                    ex), _parameter.getLocation(), ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ApplicationRuntimeException

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.