org.pipservices4.messaging.build.DefaultMessagingFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pip-services4-messaging Show documentation
Show all versions of pip-services4-messaging Show documentation
Messaging components for Pip.Services in Java
The newest version!
package org.pipservices4.messaging.build;
import org.pipservices4.components.refer.Descriptor;
import org.pipservices4.components.build.Factory;
import org.pipservices4.messaging.queues.MemoryMessageQueue;
/**
* Creates {@link MemoryMessageQueue} components by their descriptors.
* Name of created message queue is taken from its descriptor.
*
* @see Factory
* @see MemoryMessageQueue
*/
public class DefaultMessagingFactory extends Factory {
private static final Descriptor MemoryQueueDescriptor = new Descriptor("pip-services", "message-queue", "memory", "*", "1.0");
private static final Descriptor MemoryQueueFactoryDescriptor = new Descriptor("pip-services", "queue-factory", "memory", "*", "1.0");
/**
* Create a new instance of the factory.
*/
public DefaultMessagingFactory() {
super();
registerAsType(MemoryQueueFactoryDescriptor, MemoryMessageQueueFactory.class);
register(MemoryQueueDescriptor, (locator) -> {
Descriptor descriptor = (Descriptor) locator;
return new MemoryMessageQueue(descriptor.getName());
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy