本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.addInParamAsArray方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.addInParamAsArray方法的具體用法?Java JICallBuilder.addInParamAsArray怎麽用?Java JICallBuilder.addInParamAsArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.addInParamAsArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: read
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ReadResult read(Integer[] serverHandles, int transactionId) throws JIException //TODO retval
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsInt(transactionId, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
Integer cancelId = (Integer) result[0];
Integer[] errors = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
Map<Integer, Integer> errorCodes = new HashMap<>();
for (int i = 0; i < serverHandles.length; i++) {
errorCodes.put(serverHandles[i], errors[i]);
}
return new ReadResult(cancelId, errorCodes);
}
示例2: setConformantIntArray
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void setConformantIntArray()
throws JIException, InterruptedException, UnknownHostException {
System.gc();
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(9);
Object results[];
int i = 4;
Integer[] intAry = new Integer[i];
for(int j = 0; j < i; j++) {
intAry[j] = new Integer(j);
}
JIArray ary = new JIArray(intAry, true);
callObject.addInParamAsInt(i, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(ary, JIFlags.FLAG_NULL);
results = comObject.call(callObject);
}
示例3: write
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public Map<Integer, Integer> write(Integer[] serverHandles, JIVariant[] values) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(values, 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> codes = new HashMap<>();
for (int i = 0; i < serverHandles.length; i++) {
codes.put(serverHandles[i], errorCodes[i]);
}
return codes;
}
示例4: removeItems
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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;
}
示例5: remove
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultSet<Integer> remove ( final Integer... serverHandles ) throws JIException
{
if ( serverHandles.length == 0 )
{
return new ResultSet<Integer> ();
}
final 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 );
final Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject );
final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
final ResultSet<Integer> results = new ResultSet<Integer> ( serverHandles.length );
for ( int i = 0; i < serverHandles.length; i++ )
{
results.add ( new Result<Integer> ( serverHandles[i], errorCodes[i] ) );
}
return results;
}
示例6: releaseItemHandles
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, Void> releaseItemHandles(Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles), 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();
ResultTable<Integer, Void> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], null, errorCodes[i]);
}
return resultTable;
}
示例7: write
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ReadResult write(Integer[] serverHandles, JIVariant[] values, int transactionId) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(values, true), JIFlags.FLAG_NULL);
callObject.addInParamAsInt(transactionId, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, 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 cancelId = (Integer) result[0];
Integer[] errors = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
Map<Integer, Integer> errorCodes = new HashMap<>();
for (int i = 0; i < serverHandles.length; i++) {
errorCodes.put(serverHandles[i], errors[i]);
}
return new ReadResult(cancelId, errorCodes);
}
示例8: SetStaticStruct
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void SetStaticStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(16); //obtained from the IDL or TypeLib.
Object results[];
JIUnsignedShort j;
Long value = new Long(10);
Integer shortValue = new Integer(5);
JIStruct varStruct = new JIStruct();
varStruct.addMember(JIUnsignedFactory.getUnsigned(value, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT));
varStruct.addMember(new Float(1.1));
varStruct.addMember(new Float(1.2));
varStruct.addMember(JIUnsignedFactory.getUnsigned(shortValue, JIFlags.FLAG_REPRESENTATION_UNSIGNED_SHORT));
varStruct.addMember(new Float(1.0));
varStruct.addMember(new Date());
varStruct.addMember(JIUnsignedFactory.getUnsigned(value, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT));
JIStruct pointStruct = new JIStruct();
pointStruct.addMember(JIUnsignedFactory.getUnsigned(new Long(15), JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT));
pointStruct.addMember(JIUnsignedFactory.getUnsigned(new Long(10), JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT));
pointStruct.addMember(new Byte((byte)1));
JIStruct[] varStructArray = new JIStruct[1];
varStructArray[0] = varStruct;
pointStruct.addMember(new JIPointer(new JIArray(varStructArray, true))); //since this is an embedded pointer
JIStruct[] pointAry = new JIStruct[1];
pointAry[0] = pointStruct;
JIArray ary = new JIArray(pointAry,true);
callObject.addInParamAsShort((short)1, JIFlags.FLAG_REPRESENTATION_UNSIGNED_SHORT);
callObject.addInParamAsArray(ary, JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println("SetStaticStruct worked!");
}
示例9: lookupItemIDs
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, String> lookupItemIDs(String itemId, int[] propertyIds) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(2);
callObject.addInParamAsString(itemId, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
callObject.addInParamAsInt(propertyIds.length, JIFlags.FLAG_NULL);
Integer[] idsArr = new Integer[propertyIds.length];
for (int i = 0; i < propertyIds.length; i++) {
idsArr[i] = propertyIds[i];
}
callObject.addInParamAsArray(new JIArray(idsArr), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), null, 1, true)), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(Integer.class, null, 1, true)), JIFlags.FLAG_NULL);
Object[] comResult;
try {
comResult = comObject.call(callObject);
} catch (JIException ex) {
if (ex.getErrorCode() == 1 /*S_FALSE*/) {
comResult = callObject.getResultsInCaseOfException();
} else {
throw ex;
}
}
JIPointer[] itemIDs = (JIPointer[]) ((JIArray) ((JIPointer) comResult[0]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) comResult[1]).getReferent()).getArrayInstance();
ResultTable<Integer, String> resultTable = new ResultTable<>();
for (int i = 0; i < propertyIds.length; i++) {
resultTable.put(propertyIds[i], ((JIString) itemIDs[i].getReferent()).getString(), errorCodes[i]);
}
return resultTable;
}
示例10: addItems
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<OPCITEMDEF, OPCITEMRESULT> addItems(OPCITEMDEF[] items) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(items.length, JIFlags.FLAG_NULL);
JIStruct[] structs = new JIStruct[items.length];
for (int i = 0; i < structs.length; i++) {
structs[i] = items[i].getStruct();
}
JIArray structsArr = new JIArray(structs, true);
callObject.addInParamAsArray(structsArr, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(OPCITEMRESULT.getEmptyStruct(), null, 1, 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;
}
}
JIStruct[] results = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
ResultTable<OPCITEMDEF, OPCITEMRESULT> resultTable = new ResultTable<>();
for (int i = 0; i < items.length; i++) {
resultTable.put(items[i], new OPCITEMRESULT(results[i]), errorCodes[i]);
}
return resultTable;
}
示例11: read
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public KeyedResultSet<Integer, OPCITEMSTATE> read ( final OPCDATASOURCE source, final Integer... serverHandles ) throws JIException
{
if ( serverHandles == null || serverHandles.length == 0 )
{
return new KeyedResultSet<Integer, OPCITEMSTATE> ();
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 0 );
callObject.addInParamAsShort ( (short)source.id (), JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( serverHandles.length, JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( OPCITEMSTATE.getStruct (), null, 1, true ) ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );
Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject );
KeyedResultSet<Integer, OPCITEMSTATE> results = new KeyedResultSet<Integer, OPCITEMSTATE> ();
JIStruct[] states = (JIStruct[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance ();
for ( int i = 0; i < serverHandles.length; i++ )
{
results.add ( new KeyedResult<Integer, OPCITEMSTATE> ( serverHandles[i], OPCITEMSTATE.fromStruct ( states[i] ), errorCodes[i] ) );
}
return results;
}
示例12: setClientHandles
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultSet<Integer> setClientHandles ( final Integer[] serverHandles, final Integer[] clientHandles ) throws JIException
{
if ( serverHandles.length != clientHandles.length )
{
throw new JIException ( 0, "Array sizes don't match" );
}
if ( serverHandles.length == 0 )
{
return new ResultSet<Integer> ();
}
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 4 );
callObject.addInParamAsInt ( serverHandles.length, JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( clientHandles, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );
final Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
final ResultSet<Integer> results = new ResultSet<Integer> ( serverHandles.length );
for ( int i = 0; i < serverHandles.length; i++ )
{
results.add ( new Result<Integer> ( serverHandles[i], errorCodes[i] ) );
}
return results;
}
示例13: write
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultSet<WriteRequest> write ( final WriteRequest... requests ) throws JIException
{
if ( requests.length == 0 )
{
return new ResultSet<WriteRequest> ();
}
Integer[] items = new Integer[requests.length];
JIVariant[] values = new JIVariant[requests.length];
for ( int i = 0; i < requests.length; i++ )
{
items[i] = requests[i].getServerHandle ();
values[i] = Helper.fixVariant ( requests[i].getValue () );
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsInt ( requests.length, JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( items, true ), JIFlags.FLAG_NULL );
callObject.addInParamAsArray ( new JIArray ( values, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );
Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject );
Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance ();
ResultSet<WriteRequest> results = new ResultSet<WriteRequest> ();
for ( int i = 0; i < requests.length; i++ )
{
results.add ( new Result<WriteRequest> ( requests[i], errorCodes[i] ) );
}
return results;
}
示例14: readProcessed
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ReadResult<OPCHDA_ITEM> readProcessed(OPCHDA_TIME startTime, OPCHDA_TIME endTime, FileTime resampleInterval, Integer[] serverHandles, Integer[] aggregates) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsStruct(startTime.getStruct(), JIFlags.FLAG_NULL);
callObject.addInParamAsStruct(endTime.getStruct(), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new OPCHDA_TIME().getStruct(), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new OPCHDA_TIME().getStruct(), JIFlags.FLAG_NULL);
callObject.addInParamAsStruct(resampleInterval.getStruct(), JIFlags.FLAG_NULL);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(aggregates, true), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(new OPCHDA_ITEM().getStruct(), null, 1, 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;
}
}
startTime = new OPCHDA_TIME(((JIStruct) ((JIPointer) result[0]).getReferent()));
endTime = new OPCHDA_TIME(((JIStruct) ((JIPointer) result[1]).getReferent()));
JIStruct[] items = (JIStruct[]) ((JIArray) ((JIPointer) result[2]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[3]).getReferent()).getArrayInstance();
ResultTable<Integer, OPCHDA_ITEM> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], new OPCHDA_ITEM(items[i]), errorCodes[i]);
}
return new ReadResult<>(startTime, endTime, resultTable);
}
示例15: readAtTime
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, OPCHDA_ITEM> readAtTime(FileTime[] timeStamps, Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(2);
JIStruct[] timeStampsStruct = new JIStruct[timeStamps.length];
for (int i = 0; i < timeStamps.length; i++) {
timeStampsStruct[i] = timeStamps[i].getStruct();
}
callObject.addInParamAsInt(timeStamps.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(timeStampsStruct, true), JIFlags.FLAG_NULL);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(new OPCHDA_ITEM().getStruct(), null, 1, 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;
}
}
JIStruct[] items = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
ResultTable<Integer, OPCHDA_ITEM> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], new OPCHDA_ITEM(items[i]), errorCodes[i]);
}
return resultTable;
}