本文整理匯總了Java中org.jinterop.dcom.core.JICallBuilder.getResultsInCaseOfException方法的典型用法代碼示例。如果您正苦於以下問題:Java JICallBuilder.getResultsInCaseOfException方法的具體用法?Java JICallBuilder.getResultsInCaseOfException怎麽用?Java JICallBuilder.getResultsInCaseOfException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jinterop.dcom.core.JICallBuilder
的用法示例。
在下文中一共展示了JICallBuilder.getResultsInCaseOfException方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: browseAccessPaths
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IEnumString browseAccessPaths(String itemId) throws JIException {
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;
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]));
}
示例3: 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;
}
示例4: 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;
}
示例5: callRespectSFALSE
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
/**
* Make the COM call but do not treat S_FALSE as error condition for the whole call
* @param object the object to make to call on
* @param callObject the call object
* @return the result of the call
* @throws JIException
*/
public static Object[] callRespectSFALSE ( final IJIComObject object, final JICallBuilder callObject ) throws JIException
{
try
{
return object.call ( callObject );
}
catch ( JIException e )
{
if ( e.getErrorCode () != org.openscada.opc.dcom.common.Constants.S_FALSE )
{
throw e;
}
return callObject.getResultsInCaseOfException ();
}
}
示例6: 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;
}
示例7: setActiveState
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public Map<Integer, Integer> setActiveState(boolean active, Integer[] serverHandles) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(3);
callObject.addInParamAsInt(serverHandles.length, JIFlags.FLAG_NULL);
callObject.addInParamAsArray(new JIArray(serverHandles, true), JIFlags.FLAG_NULL);
callObject.addInParamAsBoolean(active, 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;
}
示例8: getItemProperties
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<Integer, JIVariant> getItemProperties(String itemId, int[] propertyIds) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
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(JIVariant.class, 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;
}
}
JIVariant[] values = (JIVariant[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
Integer[] errorCodes = (Integer[]) ((JIArray) ((JIPointer) result[1]).getReferent()).getArrayInstance();
ResultTable<Integer, JIVariant> resultTable = new ResultTable<>();
for (int i = 0; i < propertyIds.length; i++) {
resultTable.put(propertyIds[i], values[i], errorCodes[i]);
}
return resultTable;
}
示例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: 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;
}
示例11: 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;
}
示例12: validateItems
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ResultTable<OPCITEMDEF, OPCITEMRESULT> validateItems(OPCITEMDEF[] items, boolean blobUpdate) throws JIException {
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(1);
callObject.addInParamAsInt(items.length, JIFlags.FLAG_NULL);
JIStruct[] structs = new JIStruct[items.length];
for (int i = 0; i < items.length; i++) {
structs[i] = items[i].getStruct();
}
JIArray structsArr = new JIArray(structs, true);
callObject.addInParamAsArray(structsArr, JIFlags.FLAG_NULL);
callObject.addInParamAsBoolean(blobUpdate, 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;
}
示例13: next
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public String[] next(int celt) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(celt, 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;
try
{
result = comObject.call(callObject);
} catch (JIException ex)
{
if (ex.getErrorCode() == 1 /*S_FALSE*/)
result = callObject.getResultsInCaseOfException();
else
throw ex;
}
Integer count = (Integer) result[1];
if (count == null)
throw new NullPointerException("Elements count is null");
JIString[] returned = (JIString[]) ((JIArray) (result[0])).getArrayInstance();
String[] elements = new String[count];
for (int i = 0; i < count; i++)
elements[i] = returned[i].getString();
return elements;
}
示例14: next
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public IJIComObject[] next(int celt) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(celt, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIArray(new JIPointer(IJIComObject.class, true), null, 1, true, true), JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.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;
}
Integer count = (Integer) result[1];
if (count == null)
throw new NullPointerException("Elements count is null");
JIPointer[] pointers = (JIPointer[]) ((JIArray) (result[0])).getArrayInstance();
IJIComObject[] returned = new IJIComObject[pointers.length];
for (int i = 0; i < pointers.length; i++)
returned[i] = JIObjectFactory.narrowObject((IJIComObject) pointers[i].getReferent());
return returned;
}
示例15: next
import org.jinterop.dcom.core.JICallBuilder; //導入方法依賴的package包/類
public ConnectData[] next(int celt) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addInParamAsInt(celt, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIArray(new ConnectData().getStruct(), null, 1, true, true)), JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.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;
}
Integer count = (Integer) result[1];
if (count == null)
throw new NullPointerException("Elements count is null");
JIStruct[] returned = (JIStruct[]) ((JIArray) ((JIPointer) result[0]).getReferent()).getArrayInstance();
ConnectData[] attrs = new ConnectData[count];
for (int i = 0; i < count; i++)
attrs[i] = new ConnectData(returned[i]);
return attrs;
}