本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.addOutParamAsType方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.addOutParamAsType方法的具體用法?Java JICallBuilder.addOutParamAsType怎麽用?Java JICallBuilder.addOutParamAsType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.addOutParamAsType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setState
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
/**
* Set the group state Leaving any of the parameters <code>null</code> will keep the current value untouched.
*
* @param requestedUpdateRate
* the requested update rate
* @param active
* Flag if the group is active or not
* @param timeBias
* The time bias
* @param percentDeadband
* the deadband percent
* @param localeID
* the locale ID
* @param clientHandle
* the client handle
* @return the granted update rate
* @throws JIException
*/
public int setState ( final Integer requestedUpdateRate, final Boolean active, final Integer timeBias, final Float percentDeadband, final Integer localeID, final Integer clientHandle ) throws JIException
{
final JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsPointer ( new JIPointer ( requestedUpdateRate ), JIFlags.FLAG_NULL );
if ( active != null )
{
callObject.addInParamAsPointer ( new JIPointer ( Integer.valueOf ( active.booleanValue () ? 1 : 0 ) ), JIFlags.FLAG_NULL );
}
else
{
callObject.addInParamAsPointer ( new JIPointer ( null ), JIFlags.FLAG_NULL );
}
callObject.addInParamAsPointer ( new JIPointer ( timeBias ), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer ( percentDeadband ), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer ( localeID ), JIFlags.FLAG_NULL );
callObject.addInParamAsPointer ( new JIPointer ( clientHandle ), JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
final Object[] result = getCOMObject ().call ( callObject );
return (Integer)result[0];
}
示例2: setState
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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];
}
示例3: getSimpleStructArray
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void getSimpleStructArray(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(13); //obtained from the IDL or TypeLib. //
Object results[];
callObject.addOutParamAsType(JIUnsignedShort.class, JIFlags.FLAG_NULL);
JIStruct struct = new JIStruct();
struct.addMember(Integer.class);
struct.addMember(Double.class);
struct.addMember(Float.class);
JIArray DataArray = new JIArray(struct, null, 1, true);
callObject.addOutParamAsObject(new JIPointer(DataArray), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(((JIUnsignedShort)results[0]).getValue());
}
示例4: getNames
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的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);
}
示例5: getRefTypeOfImplType
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int getRefTypeOfImplType(int index) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(5);
callObject.addInParamAsInt(index,JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
return ((Integer)(((Object[])comObject.call(callObject))[0])).intValue();
}
示例6: next
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int next ( final List<String> 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 ( new JIPointer ( new JIString (
// JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), null, 1, true, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIArray ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ), null, 1, true, true ), JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
//JIPointer[] resultData = (JIPointer[]) ( (JIArray) ( result[0] ) ).getArrayInstance ();
JIString[] resultData = (JIString[]) ( (JIArray)result[0] ).getArrayInstance ();
Integer cnt = (Integer)result[1];
for ( int i = 0; i < cnt; i++ )
{
//list.add ( ( (JIString)resultData[i].getReferent () ).getString () );
list.add ( resultData[i].getString () );
}
return cnt;
}
示例7: GetStaticStruct
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public void GetStaticStruct(String[] args)
throws JIException, InterruptedException, UnknownHostException {
JICallBuilder callObject = new JICallBuilder( true);
callObject.setOpnum(15); //obtained from the IDL or TypeLib. //
Object results[];
JIStruct varStruct = new JIStruct();
varStruct.addMember(JIUnsignedInteger.class);
varStruct.addMember(Float.class);
varStruct.addMember(Float.class);
varStruct.addMember(JIUnsignedShort.class);
varStruct.addMember(Float.class);
varStruct.addMember(Date.class);
varStruct.addMember(JIUnsignedInteger.class);
JIStruct pointStruct = new JIStruct();
pointStruct.addMember(JIUnsignedInteger.class);
pointStruct.addMember(JIUnsignedInteger.class);
pointStruct.addMember(Byte.class);
JIArray structArray = new JIArray(varStruct, null, 1, true);
pointStruct.addMember(new JIPointer(structArray));
JIArray DataArray = new JIArray(pointStruct, null, 1, true);
callObject.addOutParamAsType(JIUnsignedShort.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(DataArray, false), JIFlags.FLAG_NULL);
results = comObject.call(callObject);
System.out.println(((JIUnsignedShort)results[0]).getValue());
}
示例8: browseAccessPaths
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
/**
* Return the possible access paths for an item
* @param itemID the item to query
* @return A string enumerator for the possible access paths
* @throws JIException
* @throws IllegalArgumentException
* @throws UnknownHostException
*/
public EnumString browseAccessPaths ( final String itemID ) throws JIException, IllegalArgumentException, UnknownHostException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 4 );
callObject.addInParamAsString ( itemID, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
return new EnumString ( (IJIComObject)result[0] );
}
示例9: queryAvailableProperties
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public Collection<PropertyDescription> queryAvailableProperties ( final String itemID ) throws JIException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 0 );
callObject.addInParamAsString ( itemID, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_BSTR ), null, 1, true ) ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Short.class, null, 1, true ) ), JIFlags.FLAG_NULL );
Object result[] = getCOMObject ().call ( callObject );
List<PropertyDescription> properties = new LinkedList<PropertyDescription> ();
int len = (Integer)result[0];
Integer[] ids = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance ();
JIString[] descriptions = (JIString[]) ( (JIArray) ( (JIPointer)result[2] ).getReferent () ).getArrayInstance ();
Short[] variableTypes = (Short[]) ( (JIArray) ( (JIPointer)result[3] ).getReferent () ).getArrayInstance ();
for ( int i = 0; i < len; i++ )
{
PropertyDescription pd = new PropertyDescription ();
pd.setId ( ids[i] );
pd.setDescription ( descriptions[i].getString () );
pd.setVarType ( variableTypes[i] );
properties.add ( pd );
}
return properties;
}
示例10: getLocaleID
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public int getLocaleID() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCCommon_GetLocaleID);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return (Integer) result[0];
}
示例11: getGroupByName
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public OPCGroupStateMgt getGroupByName ( final String name ) throws JIException, IllegalArgumentException, UnknownHostException
{
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 2 );
callObject.addInParamAsString ( name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR );
callObject.addInParamAsUUID ( Constants.IOPCGroupStateMgt_IID, JIFlags.FLAG_NULL );
callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL );
Object[] result = getCOMObject ().call ( callObject );
return new OPCGroupStateMgt ( (IJIComObject)result[0] );
}
示例12: read
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public AsyncResult read ( final int transactionId, final Integer... serverHandles ) throws JIException
{
if ( serverHandles == null || serverHandles.length == 0 )
{
return new AsyncResult ();
}
final 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 );
final Object[] result = getCOMObject ().call ( callObject );
final Integer cancelId = (Integer)result[0];
final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance ();
final ResultSet<Integer> resultSet = new ResultSet<Integer> ();
for ( int i = 0; i < serverHandles.length; i++ )
{
resultSet.add ( new Result<Integer> ( serverHandles[i], errorCodes[i] ) );
}
return new AsyncResult ( resultSet, cancelId );
}
示例13: getRefTypeInfo
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJITypeInfo getRefTypeInfo(int hrefType) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(11);
callObject.addInParamAsInt(hrefType,JIFlags.FLAG_NULL);
callObject.addOutParamAsType(IJIComObject.class,JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
return (IJITypeInfo) JIObjectFactory.narrowObject((IJIComObject)result[0]);
}
示例14: 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];
}
示例15: 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] );
}