本文整理汇总了Java中org.axonframework.serialization.Serializer类的典型用法代码示例。如果您正苦于以下问题:Java Serializer类的具体用法?Java Serializer怎么用?Java Serializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Serializer类属于org.axonframework.serialization包,在下文中一共展示了Serializer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: messageSourceApiGateway
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Bean
public SpringAMQPMessageSource messageSourceApiGateway(Serializer serializer) {
return new SpringAMQPMessageSource(new DefaultAMQPMessageConverter(serializer)) {
@RabbitListener(queues = "${spring.application.queue}")
@Override
public void onMessage(Message message, Channel channel) throws Exception {
super.onMessage(message, channel);
}
};
}
开发者ID:weechang,项目名称:Taroco,代码行数:12,代码来源:RabbitConfiguration.java
示例2: appendEvents
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
public void appendEvents(Bucket bucket, List<? extends EventMessage<?>> events, Serializer serializer) {
List<JsonObject> jsonObjects = createEventDocuments(events, serializer).collect(Collectors.toList());
jsonObjects.forEach((e) -> {
String docId = EVENT_PREFIX + e.getString("aggregateIdentifier");
if (!bucket.exists(docId)) {
JsonArray eventArray = JsonArray.empty()
.add(e);
JsonObject data = JsonObject.empty()
.put("events", eventArray);
JsonDocument doc = JsonDocument.create(docId, data);
bucket.insert(doc);
} else {
bucket.mutateIn(docId)
.arrayAppend("events", e, false)
.execute();
}
});
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:21,代码来源:DocumentPerAggregateStorageStrategy.java
示例3: EventEntry
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
/**
* Constructor used to create a new event entry to store in Mongo.
*
* @param event The actual DomainEvent to store
* @param serializer Serializer to use for the event to store
*/
EventEntry(DomainEventMessage<?> event, Serializer serializer) {
this.aggregateType = event.getType();
this.aggregateIdentifier = event.getAggregateIdentifier();
this.sequenceNumber = event.getSequenceNumber();
this.eventIdentifier = event.getIdentifier();
Class<?> serializationTarget = String.class;
if (serializer.canSerializeTo(JsonObject.class)) {
serializationTarget = JsonObject.class;
}
SerializedObject<?> serializedPayloadObject = serializePayload(event, serializer, serializationTarget);
SerializedObject<?> serializedMetaDataObject = serializeMetaData(event, serializer, serializationTarget);
this.serializedPayload = serializedPayloadObject.getData();
this.payloadType = serializedPayloadObject.getType().getName();
this.payloadRevision = serializedPayloadObject.getType().getRevision();
this.serializedMetaData = serializedMetaDataObject.getData();
this.timeStamp = event.getTimestamp().toString();
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:25,代码来源:EventEntry.java
示例4: myMessageSource
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Bean
public SpringAMQPMessageSource myMessageSource(Serializer serializer, EventHandlingConfiguration ehConfig) {
return new SpringAMQPMessageSource(serializer) {
@RabbitListener(queues = "${camunda.bpm.cloud.amqp.queue.event}")
@Override
public void onMessage(Message message, Channel channel) throws Exception {
log.info("receiving event: {}#{}", message, channel);
super.onMessage(message, channel);
}
};
}
开发者ID:holisticon,项目名称:camunda-bpm-cloud,代码行数:12,代码来源:WorkloadQueryServiceApplication.java
示例5: CouchbaseEventStoreEngine
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
public CouchbaseEventStoreEngine(Serializer serializer,
EventUpcaster upcasterChain,
PersistenceExceptionResolver persistenceExceptionResolver,
Integer batchSize,
CouchbaseStoreStrategy storageStrategy,
CouchbaseTemplate template) {
super(serializer, upcasterChain, persistenceExceptionResolver, batchSize);
this.storageStrategy = storageStrategy;
this.template = template;
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:11,代码来源:CouchbaseEventStoreEngine.java
示例6: appendEvents
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
protected void appendEvents(List<? extends EventMessage<?>> events, Serializer serializer) {
if (!events.isEmpty()) {
try {
storageStrategy.appendEvents(template.getEventBucket(), events, serializer);
} catch (Exception e) {
handlePersistenceException(e, events.get(0));
}
}
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:11,代码来源:CouchbaseEventStoreEngine.java
示例7: storeSnapshot
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) {
try {
storageStrategy.appendSnapshot(template.getSnapshotBucket(), snapshot, serializer);
} catch (Exception e) {
handlePersistenceException(e, snapshot);
}
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:9,代码来源:CouchbaseEventStoreEngine.java
示例8: TokenEntry
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
public TokenEntry(String process, int segment, TrackingToken tokenBuffer, Serializer serializer) {
SerializedObject<byte[]> serializedToken = serializer.serialize(tokenBuffer, byte[].class);
this.processorName = process;
this.segment = segment;
this.tokenBuffer = ByteBuffer.wrap(serializedToken.getData());
this.tokenType = serializedToken.getType().getName();
this.timeStamp = new Date();
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:9,代码来源:TokenEntry.java
示例9: CassandraTokenStore
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
public CassandraTokenStore(Session session, Serializer serializer, TokenSchema schema) {
if (session == null) {
throw new IllegalArgumentException("Parameter 'session' cannot be null");
}
MappingManager mappingManager = new MappingManager(session);
this.tokenMapper = mappingManager.mapper(TokenEntry.class);
this.serializer = getOrDefault(serializer, XStreamSerializer::new);
this.schema = getOrDefault(schema, TokenSchema.builder().build());
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:10,代码来源:CassandraTokenStore.java
示例10: CassandraEventStorageEngine
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
public CassandraEventStorageEngine(Serializer serializer, EventUpcaster upcasterChain, PersistenceExceptionResolver persistenceExceptionResolver, Integer batchSize, Session session, EventSchema schema) {
super(serializer, upcasterChain, persistenceExceptionResolver, batchSize, session, schema);
this.counterSelectStatement = session.prepare("SELECT " + quoted(schema().valueColumn()) +
" FROM" + quoted(schema().countersTable()) +
" WHERE " + quoted(schema().nameColumn()) + " = ? LIMIT 1");
this.counterInsertStatement = session.prepare("INSERT INTO " + quoted(schema().countersTable()) +
" (" + quoted(schema().nameColumn(), schema().valueColumn()) + ")" +
" VALUES(?,?)");
Row globalIndexCounterRow = session.execute(counterSelectStatement.bind(GLOBAL_INDEX_COUNTER_NAME)).one();
this.globalIndexCounter = new AtomicLong(Optional.ofNullable(globalIndexCounterRow)
.map(row -> row.getLong(0))
.orElse(0L));
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:16,代码来源:CassandraEventStorageEngine.java
示例11: appendEvents
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
protected void appendEvents(List<? extends EventMessage<?>> events, Serializer serializer) {
events.stream()
.map(EventUtils::asDomainEventMessage)
.map(e -> asDomainEventEntry(e, serializer, globalIndexCounter.getAndIncrement()))
.map(this::storeEventLogEntry)
.map(eventMapper::saveQuery)
.forEachOrdered(batch()::add);
batch().add(counterInsertStatement.bind(GLOBAL_INDEX_COUNTER_NAME, globalIndexCounter.get()));
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:11,代码来源:CassandraEventStorageEngine.java
示例12: DefaultAxonMessageSerializer
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
public DefaultAxonMessageSerializer(Serializer delegate, EventUpcasterChain eventUpcasterChain) {
this.delegate = new MessageSerializer(delegate);
upcasterChain = eventUpcasterChain;
}
开发者ID:flux-capacitor-io,项目名称:flux-capacitor-client,代码行数:5,代码来源:DefaultAxonMessageSerializer.java
示例13: createEventDocuments
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
protected Stream<JsonObject> createEventDocuments(List<? extends EventMessage<?>> events, Serializer serializer) {
return events.stream()
.map(EventUtils::asDomainEventMessage)
.map(event -> new EventEntry(event, serializer))
.map(entry -> entry.asJsonObject());
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:7,代码来源:DocumentPerAggregateStorageStrategy.java
示例14: appendSnapshot
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
public void appendSnapshot(Bucket bucket, DomainEventMessage<?> snapshot, Serializer serializer) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
开发者ID:haxorof,项目名称:axon-couchbase,代码行数:5,代码来源:DocumentPerAggregateStorageStrategy.java
示例15: trackingToken
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
public TrackingToken trackingToken(Serializer serializer) {
SimpleSerializedObject<byte[]> serializedObject =
new SimpleSerializedObject<>(tokenBuffer != null ? tokenBuffer.array() : null, byte[].class, new SimpleSerializedType(tokenType, null));
return serializer.deserialize(serializedObject);
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:6,代码来源:TokenEntry.java
示例16: asDomainEventEntry
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
private static DomainEventEntry asDomainEventEntry(DomainEventMessage<?> eventMessage, Serializer serializer, long globalIndex) {
return new DomainEventEntry(globalIndex, eventMessage, serializer);
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:4,代码来源:CassandraEventStorageEngine.java
示例17: asSnapshotEventEntry
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
private static SnapshotEventEntry asSnapshotEventEntry(DomainEventMessage<?> eventMessage, Serializer serializer) {
return new SnapshotEventEntry(eventMessage, serializer);
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:4,代码来源:CassandraEventStorageEngine.java
示例18: storeSnapshot
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) {
batch().add(snapshotMapper.saveQuery(asSnapshotEventEntry(snapshot, serializer)));
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:5,代码来源:CassandraEventStorageEngine.java
示例19: appendEvents
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
protected void appendEvents(List<? extends EventMessage<?>> events, Serializer serializer) {
throw new UnsupportedOperationException();
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:5,代码来源:CassandraReadOnlyEventStorageEngine.java
示例20: storeSnapshot
import org.axonframework.serialization.Serializer; //导入依赖的package包/类
@Override
protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) {
throw new UnsupportedOperationException();
}
开发者ID:lion7,项目名称:axon-cassandra,代码行数:5,代码来源:CassandraReadOnlyEventStorageEngine.java
注:本文中的org.axonframework.serialization.Serializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论