本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.addInParamAsShort方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.addInParamAsShort方法的具體用法?Java JICallBuilder.addInParamAsShort怎麽用?Java JICallBuilder.addInParamAsShort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.addInParamAsShort方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: browseOPCItemIDs
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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]));
}
示例2: changeBrowsePosition
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void changeBrowsePosition(short direction, String string) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsShort(direction, JIFlags.FLAG_NULL);
callObject.addInParamAsString(string, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
comObject.call(callObject);
}
示例3: refresh2
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int refresh2(short datasource, int transactionId) throws JIException {
Logger.getLogger(IOPCAsyncIO2.class.getName()).finest("refresh2()");
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(2);
callObject.addInParamAsShort(datasource, JIFlags.FLAG_NULL);
callObject.addInParamAsInt(transactionId, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
return (Integer) result[0];
}
示例4: read
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, OPCITEMSTATE> read(short datasource, Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsShort(datasource, 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.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[] states = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
ResultTable<Integer, OPCITEMSTATE> resultTable = new ResultTable<>();
for (int i = 0; i < serverHandles.length; i++) {
resultTable.put(serverHandles[i], new OPCITEMSTATE(states[i]), errorCodes[i]);
}
return resultTable;
}
示例5: getGroups
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
/**
* Get the groups
* @param scope The scope to get
* @return A string enumerator with the groups
* @throws JIException
* @throws IllegalArgumentException
* @throws UnknownHostException
*/
public EnumString getGroups ( final OPCENUMSCOPE scope ) throws JIException, IllegalArgumentException, UnknownHostException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 5 );
callObject.addInParamAsShort ( (short)scope.id (), JIFlags.FLAG_NULL );
callObject.addInParamAsUUID ( org.openscada.opc.dcom.common.Constants.IEnumString_IID, JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
return new EnumString ( (IJIComObject)result[0] );
}
示例6: 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;
}
示例7: refresh
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int refresh ( final OPCDATASOURCE dataSource, final int transactionID ) throws JIException
{
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 2 );
callObject.addInParamAsShort ( (short)dataSource.id (), JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( transactionID, JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
final Object result[] = getCOMObject ().call ( callObject );
return (Integer)result[0];
}
示例8: browse
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public EnumString browse ( final OPCBROWSETYPE browseType, final String filterCriteria, final int accessRights, final int dataType ) throws JIException, IllegalArgumentException, UnknownHostException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 2 );
callObject.addInParamAsShort ( (short)browseType.id (), JIFlags.FLAG_NULL );
callObject.addInParamAsString ( filterCriteria, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
callObject.addInParamAsShort ( (short)dataType, JIFlags.FLAG_NULL );
callObject.addInParamAsInt ( accessRights, JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL );
Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject );
return new EnumString ( (IJIComObject)result[0] );
}
示例9: findName
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public Object[] findName(JIString nameBuf,int hashValue,short found) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(8);
callObject.addInParamAsString((nameBuf).getString(),nameBuf.getType());
callObject.addInParamAsInt(hashValue,JIFlags.FLAG_NULL);
callObject.addInParamAsShort(found,JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIArray(IJIComObject.class,null,1,true,true),JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIArray(Integer.class,null,1,true,true),JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Short.class,JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
return comObject.call(callObject);
}
示例10: performSquare
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void performSquare(String[] args) throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(1); //obtained from the IDL or TypeLib. // AskTestServerToSquare
Object results[];
short i = 3;
callObject.addInParamAsShort(i, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Short.class, JIFlags.FLAG_NULL); //Short
results = comObject.call(callObject);
System.out.println("ITestServer.AskTestServerToSquare succeeded, input=" + i + " output=" + results[0]);
}
示例11: SetSimpleArrayStructArray
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void SetSimpleArrayStructArray(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(21); //obtained from the IDL or TypeLib. ModifyStaticData
Object results[];
JIStruct simpleStruct = new JIStruct();
simpleStruct.addMember(new Integer(5));
simpleStruct.addMember(new Double(25));
simpleStruct.addMember(new Float(2.5));
Integer shortValue = new Integer(1);
JIStruct simpleArrayStruct = new JIStruct();
simpleArrayStruct.addMember(new Integer(54));
simpleArrayStruct.addMember(new Double(5));
simpleArrayStruct.addMember(JIUnsignedFactory.getUnsigned(shortValue, JIFlags.FLAG_REPRESENTATION_UNSIGNED_SHORT));
JIStruct[] structArray = new JIStruct[1];
structArray[0] = simpleStruct;
simpleArrayStruct.addMember(new JIPointer(new JIArray(structArray, true)));
JIStruct[] DataArray = new JIStruct[1];
DataArray[0] = simpleArrayStruct;
short size = 1;
callObject.addInParamAsShort(size, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(DataArray, true), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println("SetSimpleArrayStructArray worked!");
}
示例12: 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!");
}
示例13: changePosition
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
/**
* Direct the browser to another position
*
* Depending on the <em>direction</em> the new position will be set based on the provided
* position information. If the direction is {@link OPCBROWSEDIRECTION#OPC_BROWSE_TO} then
* the <em>position</em> is the item to go to. If the direction is {@link OPCBROWSEDIRECTION#OPC_BROWSE_DOWN}
* the browser will descent into the tree down (not to) the branch item in <em>position</em>.
* Passing {@link OPCBROWSEDIRECTION#OPC_BROWSE_UP} won't need a <em>position</em> (pass <code>null</code>)
* and will ascent in the tree one level.
*
* Passing {@link OPCBROWSEDIRECTION#OPC_BROWSE_TO} and <code>null</code> as position will
* go to the first root entry of the namespace.
*
* @param position The item position reference for the direction
* @param direction The direction to go based on the position
* @throws JIException
*/
public void changePosition ( final String position, final OPCBROWSEDIRECTION direction ) throws JIException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsShort ( (short)direction.id (), JIFlags.FLAG_NULL );
callObject.addInParamAsString ( position, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
getCOMObject ().call ( callObject );
}