本文整理汇总了Java中org.jinterop.dcom.common.JIException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java JIException.getMessage方法的具体用法?Java JIException.getMessage怎么用?Java JIException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jinterop.dcom.common.JIException
的用法示例。
在下文中一共展示了JIException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performInstanceOf
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/** {@inheritDoc} */
public OnmsWbemObjectSet performInstanceOf(final String wmiClass) throws WmiException {
try {
// Execute the InstancesOf method on the remote SWbemServices object.
final JIVariant results[] = m_WbemServices.callMethodA("InstancesOf", new Object[]{new JIString(wmiClass), 0, JIVariant.OPTIONAL_PARAM()});
final IJIDispatch wOSd = (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());
return new OnmsWbemObjectSetImpl(wOSd);
} catch (final JIException e) {
throw new WmiException("Failed to perform WMI operation (\\\\" + wmiClass + ") : " + e.getMessage(), e);
}
}
示例2: performExecQuery
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/** {@inheritDoc} */
public OnmsWbemObjectSet performExecQuery (final String strQuery, final String strQueryLanguage, final Integer flags) throws WmiException {
try {
final JIVariant results[] = m_WbemServices.callMethodA("ExecQuery", new Object[]{new JIString(strQuery), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(),JIVariant.OPTIONAL_PARAM()});
final IJIDispatch wOSd = (IJIDispatch)JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());
return new OnmsWbemObjectSetImpl(wOSd);
} catch(final JIException e) {
throw new WmiException("Failed to execute query '" + strQuery + "': " + e.getMessage(), e);
}
}
示例3: performWmiGet
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>performWmiGet</p>
*
* @param strObjectPath a {@link java.lang.String} object.
* @return a {@link org.opennms.protocols.wmi.wbem.OnmsWbemObject} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public OnmsWbemObject performWmiGet(final String strObjectPath) throws WmiException {
try {
final JIVariant results[] = m_WbemServices.callMethodA("Get", new Object[]{new JIString(strObjectPath), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM()});
final IJIDispatch obj_dsp = (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());
return new OnmsWbemObjectImpl(obj_dsp);
} catch (final JIException e) {
throw new WmiException("Failed to perform get '" + strObjectPath + "': " + e.getMessage(), e);
}
}
示例4: performSubclassOf
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>performSubclassOf</p>
*
* @return a {@link org.opennms.protocols.wmi.wbem.OnmsWbemObjectSet} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public OnmsWbemObjectSet performSubclassOf() throws WmiException {
try {
final JIVariant results[] = m_WbemServices.callMethodA("SubclassesOf", new Object[]{ JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM()});
final IJIDispatch objset_dsp = (IJIDispatch) JIObjectFactory.narrowObject((results[0]).getObjectAsComObject());
return new OnmsWbemObjectSetImpl(objset_dsp);
} catch (final JIException e) {
throw new WmiException("Failed to perform SubclassesOf: " + e.getMessage(), e);
}
}
示例5: convertToNativeType
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>convertToNativeType</p>
*
* @param type a {@link org.jinterop.dcom.core.JIVariant} object.
* @return a {@link java.lang.Object} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public static Object convertToNativeType(final JIVariant type) throws WmiException {
try {
if (type.isArray()) {
final ArrayList<Object> objs = new ArrayList<Object>();
final Object [] array = (Object[])type.getObjectAsArray().getArrayInstance();
for (final Object element : array) {
objs.add(convertToNativeType((JIVariant)element));
}
return objs;
}
switch (type.getType()) {
case JIVariant.VT_NULL:
return null;
case JIVariant.VT_BSTR:
return type.getObjectAsString().getString();
case JIVariant.VT_I2: // sint16
return type.getObjectAsShort();
case JIVariant.VT_I4:
return type.getObjectAsInt();
case JIVariant.VT_UI1: // uint8 (convert to Java Number)
return type.getObjectAsUnsigned().getValue();
case JIVariant.VT_BOOL:
return type.getObjectAsBoolean();
case JIVariant.VT_DECIMAL:
return type.getObjectAsFloat();
case JIVariant.VT_DATE:
return type.getObjectAsDate();
default:
throw new WmiException("Unknown type presented (" + type.getType() + "), defaulting to Object: " + type.toString());
}
} catch (final JIException e) {
throw new WmiException("Failed to conver WMI type to native object: " + e.getMessage(), e);
}
}
示例6: getWmiObjectText
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getWmiObjectText</p>
*
* @return a {@link java.lang.String} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public String getWmiObjectText() throws WmiException {
try {
return (wbemObjectDispatch.callMethodA("GetObjectText_", new Object[]{1}))[0].getObjectAsString2();
} catch (final JIException e) {
throw new WmiException("Unable to retrieve WbemObjectPath GetObjectText_ attribute: " + e.getMessage(), e);
}
}
示例7: getWmiString
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getWmiAuthority</p>
*
* @return a {@link java.lang.String} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
private String getWmiString(final String name) throws WmiException {
try {
return wbemObjectPathDispatch.get(name).getObjectAsString2();
} catch (final JIException e) {
throw new WmiException("Unable to retrieve WbemObjectPath " + name + " attribute: " + e.getMessage(), e);
}
}
示例8: getWmiBoolean
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
private Boolean getWmiBoolean(final String name) throws WmiException {
try {
return wbemObjectPathDispatch.get(name).getObjectAsBoolean();
} catch (final JIException e) {
throw new WmiException("Unable to retrieve WbemObjectPath " + name + " attribute: " + e.getMessage(), e);
}
}
示例9: count
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>count</p>
*
* @return a {@link java.lang.Integer} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public Integer count() throws WmiException {
try {
final JIVariant Count = wbemPropertySetDispatch.get("Count");
return Count.getObjectAsInt();
} catch (final JIException e) {
throw new WmiException("Retrieving Count failed: " + e.getMessage(), e);
}
}
示例10: getCount
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getCount</p>
*
* @return a {@link java.lang.Integer} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public Integer getCount() throws WmiException {
try {
return wbemMethodSetDispatch.get("Count").getObjectAsInt();
} catch(final JIException e) {
throw new WmiException("Failed to retrieve Method Set count: " + e.getMessage(), e);
}
}
示例11: count
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>count</p>
*
* @return a {@link java.lang.Integer} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public Integer count() throws WmiException {
try {
return wbemObjectSet.get("Count").getObjectAsInt();
} catch (final JIException e) {
throw new WmiException("Retrieving Count failed: " + e.getMessage(), e);
}
}
示例12: getWmiPath
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getWmiPath</p>
*
* @return a {@link org.opennms.protocols.wmi.wbem.OnmsWbemObjectPath} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public OnmsWbemObjectPath getWmiPath() throws WmiException {
try {
// Get the WbemMethodSet dispatcher.
final IJIComObject pathComObject = wbemObjectDispatch.get("Path_").getObjectAsComObject();
final IJIDispatch path_dispatch = (IJIDispatch) JIObjectFactory.narrowObject(pathComObject);
return new OnmsWbemObjectPathImpl(path_dispatch);
} catch (final JIException e) {
throw new WmiException("Failed to retrieve object path: " + e.getMessage(), e);
}
}
示例13: getWmiOrigin
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getWmiOrigin</p>
*
* @return a {@link java.lang.String} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public String getWmiOrigin() throws WmiException {
try {
return wbemMethodDispatch.get("Origin").getObjectAsString2();
} catch (final JIException e) {
throw new WmiException("Unable to retrieve WbemMethod Origin attribute: " + e.getMessage(), e);
}
}
示例14: getWmiValue
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getWmiValue</p>
*
* @return a {@link java.lang.Object} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public Object getWmiValue() throws WmiException {
try {
return WmiClient.convertToNativeType(wbemPropertyDispatch.get("Value"));
} catch (final JIException e) {
throw new WmiException("Unable to retrieve or convert WbemProperty Value attribute: " + e.getMessage(), e);
}
}
示例15: getWmiCIMType
import org.jinterop.dcom.common.JIException; //导入方法依赖的package包/类
/**
* <p>getWmiCIMType</p>
*
* @return a {@link java.lang.Integer} object.
* @throws org.opennms.protocols.wmi.WmiException if any.
*/
public Integer getWmiCIMType() throws WmiException {
try {
return wbemPropertyDispatch.get("CIMType").getObjectAsInt();
} catch (final JIException e) {
throw new WmiException("Unable to retrieve WbemProperty CIMType attribute: " + e.getMessage(), e);
}
}