本文整理汇总了Java中org.jinterop.dcom.impls.JIObjectFactory类的典型用法代码示例。如果您正苦于以下问题:Java JIObjectFactory类的具体用法?Java JIObjectFactory怎么用?Java JIObjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JIObjectFactory类属于org.jinterop.dcom.impls包,在下文中一共展示了JIObjectFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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]));
}
示例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]));
}
示例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]));
}
示例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;
}
示例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;
}
示例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());
}
示例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]);
}
示例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);
}
}
示例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]);
}
示例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);
}
}
示例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]);
}
示例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]);
}
示例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]);
}
示例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]);
}
示例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;
}