當前位置: 首頁>>代碼示例>>Java>>正文


Java JIFlags類代碼示例

本文整理匯總了Java中org.jinterop.dcom.core.JIFlags的典型用法代碼示例。如果您正苦於以下問題:Java JIFlags類的具體用法?Java JIFlags怎麽用?Java JIFlags使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JIFlags類屬於org.jinterop.dcom.core包,在下文中一共展示了JIFlags類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addGroup

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public AddGroupResult addGroup(String name, boolean active, int requestedUpdateRate, int clientGroup, Integer timeBias, Float percentDeadband, int lcid, String iid) throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(METHOD_INDEX_IOPCServer_AddGroup);
    callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsBoolean(active, JIFlags.FLAG_NULL);
    callObject.addInParamAsInt(requestedUpdateRate, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
    callObject.addInParamAsInt(clientGroup, JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(timeBias != null ? timeBias : new Integer(0)), JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(percentDeadband != null ? percentDeadband : new Float(0.0)), JIFlags.FLAG_NULL);
    callObject.addInParamAsInt(lcid, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL); //out param phServerGroup
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL); //out param pRevisedUpdateRate
    callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL); // out param ppUnk
    Object[] result = comObject.call(callObject);
    if (callObject.isError())
        throw new JIException(callObject.getHRESULT());
    return new AddGroupResult(
            (Integer) result[0],
            (Integer) result[1],
            JIObjectFactory.narrowObject((IJIComObject) result[2]));
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:24,代碼來源:IOPCServer.java

示例2: getState

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public GroupState getState() throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(0);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Boolean.class, JIFlags.FLAG_NULL);
    callObject.addOutParamAsObject(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Float.class, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);

    Object[] result = comObject.call(callObject);

    GroupState state = new GroupState();
    state.setUpdateRate((Integer) result[0]);
    state.setActive((Boolean) result[1]);
    state.setName(((JIString) ((JIPointer) result[2]).getReferent()).getString());
    state.setTimeBias((Integer) result[3]);
    state.setPercentDeadband((Float) result[4]);
    state.setLocaleId((Integer) result[5]);
    state.setClientHandle((Integer) result[6]);
    state.setServerHandle((Integer) result[7]);
    return state;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:27,代碼來源:IOPCGroupStateMgt.java

示例3: setState

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public Integer setState(GroupState state) throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(1);

    callObject.addInParamAsPointer(new JIPointer(state.getUpdateRate()), JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
    if (state.isActive() != null)
        callObject.addInParamAsPointer(new JIPointer(Integer.valueOf(state.isActive().booleanValue() ? 1 : 0)), JIFlags.FLAG_NULL);
    else
        callObject.addInParamAsPointer(new JIPointer(null), JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(state.getTimeBias()), JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(state.getPercentDeadband()), JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(state.getLocaleId()), JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(state.getClientHandle()), JIFlags.FLAG_NULL);

    Object[] result = comObject.call(callObject);

    return (Integer) result[0];
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:21,代碼來源:IOPCGroupStateMgt.java

示例4: getSimpleStruct

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public void getSimpleStruct(String[] args)
    throws JIException, InterruptedException, UnknownHostException {

    JICallBuilder callObject = new JICallBuilder( true);
    callObject.setOpnum(12); //obtained from the IDL or TypeLib. //
    Object results[];

    JIStruct struct = new JIStruct();
    struct.addMember(Integer.class);
    struct.addMember(Double.class);
    struct.addMember(Float.class);
    callObject.addOutParamAsObject(new JIPointer(struct), JIFlags.FLAG_NULL);

    results = comObject.call(callObject);
    System.out.println(results[0]);
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:17,代碼來源:SampleTestServer.java

示例5: getEmptyStruct

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public static JIStruct getEmptyStruct() throws JIException
{
    JIStruct struct = new JIStruct();
    struct.addMember(new FileTime().getStruct()); //ftStartTime
    struct.addMember(new FileTime().getStruct()); //ftCurrentTime
    struct.addMember(new FileTime().getStruct()); //ftLastUpdateTime
    struct.addMember(Short.class); //dwServerState
    struct.addMember(Integer.class); //dwGroupCount
    struct.addMember(Integer.class); //dwBandWidth
    struct.addMember(Short.class); //wMajorVersion
    struct.addMember(Short.class); //wMinorVersion
    struct.addMember(Short.class); //wBuildNumber
    struct.addMember(Short.class); //wReserved
    struct.addMember(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR))); //szVendorInfo
    return struct;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:17,代碼來源:OPCSERVERSTATUS.java

示例6: next

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public int next ( final List<UUID> list, final int num ) throws JIException
{
    if ( num <= 0 )
    {
        return 0;
    }

    JICallBuilder callObject = new JICallBuilder ( true );
    callObject.setOpnum ( 0 );

    callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL );
    callObject.addInParamAsInt ( num, JIFlags.FLAG_NULL );
    callObject.addOutParamAsObject ( new JIArray ( UUID.class, null, 1, true, true ), JIFlags.FLAG_NULL );
    callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );

    Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );

    UUID[] resultData = (UUID[]) ( (JIArray)result[0] ).getArrayInstance ();
    Integer cnt = (Integer)result[1];

    for ( int i = 0; i < cnt; i++ )
    {
        list.add ( resultData[i] );
    }
    return cnt;
}
 
