Package org.axonframework.common

Examples of org.axonframework.common.AxonConfigurationException


   @Test
    public void testSingleSagaLifeCycle_NonTransientFailure() throws InterruptedException {
        final StubInMemorySagaRepository spy = spy(sagaRepository);
        testSubject.setSagaRepository(spy);
        Exception failure = new RuntimeException("Mockexception",
                                                 new AxonConfigurationException("Faking a wrong config"));
        doThrow(failure).when(spy).add(isA(Saga.class));
        doThrow(failure).when(spy).commit(isA(Saga.class));
        testSubject.start();
        assertEquals(0, sagaRepository.getKnownSagas());
        for (EventMessage message : createSimpleLifeCycle("one", "two", true)) {
View Full Code Here


        public void execute(Runnable command) {
            final StartDetectingRunnable task = new StartDetectingRunnable(command);
            delegate.execute(task);
            try {
                if (!task.awaitStarted(timeoutMillis, TimeUnit.MILLISECONDS)) {
                    throw new AxonConfigurationException("It seems that the given Executor is not providing a thread "
                                                                 + "for the AsyncSagaManager. Ensure that the "
                                                                 + "corePoolSize is larger than the processor count.");
                }
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
View Full Code Here

        SagaEventHandler handlerAnnotation = handlerMethod.getAnnotation(SagaEventHandler.class);
        String associationPropertyName = handlerAnnotation.associationProperty();
        Property associationProperty = PropertyAccessStrategy.getProperty(methodHandler.getPayloadType(),
                                                                          associationPropertyName);
        if (associationProperty == null) {
            throw new AxonConfigurationException(format("SagaEventHandler %s.%s defines a property %s that is not "
                                                                + "defined on the Event it declares to handle (%s)",
                                                        methodHandler.getMethod().getDeclaringClass().getName(),
                                                        methodHandler.getMethodName(), associationPropertyName,
                                                        methodHandler.getPayloadType().getName()
            ));
View Full Code Here

     */
    public static Digester newInstance(String algorithm) {
        try {
            return new Digester(MessageDigest.getInstance(algorithm));
        } catch (NoSuchAlgorithmException e) {
            throw new AxonConfigurationException("This environment doesn't support the MD5 hashing algorithm", e);
        }
    }
View Full Code Here

     */
    public static String md5Hex(String input) {
        try {
            return newMD5Instance().update(input.getBytes("UTF-8")).digestHex();
        } catch (UnsupportedEncodingException e) {
            throw new AxonConfigurationException("The UTF-8 encoding is not available on this environment", e);
        }
    }
View Full Code Here

        boolean hasSelectors = parseClusterSelector(element, parserContext, clusterId);
        boolean hasDefault = parseDefaultSelector(element, parserContext, clusterId);

        if (!hasSelectors && !hasDefault) {
            throw new AxonConfigurationException(
                    "Cluster with id '" + clusterId + "' is not a default cluster, nor defines any selectors");
        }
        if (DomUtils.getChildElementByTagName(element, REPLAY_ELEMENT) != null) {
            return wrapInReplayingCluster(DomUtils.getChildElementByTagName(element, REPLAY_ELEMENT), clusterBean);
        }
View Full Code Here

            if (item.hasAttribute(CHECK_SUPERCLASS_ATTRIBUTE)) {
                builder.addConstructorArgValue(item.getAttribute(CHECK_SUPERCLASS_ATTRIBUTE));
            }
            return builder.getBeanDefinition();
        }
        throw new AxonConfigurationException("No Cluster Selector known for element '" + item.getLocalName() + "'.");
    }
View Full Code Here

        String property = properties.getProperty(key);

        List<Integer> keyCodes = new ArrayList<Integer>();

        if (property == null) {
            throw new AxonConfigurationException(String.format(
                    "The database product name '%s' is unknown. No SQLCode configuration is known for that database.",
                    databaseProductName));
        }
        String[] codes = property.split(LIST_SEPARATOR);
        for (String code : codes) {
View Full Code Here

        InputStream resources = null;
        try {
            resources = SQLErrorCodesResolver.class.getResourceAsStream(SQL_ERROR_CODES_PROPERTIES);
            properties.load(resources);
        } catch (IOException e) {
            throw new AxonConfigurationException("Unable to read from a file that should be ", e);
        } finally {
            IOUtils.closeQuietly(resources);
        }
        return properties;
    }
View Full Code Here

     */
    public JodaDeserializer(Class<T> instantType) {
        try {
            this.constructor = instantType.getConstructor(Object.class);
        } catch (NoSuchMethodException e) {
            throw new AxonConfigurationException(
                    "The type " + instantType.getName() + " isn't compatible with the JodaDeserializer", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.axonframework.common.AxonConfigurationException

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.