Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) 2010-2011. Axon Framework
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.axonframework.contextsupport.spring;
The JpaEventStoreBeanDefinitionParser is responsible for parsing the eventStore element form the Axon namespace. It creates a org.springframework.beans.factory.config.BeanDefinition based either on a org.axonframework.eventstore.jpa.JpaEventStore or on a org.axonframework.eventstore.fs.FileSystemEventStore, depending on the selected configuration.

Author(s):
Ben Z. Tels
Allard Buijze
Rob van der Linden Vooren
Since:
0.7
the event serializer attribute.
    private static final String EVENT_SERIALIZER_ATTRIBUTE = "event-serializer";
    private static final String DATA_SOURCE_ATTRIBUTE = "data-source";
    private static final String PERSISTENCE_EXCEPTION_RESOLVER_ATTRIBUTE = "persistence-exception-resolver";
    private static final String MAX_SNAPHOTS_ARCHIVED_ATTRIBUTE = "max-snapshots-archived";
    private static final String BATCH_SIZE_ATTRIBUTE = "batch-size";

    
    @Override
    protected Class<?> getBeanClass(Element element) {
        return JpaEventStore.class;
    }

    
    @Override
    protected void doParse(Element elementParserContext parserContextBeanDefinitionBuilder builder) {
        if (element.hasAttribute()) {
            builder.addConstructorArgReference(element.getAttribute());
        }
        if (element.hasAttribute()) {
            builder.addPropertyReference("dataSource"element.getAttribute());
        }
            builder.addPropertyReference("persistenceExceptionResolver"element.getAttribute(
                    ));
        }
        if (element.hasAttribute()) {
            builder.addPropertyValue("maxSnapshotsArchived"element.getAttribute());
        }
        if (element.hasAttribute()) {
            builder.addPropertyValue("batchSize"element.getAttribute());
        }
    }
New to GrepCode? Check out our FAQ X