開發者ID:luoyan35714,項目名稱:OPC_Client,代碼行數:27,代碼來源:EnumGUID.java

示例7: browseOPCItemIDs

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public IEnumString browseOPCItemIDs(short browseType, String filterCriteria, short dataTypeFilter, int accessRightsFilter) throws JIException {
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(2);

    callObject.addInParamAsShort(browseType, JIFlags.FLAG_NULL);
    callObject.addInParamAsString(filterCriteria, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsShort((short) dataTypeFilter, JIFlags.FLAG_NULL);
    callObject.addInParamAsInt(accessRightsFilter, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);

    Object result[];
    try {
        result = comObject.call(callObject);
    } catch (JIException ex) {
        if (ex.getErrorCode() == 1 /*S_FALSE*/) {
            result = callObject.getResultsInCaseOfException();
        } else {
            throw ex;
        }
    }

    return new IEnumString(JIObjectFactory.narrowObject((IJIComObject) result[0]));
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:24,代碼來源:IOPCBrowseServerAddressSpace.java

示例8: GetStruct

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public void GetStruct(String[] args)
    throws JIException, InterruptedException, UnknownHostException {

    JICallBuilder callObject = new JICallBuilder( true);
    callObject.setOpnum(10); //obtained from the IDL or TypeLib. //
    Object results[];

    // change the struct to have the array as the last item
    JIStruct struct = new JIStruct();
    JIArray longArray = new JIArray(Integer.class, new int[]{50},1,false);
    struct.addMember(Integer.class);
    struct.addMember(Float.class);
    struct.addMember(longArray);
    callObject.addOutParamAsObject(new JIPointer(struct), JIFlags.FLAG_NULL);

    results = comObject.call(callObject);
    System.out.println(results[0]);
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:19,代碼來源:SampleTestServer.java

示例9: queryAvailableLocaleIDs

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public int[] queryAvailableLocaleIDs() throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);

    callObject.setOpnum(METHOD_INDEX_IOPCCommon_QueryAvailableLocaleIDs);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
    callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
    Object[] result = comObject.call(callObject);
    if (callObject.isError())
        throw new JIException(callObject.getHRESULT());
    Integer count = (Integer) result[0];
    if (count == null)
        throw new NullPointerException("Count is null");
    int[] availLocales = new int[count];
    Integer[] returned = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
    for (int i = 0; i < count; i++)
        availLocales[i] = returned[i];
    return availLocales;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:20,代碼來源:IOPCCommon.java

示例10: getEmptyStruct

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public static JIStruct getEmptyStruct() throws JIException
{
    JIStruct struct = new JIStruct();
    struct.addMember(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));//szAccessPath
    struct.addMember(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));//szItemID
    struct.addMember(Boolean.class);//bActive
    struct.addMember(Integer.class);//hClient
    struct.addMember(Integer.class);//hServer
    struct.addMember(Integer.class);//dwAccessRights
    struct.addMember(Integer.class);//dwBlobSize
    struct.addMember(new JIPointer(new JIArray(Byte.class, null, 1, true, false))); //pBlob
    struct.addMember(Short.class);//vtRequestedDataType
    struct.addMember(Short.class);//vtCanonicalDataType
    struct.addMember(Integer.class);//dwEUType
    struct.addMember(JIVariant.class);//vEUInfo
    return struct;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:18,代碼來源:OPCITEMATTRIBUTES.java

示例11: removeItems

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public Map<Integer, Integer> removeItems(Integer[] serverHandles) throws JIException {
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(2);
    callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
    callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
    callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);

    Object[] result;
    try {
        result = comObject.call(callObject);
    } catch (JIException ex) {
        if (ex.getErrorCode() == 1 /*S_FALSE*/) {
            result = callObject.getResultsInCaseOfException();
        } else {
            throw ex;
        }
    }

    Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
    Map<Integer, Integer> map = new HashMap<>();
    for (int i = 0; i < serverHandles.length; i++) {
        map.put(serverHandles[i], errorCodes[i]);
    }
    return map;
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:26,代碼來源:IOPCItemMgt.java

示例12: GetSimpleArrayStruct

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public void GetSimpleArrayStruct(String[] args)
    throws JIException, InterruptedException, UnknownHostException {

  JICallBuilder callObject = new JICallBuilder( true);
  callObject.setOpnum(19); //obtained from the IDL or TypeLib. //
  Object results[];

  JIStruct simpleStruct = new JIStruct();
  simpleStruct.addMember(Integer.class);
  simpleStruct.addMember(Double.class);
  simpleStruct.addMember(Float.class);

  JIStruct simpleArrayStruct = new JIStruct();
  simpleArrayStruct.addMember(Integer.class);
  simpleArrayStruct.addMember(Double.class);
  simpleArrayStruct.addMember(JIUnsignedShort.class);
  JIArray structArray = new JIArray(simpleStruct, null, 1, true);
  simpleArrayStruct.addMember(new JIPointer(structArray));

  callObject.addOutParamAsObject(new JIPointer(simpleArrayStruct), JIFlags.FLAG_NULL);

  results = comObject.call(callObject);
  System.out.println(results[0]);

}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:26,代碼來源:SampleTestServer.java

示例13: getTCharArray

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public void getTCharArray()
    throws JIException, InterruptedException, UnknownHostException {
    System.gc();
    JICallBuilder callObject = new JICallBuilder( true);
    callObject.setOpnum(6);
    Object results[];

    callObject.addOutParamAsObject(new JIArray(Byte.class, new int[]{50},1,false), JIFlags.FLAG_NULL);
    results = comObject.call(callObject);

    JIArray arrayOfResults = (JIArray)results[0];
    Byte[] arrayOfBytes = (Byte[]) arrayOfResults.getArrayInstance();
    int length = 50;
    for (int i = 0; i < length; i++) {
      System.out.println(arrayOfBytes[i].byteValue());
    }
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:18,代碼來源:SampleTestServer.java

示例14: getNames

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public Object[] getNames(int memberId, int maxNames) throws JIException
	{
		JICallBuilder callObject = new JICallBuilder(true);
		callObject.setOpnum(4);

		//for experiment only
//		JIArray arry = new JIArray(new Integer[]{new Integer(100),new Integer(200)},true);
//		JIStruct struct = new JIStruct();
//		struct.addMember(Short.valueOf((short)86));
//		struct.addMember(arry);
//		callObject.addInParamAsStruct(struct,JIFlags.FLAG_NULL);


		callObject.addInParamAsInt(memberId,JIFlags.FLAG_NULL);
		callObject.addInParamAsInt(maxNames,JIFlags.FLAG_NULL);

		callObject.addOutParamAsObject(new JIArray(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),null,1,true,true),JIFlags.FLAG_NULL);
		callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);

		return comObject.call(callObject);
	}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:22,代碼來源:JITypeInfoImpl.java

示例15: getLibAttr

import org.jinterop.dcom.core.JIFlags; //導入依賴的package包/類
public void getLibAttr() throws JIException
{
	JICallBuilder callObject = new JICallBuilder(true);
	callObject.setOpnum(4);

	JIStruct tlibattr = new JIStruct();
	tlibattr.addMember(UUID.class);
	tlibattr.addMember(Integer.class);
	tlibattr.addMember(Integer.class);
	tlibattr.addMember(Short.class);
	tlibattr.addMember(Short.class);
	tlibattr.addMember(Short.class);

	callObject.addOutParamAsObject(new JIPointer(tlibattr),JIFlags.FLAG_NULL);
	callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);//CLEANUPSTORAGE
	Object[] result = comObject.call(callObject);
	int i = 0;
}
 
開發者ID:howie,項目名稱:jinterop,代碼行數:19,代碼來源:JITypeLibImpl.java


注:本文中的org.jinterop.dcom.core.JIFlags類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。