• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JIObjectFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jinterop.dcom.impls.JIObjectFactory的典型用法代码示例。如果您正苦于以下问题:Java JIObjectFactory类的具体用法?Java JIObjectFactory怎么用?Java JIObjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JIObjectFactory类属于org.jinterop.dcom.impls包,在下文中一共展示了JIObjectFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addGroup

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public AddGroupResult addGroup(String name, boolean active, int requestedUpdateRate, int clientGroup, Integer timeBias, Float percentDeadband, int lcid, String iid) throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(METHOD_INDEX_IOPCServer_AddGroup);
    callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsBoolean(active, JIFlags.FLAG_NULL);
    callObject.addInParamAsInt(requestedUpdateRate, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
    callObject.addInParamAsInt(clientGroup, JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(timeBias != null ? timeBias : new Integer(0)), JIFlags.FLAG_NULL);
    callObject.addInParamAsPointer(new JIPointer(percentDeadband != null ? percentDeadband : new Float(0.0)), JIFlags.FLAG_NULL);
    callObject.addInParamAsInt(lcid, JIFlags.FLAG_REPRESENTATION_UNSIGNED_INT);
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL); //out param phServerGroup
    callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL); //out param pRevisedUpdateRate
    callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL); // out param ppUnk
    Object[] result = comObject.call(callObject);
    if (callObject.isError())
        throw new JIException(callObject.getHRESULT());
    return new AddGroupResult(
            (Integer) result[0],
            (Integer) result[1],
            JIObjectFactory.narrowObject((IJIComObject) result[2]));
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:24,代码来源:IOPCServer.java


示例2: browseOPCItemIDs

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的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]));
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:24,代码来源:IOPCBrowseServerAddressSpace.java


示例3: browseAccessPaths

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的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]));
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:18,代码来源:IOPCBrowseServerAddressSpace.java


示例4: attach

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
/**
 * Attach a new callback to the group
 * 
 * @param callback
 *            The callback to attach
 * @return The event handler information
 * @throws JIException
 */
public EventHandler attach ( final IOPCDataCallback callback ) throws JIException
{
    final OPCDataCallback callbackObject = new OPCDataCallback ();

    callbackObject.setCallback ( callback );

    // sync the callback object so that no calls get through the callback
    // until the callback information is set
    // If happens in some cases that the callback is triggered before
    // the method attachEventHandler returns.
    synchronized ( callbackObject )
    {
        final String id = JIFrameworkHelper.attachEventHandler ( getCOMObject (), Constants.IOPCDataCallback_IID, JIObjectFactory.buildObject ( getCOMObject ().getAssociatedSession (), callbackObject.getCoClass () ) );

        callbackObject.setInfo ( getCOMObject (), id );
    }
    return callbackObject;
}
 
开发者ID:luoyan35714,项目名称:OPC_Client,代码行数:27,代码来源:OPCGroupStateMgt.java


示例5: BeforeNavigate2

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public JIVariant BeforeNavigate2(IJIComObject dispatch,JIVariant URL,JIVariant Flags,JIVariant TargetFrameName,
									JIVariant PostData, JIVariant Headers, JIVariant Cancel) throws JIException 
{
	dispatch = JIObjectFactory.narrowObject(dispatch);
	JIVariant realURL = URL;
	while (realURL.isByRefFlagSet())
	{
		realURL = realURL.getObjectAsVariant();
	}
	
	System.out.println("BeforeNavigate2  -> " + realURL.getObjectAsString().getString());
	
	//uncomment and return this to stop loading the page
	//JIVariant variant = new JIVariant(true,true);
	
	return Cancel;
}
 
开发者ID:howie,项目名称:jinterop,代码行数:18,代码来源:DWebBrowserEvents2.java


示例6: execute

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public void execute() throws JIException
{
	unknown = comStub.createInstance();
	//CLSID of IITestCOMServer
	IJIComObject comObject = (IJIComObject)unknown.queryInterface("4AE62432-FD04-4BF9-B8AC-56AA12A47FF9");
	dispatch = (IJIDispatch)JIObjectFactory.narrowObject(comObject.queryInterface(IJIDispatch.IID));

	//Now call via automation
	Object results[] = dispatch.callMethodA("Add",new Object[]{new Integer(1), new Integer(2), new JIVariant(0,true)});
	System.out.println(results[1]);

	//now without automation
	JICallBuilder callObject = new JICallBuilder();
	callObject.setOpnum(1);//obtained from the IDL or TypeLib.
	callObject.addInParamAsInt(1,JIFlags.FLAG_NULL);
	callObject.addInParamAsInt(2,JIFlags.FLAG_NULL);
	callObject.addInParamAsPointer(new JIPointer(new Integer(0)),JIFlags.FLAG_NULL);
	//Since the retval is a top level pointer , it will get replaced with it's base type.
	callObject.addOutParamAsObject(Integer.class,JIFlags.FLAG_NULL);
	results = comObject.call(callObject);
	System.out.println(results[0]);
	JISession.destroySession(dispatch.getAssociatedSession());
}
 
开发者ID:howie,项目名称:jinterop,代码行数:24,代码来源:TestCOMServer.java


示例7: getGroupByName

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject getGroupByName(String name, String iid) throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(METHOD_INDEX_IOPCServer_GetGroupByName);
    callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL); // out param ppUnk
    Object[] result = comObject.call(callObject);
    if (callObject.isError())
        throw new JIException(callObject.getHRESULT());
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:13,代码来源:IOPCServer.java


