Example usage for com.liferay.portal.kernel.messaging Destination register

List of usage examples for com.liferay.portal.kernel.messaging Destination register

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.messaging Destination register.

Prototype

public boolean register(MessageListener messageListener);

Source Link

Usage

From source file:com.liferay.osb.scv.internal.messaging.SourceUserMapperMessagingConfigurator.java

License:Open Source License

@Activate
protected void activate(BundleContext bundleContext) {
    _bundleContext = bundleContext;/* w  w  w.j  a v  a 2 s  .co  m*/

    DestinationConfiguration destinationConfiguration = new DestinationConfiguration(
            DestinationConfiguration.DESTINATION_TYPE_PARALLEL, "liferay/scv_source");

    Destination destination = _destinationFactory.createDestination(destinationConfiguration);

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    properties.put("destination.name", destination.getName());

    _destinationServiceRegistration = bundleContext.registerService(Destination.class, destination, properties);

    destination.register(new SourceUserMapperMessageListener());
}

From source file:com.liferay.osb.scv.user.mapper.internal.messaging.UserMapperMessagingConfigurator.java

License:Open Source License

@Activate
protected void activate(BundleContext bundleContext) {
    _bundleContext = bundleContext;/*from  ww w .j ava2 s .  c  o  m*/

    DestinationConfiguration destinationConfiguration = new DestinationConfiguration(
            DestinationConfiguration.DESTINATION_TYPE_PARALLEL, UserMapperDestinationNames.SCV_USER_MAPPER);

    Destination destination = _destinationFactory.createDestination(destinationConfiguration);

    Dictionary<String, Object> properties = new HashMapDictionary<>();

    properties.put("destination.name", destination.getName());

    _destinationServiceRegistration = bundleContext.registerService(Destination.class, destination, properties);

    destination.register(new UserMapperMessageListener());
}