java µ÷¶È datastage Ö®jna
ͨ¹ýjava jna µ÷ÓÃdatastage c api Àý×ÓÈçÏ£¬ÕâÊÇÔËÐÐ×÷ÒµµÄÀý×Ó
¾²âÊÔÊÇ¿ÉÐеġ£
import com.sun.jna.Library;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import com.sun.jna.Native;
/** Simple example of native library declaration and usage. */
public class dsjobc {
public static class time_t extends Structure {
public int value;
public time_t() {}
public time_t(int value) {
this.value = value;
}
}
public static class DSPROJECT extends Structure{
public int dsapiVersionNo;
public int sessionId;
public byte valueMark;
public byte fieldMark;
}
public static class DSJOB extends Structure{
public DSPROJECT hProject; /* Reference to project handle for job */
String serverJobHandle; /* Text of handle to job on server */
String logData; /* Cached log summary data */
int logDataLen; /* Size of log summary data */
int logDataPsn; /* Current position in logData */
}
public static class DSparamValue extends Union{
String pString;
String pEncrypt;
int pInt;
float PFloat;
String pPath;
String pDate;
String pTime;
}
public static class DSPARAM extends Structure{
int paramType;
}
public interface libvmdsapi extends Library {
libvmdsapi INSTANCE = (libvmdsapi)Native.loadLibrary("vmdsapi",libvmdsapi.class);
public DSPROJECT DSOpenProjectEx(int serial,String pro);
public DSJOB DSOpenJob(DSPROJECT pro,String job);
public int DSLockJob(DSJOB job);
public int DSRunJob(DSJOB job, int flag);
// public int DSGetJobInfo(DSJOB job, int flag, DSJOBINFO info);
public int DSSetParam(DSJOB job, String str, DSPARAM pam);
}
public static void main(String[] argv) {
DSPROJECT proj;
DSJOB dsjob;
// DSJOBINFO info;
proj=libvmdsapi.INSTANCE.DSOpenProjectEx(1,"B610_ODSB");
dsjob=libvmdsapi.INSTANCE.DSOpenJob(proj,"ss");
int lock= libvmdsapi.INSTANCE.DSLockJob(dsjob);
// int jofs= libvmdsapi.INSTANCE.DSGet
Ïà¹ØÎĵµ£º
ÀëÆßÔµÄÌì¿ÕÔ½À´Ô½½üÁË£¬ÎÒËƺõÄܹ»¸ÐÊܵõ½ÎÒµÄÀíÏëÔÚÂýÂýµÄ¿¿½üÎÒ£¬´ËʱÎÒÒѾÓÐЩÐË·ÜÁË¡£
´ÓÅàѵJavaÈí¼þ¹¤³Ìʦµ½ÏÖÔÚÒѾÓÐ5¸ö¶àÔÂÁË£¬¿´×ÅÉí±ßµÄʦÐÖÃǸ÷¸ö¶¼ÄÃ×Å×Ô¼º¾«ÐÄÖÆ×÷µÄ¼òÀúÈ¥ÃæÊÔµÄʱºò£¬ÎÒÒ²¿ªÊ¼¾²¾²µÄ¹æ»®ÆðÁËÎÒµÄÈËÉú·¡£Ï£Íûͨ¹ýÕâ¸öÄܹ»Ö¸ÒýÎÒ×ߵĸüºÃ£¬Ò²Ï£Íû×Ô¼ºÄܹ»ÔçÈÕʵÏÖ×Ô¼ºµÄÃÎÏë--½«À´ÓÐÒ»¼ ......
½ñÌìÍí·¹³Ô¶àÁË£¬¶Ç×ÓÄÑÊÜ£¬¾ÍÈ¥±±´óÀïÃæ¹äÁ˹䣬²»Öª²»¾õÀ´µ½ÁËδÃûºþ±ß£¬ÓеãÀÛÁË£¬ÔÚºþ±ßÕÒÁ˸ö³¤ÒÎÌÉÁËһϣ¬·¿´ÊÖ»úµÄµç»°²¾£¬·¢ÏֺöàÅóÓѺþÃûÓÐÁªÏµÁË£¬ÉõÖÁÓÐЩ¶¼ÒѾÍü¼ÇÁËËûÃǵÄÑù×Ó£¬ÓÐЩÃû×Ö¶¼ÈÃÎҸе½ÓеãÄ°ÉúÁË£¬²»ÖªµÀËûÃÇ»¹ÊÇ·ñ¼ÇµÃÎÒ£¡
&nbs ......
¶ÔÓÚJAVA±à³ÌºÍºÜ¶àÀàËÆC¡¢C++ÓïÑÔÓÐÒ»¸ö¾Þ´óÇø±ð¾ÍÊÇÄÚ´æ²»ÐèÒª×Ô¼ºÈ¥free»òÕßdelete£¬¶øÊÇÓÉJVMÀ¬»ø»ØÊÕ»úÖÆÈ¥Íê³ÉµÄ¡£¶ÔÓÚÕâ¸ö¹ý³ÌºÜ¶àÈËÒ»Ö±±È½ÏãȻ»òÕß¾õµÃºÜÖÇÄÜ£¬Ê¹µÃÔÚд³ÌÐòµÄ¹ý³Ì²»Ì«¿¼ÂÇËüµÄ¸ÐÊÜ£¬Æäʵ֪µÀһЩÄÚÔÚµÄÔÀí£¬°ïÖúÎÒÃDZàд¸ü¼ÓÓÅÐãµÄ´úÂëÊǷdz£ÓбØÒªµÄ¡£
±¾ÎÄ´ÓÒÔϼ¸¸ö·½Ãæ½øÐвûÊö£º
......
Java rmi
1. RMI¸ÅÊö
RMI(Remote Method Invocation)
RMIÊÇ·Ö²¼Ê½¶ÔÏóÈí¼þ°ü£¬Ëü¼ò»¯ÁËÔÚ¶ą̀¼ÆËã»úÉϵÄJAVAÓ¦ÓóÌÐòÖ®¼äµÄͨÐÅ¡£
java rmi°ü±ØÐëÔÚjdk1.1ÒÔÉÏ
RMIʹÓõ½µÄÀà
java.rmi.Remote
ËùÓпÉÒÔ±»Ô¶³Ìµ÷ÓõĶÔÏ󶼱ØÐëʵÏָýӿÚ
java.rmi.server.UnicastRemoteObject
ËùÓпÉÒÔ±»Ô ......
Ò»¡¢ºËÐĸÅÄî
1.ʲô½ÐÀࣿ
Àà¾ÍÊÇijһÖÖÊÂÎïµÄÒ»°ãÐԵļ¯ºÏÌ壬ÊÇÏàͬ»òÏàËƵĸ÷¸öÊÂÎﹲͬÌØÐÔµÄÒ»ÖÖ³éÏó¡£
2.ʲô½Ð¶ÔÏó£¿
ÔÚÃæÏò¶ÔÏó¸ÅÄîÖУ¬¶ÔÏó£¨Object£©ÊÇÀàµÄʵÀý£¨instance£©¡£¶ÔÏóÓëÀàµÄ¹Øϵ¾ÍÏñ±äÁ¿ÓëÊý¾ÝÀàÐ͵ĹØϵһÑù¡£
3.ÀàµÄºËÐÄÌØÐÔÓÐÄÄЩ£¿
Àà¾ßÓзâ×°ÐÔ¡¢¼Ì³ÐÐԺͶà̬ÐÔ¡£
·â×°ÐÔ£º
ÀàµÄ·â×°ÐÔ ......