com.microsoft.azure.gateway.core.LocalBroker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gateway-java-binding Show documentation
Show all versions of gateway-java-binding Show documentation
Azure IoT Gateway SDK Java Module Binding
The newest version!
/*
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
package com.microsoft.azure.gateway.core;
import com.microsoft.azure.gateway.messaging.Message;
class LocalBroker {
// Loads the native library
static {
System.loadLibrary("java_module_host");
}
//Private Native Methods
/**
* Native Broker_Publish function. When this method is called, it will call into the native Broker_Publish
* function to publish the provided {@link Message} to the native Broker.
*
* @see Message broker documentation
*
* @param brokerAddr The address of the pointer to the native Broker.
* @param moduleAddr The address of the pointer to the native module.
* @param message The serialized {@link Message} to be published.
* @return 0 on success, non-zero otherwise.
*/
native int publishMessage(long brokerAddr, long moduleAddr, byte[] message);
}