Implémenter la fonction de rappel dans JNI en utilisant l'interface

J'ai besoin pour mettre en œuvre fonction de rappel en Java à l'aide de “interface”. J'ai écrit l'application de la partie comme MyJavaFunction(int size, m_GetSizeInterface);

m_GetSizeInterface est une Interface qui contient la fonction de rappel GetSize. Cette méthode GetSize est de remplacer dans l'application. Dans JNI j'ai besoin d'appeler une RPC fonction ayant prototype int MyCPPFunction(int size, int (*callback)(int* ID));

Comment puis-je passer ce GetSize comme paramètre à MyCPPFunction dans JNI? S'il vous plaît aider

public int GetSize (m_SizeClass arg0)
{
    g_size = arg0.size;
        return 0;
}

source d'informationauteur indira | 2011-07-19