示例8: addShutdownListener

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public void addShutdownListener(OPCShutdownListener listener) throws JIException
{
    if (!shutdownHandlers.containsKey(listener))
    {
        OPCShutdownImpl shutdownImpl = new OPCShutdownImpl(listener);
        String cookie = JIObjectFactory.attachEventHandler(comObject, OPCShutdownImpl.IID_IOPCShutdown,
                JIObjectFactory.buildObject(comObject.getAssociatedSession(), shutdownImpl.getLocalClass()));
        shutdownHandlers.put(listener, cookie);
    }
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:11,代码来源:IOPCServer.java


示例9: cloneGroup

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject cloneGroup(String name, String iid) throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(3);
    callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    Object[] result = comObject.call(callObject);
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:10,代码来源:IOPCGroupStateMgt.java


示例10: addDataListener

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public void addDataListener(OPCDataListener listener) throws JIException {
    if (!dataHandlers.containsKey(listener)) {
        OPCDataCallbackImpl dataCallbackImpl = new OPCDataCallbackImpl(listener);
        String cookie = JIObjectFactory.attachEventHandler(comObject, OPCDataCallbackImpl.IID_IOPCDataCallback,
                JIObjectFactory.buildObject(comObject.getAssociatedSession(), dataCallbackImpl.getLocalClass()));
        dataHandlers.put(listener, cookie);
    }
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:IOPCAsyncIO2.java


示例11: getPublicGroupByName

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject getPublicGroupByName(String name, String iid) throws JIException
{
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(0);
    callObject.addInParamAsString(name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR);
    callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL); // out param ppUnk

    Object[] result = comObject.call(callObject);

    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:13,代码来源:IOPCServerPublicGroups.java


示例12: createEnumerator

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject createEnumerator(String iid) throws JIException {
    JICallBuilder callObject = new JICallBuilder(true);
    callObject.setOpnum(6);
    callObject.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    callObject.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);

    Object[] result = comObject.call(callObject);
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:10,代码来源:IOPCItemMgt.java


示例13: enumConnectionPoints

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject enumConnectionPoints() throws JIException
{
    JICallBuilder callObj = new JICallBuilder(true);
    callObj.setOpnum(0);
    callObj.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);
    Object[] result = comObject.call(callObj);
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:IConnectionPointContainer.java


示例14: findConnectionPoint

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject findConnectionPoint(String iid) throws JIException
{
    JICallBuilder callObj = new JICallBuilder(true);
    callObj.setOpnum(1);
    callObj.addInParamAsUUID(iid, JIFlags.FLAG_NULL);
    callObj.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);
    Object[] result = comObject.call(callObj);
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:10,代码来源:IConnectionPointContainer.java


示例15: next

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的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;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:28,代码来源:IEnumConnectionPoints.java


示例16: getConnectionPointContainer

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject getConnectionPointContainer() throws JIException
{
    JICallBuilder callObj = new JICallBuilder(true);
    callObj.setOpnum(1);
    callObj.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);
    Object[] result = comObject.call(callObj);
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:IConnectionPoint.java


示例17: enumConnections

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public IJIComObject enumConnections() throws JIException
{
    JICallBuilder callObj = new JICallBuilder(true);
    callObj.setOpnum(4);
    callObj.addOutParamAsType(IJIComObject.class, JIFlags.FLAG_NULL);//TODO out param is IEnumConnections**
    Object[] result = comObject.call(callObj);
    return JIObjectFactory.narrowObject((IJIComObject) result[0]);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:IConnectionPoint.java


示例18: getSecurity

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
/**
 * The security property is used to read, or set the security settings.
 * This property is an {@link SWbemSecurity} object. The security settings in this object do not indicate the authentication,
 * impersonation, or privilege settings made on a connection to Windows Management Instrumentation (WMI),
 * or the security in effect for the proxy when an object is delivered to a sink in an asynchronous call.
 * <p><strong>Note: </strong> Setting the Security_ property of an SWbemObject object to NULL grants unlimited access to everyone all the time.
 * For more information, see {@link SWbemSecurity}.</p>
 * @return The security settings of this WMI object.
 * @throws WMIException
 */
public SWbemSecurity getSecurity() throws WMIException {
    try {
        JIVariant result = dispatch.get("Security_");
        IJIComObject comObject = result.getObjectAsComObject();
        IJIDispatch securityDispatch = (IJIDispatch) JIObjectFactory.narrowObject(comObject);
        return new SWbemSecurity(securityDispatch);
    } catch (JIException e) {
        throw new WMIException(e);
    }
}
 
开发者ID:chenlichao-cn,项目名称:wmi4j,代码行数:21,代码来源:AbstractSecurityScriptingObject.java


示例19: getSWbemObjectValue

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的package包/类
public SWbemObject getSWbemObjectValue() throws WMIException {
    try {
        IJIDispatch dispatch = (IJIDispatch) JIObjectFactory.narrowObject(variant.getObjectAsComObject());
        return new SWbemObject(dispatch);
    } catch (JIException e) {
        throw new WMIException(e);
    }
}
 
开发者ID:chenlichao-cn,项目名称:wmi4j,代码行数:9,代码来源:WMIVariant.java


示例20: performInstanceOf

import org.jinterop.dcom.impls.JIObjectFactory; //导入依赖的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);
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:14,代码来源:WmiClient.java



注:本文中的org.jinterop.dcom.impls.JIObjectFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DanmakuFilters类代码示例发布时间:2022-05-22
下一篇:
Java JCache类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap