@Override public JISession getAssociatedSession () { return this.comObject.getAssociatedSession (); }
public JISession getAssociatedSession() { return comObject.getAssociatedSession(); }
public JISession getAssociatedSession() { return comObject.getAssociatedSession(); }
void replaceMembers ( final IJIComObject comObject ) { this.session = comObject.getAssociatedSession (); this.ptr = comObject.internal_getInterfacePointer (); }
void replaceMembers(IJIComObject comObject) { this.session = comObject.getAssociatedSession(); this.ptr = comObject.internal_getInterfacePointer(); }
void replaceMembers(IJIComObject comObject) { this.session = comObject.getAssociatedSession(); this.ptr = comObject.internal_getInterfacePointer(); }
private void quit () throws JIException { ieObjectDispatch.callMethod("Quit"); JISession.destroySession(ieObjectDispatch.getAssociatedSession()); }
void DetachEventListener() throws JIException { JIObjectFactory.detachEventHandler(sysInfoServer,identifier); JISession.destroySession(dispatch.getAssociatedSession()); }
public void quitPowerPoint() throws JIException { dispatch.callMethod("Quit"); JISession.destroySession(dispatch.getAssociatedSession()); }
/** Must be called once and only once from JICallBuilder "read" to create the right pointer in case of man in the middle scenario and * add it to the session. * * @param session * @param ptr * @return * @throws JIException */ static IJIComObject instantiateComObject(JISession session, final JIInterfacePointer ptr) throws JIException { IJIComObject retval = instantiateComObject2(session,ptr); addComObjectToSession(retval.getAssociatedSession(), retval); return retval; }
/** Must be called once and only once from JICallBuilder "read" to create the right pointer in case of man in the middle scenario and * add it to the session. * * @param session * @param ptr * @return * @throws JIException */ static IJIComObject instantiateComObject(JISession session, final JIInterfacePointer ptr) throws JIException { IJIComObject retval = instantiateComObject2(session,ptr); addComObjectToSession(retval.getAssociatedSession(), retval); return retval; }
/** * Must be called once and only once from JICallBuilder "read" to create the * right pointer in case of man in the middle scenario and * add it to the session. * * @param session * @param ptr * @return * @throws JIException */ static IJIComObject instantiateComObject ( final JISession session, final JIInterfacePointer ptr ) throws JIException { final IJIComObject retval = instantiateComObject2 ( session, ptr ); addComObjectToSession ( retval.getAssociatedSession (), retval ); return retval; }
/** * @throws JIException */ private void quitAndDestroy() throws JIException { System.out.println("Quit..."); dispatch.callMethod("Quit", new Object[] { new JIVariant(-1, true), JIVariant.OPTIONAL_PARAM(), JIVariant.OPTIONAL_PARAM() }); JISession.destroySession(dispatch.getAssociatedSession()); }
/** Typically used in the Man-In-The-Middle scenario, where one j-Interop system interacts with another over the wire. * Or the IJIComObject is deserialized from a Database and is right now drifting. * * @exclude * @param session * @param comObject * @return * @throws JIException */ public static IJIComObject instantiateComObject(JISession session,IJIComObject comObject) throws JIException { if (comObject.getAssociatedSession() != null) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_SESSION_ALREADY_ATTACHED)); } if (comObject.isLocalReference()) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMOBJ_LOCAL_REF)); } return instantiateComObject(session, comObject.internal_getInterfacePointer()); }
/** Typically used in the Man-In-The-Middle scenario, where one j-Interop system interacts with another over the wire. * Or the IJIComObject is deserialized from a Database and is right now drifting. * * @exclude * @param session * @param comObject * @return * @throws JIException */ public static IJIComObject instantiateComObject(JISession session,IJIComObject comObject) throws JIException { if (comObject.getAssociatedSession() != null) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_SESSION_ALREADY_ATTACHED)); } if (comObject.isLocalReference()) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMOBJ_LOCAL_REF)); } return instantiateComObject(session, comObject.internal_getInterfacePointer()); }
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()); }
public void performOp() throws JIException, InterruptedException { JICallBuilder callObject = new JICallBuilder (true); callObject.setOpnum ( 0 ); callObject.addInParamAsString("",JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); callObject.addInParamAsInt(0xFFFFFFFF, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1000,JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1234,JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Integer(0)), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Float(0.0)),JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addInParamAsUUID( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); Object[] result = opcServer.call ( callObject ); JISession.destroySession(unknown.getAssociatedSession()); }
public void performOp () throws JIException, InterruptedException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); callObject.addInParamAsString ( "", JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addInParamAsInt ( 0xFFFFFFFF, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1000, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1234, JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer ( new Integer ( 0 ) ), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer ( new Float ( 0.0 ) ), JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addInParamAsUUID ( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); final Object[] result = this.opcServer.call ( callObject ); JISession.destroySession ( this.unknown.getAssociatedSession () ); }
public void performOp() throws JIException, InterruptedException { JICallBuilder callObject = new JICallBuilder (true); callObject.setOpnum ( 0 ); callObject.addInParamAsString("",JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); callObject.addInParamAsInt(0xFFFFFFFF, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1000,JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1234,JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Integer(0)), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Float(0.0)),JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addInParamAsUUID( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); Object[] result = opcServer.call ( callObject ); JISession.destroySession(unknown.getAssociatedSession()); }
/** * 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; }