/**<p> Attaches an event handler to <code>comObject</code> for the source event interface of COM , identified by the * <code>sourceUUID</code>. The event listener is itself identified by <code>eventListener</code>. An exception will be raised if * <code>sourceUUID</code> is not supported by the COM Server. * </p> * * @param comObject object to which the listener will be attached. * @param sourceUUID <code>IID</code> of the call back interface. * @param eventListener <code>IJIComObject</code> obtained using {@link #buildObject(JISession, JILocalCoClass)} * @return string identifier for this connection, please save this for eventual release using {@link #detachEventHandler(IJIComObject, String)} * @throws JIException * @throws IllegalArgumentException if any parameter is <code>null</code> or <code>sourceUUID</code> is empty. */ public static String attachEventHandler(IJIComObject comObject,String sourceUUID,IJIComObject eventListener) throws JIException { return JIFrameworkHelper.attachEventHandler(comObject, sourceUUID, eventListener); } /**Detaches the event handler identified by <code>identifier</code> and associated with this <code>comObject</code>. This method
/**Detaches the event handler identified by <code>identifier</code> and associated with this <code>comObject</code>. This method * will raise an exception if the <code>identifier</code> is invalid. * * @param comObject * @param identifier * @throws JIException */ public static void detachEventHandler(IJIComObject comObject, String identifier) throws JIException { JIFrameworkHelper.detachEventHandler(comObject, identifier); }
/** 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; }
JIInterfacePointer stubPtr = JIFrameworkHelper.getInterfacePointerOfStub(session); if (!JIInterfacePointer.isOxidEqual(stubPtr, ptr)) JISession newsession = JIFrameworkHelper.resolveSessionForOXID(ptr.getOXID()); if (newsession == null) JIComServer comServer = new JIComServer(newsession,ptr,null); retval = comServer.getInstance(); JIFrameworkHelper.link2Sessions(session, newsession);
final JIComServer comServer = new JIComServer ( newsession, comObjectImpl.internal_getInterfacePointer (), null ); comObject = comServer.getInstance (); JIFrameworkHelper.link2Sessions ( this.session, newsession ); comObject = JIFrameworkHelper.instantiateComObject2 ( this.session, comObjectImpl.internal_getInterfacePointer () ); JIFrameworkHelper.addComObjectToSession ( comObjectImpl.getAssociatedSession (), comObjectImpl );
/** Returns a COM Object from raw bytes. These bytes must conform to the Marshalled Interface Pointer template as per DCOM specifications. * * @param session session to attach <code>comObject</code> to. If required the framework will create a new session * for this <code>comObject</code> and link the <code>session</code> to the new one. This new session will be * destroyed when the parent <code>session</code> is destroyed. * @param rawBytes bytes representing the interface pointer. * @return * @throws JIException * @throws IllegalArgumentException if <code>rawBytes</code> is an invalid representation. */ public static IJIComObject buildObject(JISession session, byte[] rawBytes) throws JIException { return narrowObject(JIFrameworkHelper.instantiateComObject(session, rawBytes,null)); }
/** Returns a <b>local</b> COM Object representation for the Java component. <code>IJIComObject.IsLocalReference()</code> * method will return <code>true</code> for all objects built by this method. Another important point to note is that a * <code>javaComponent</code> can only export one reference to itself. Reusing the same <code>javaComponent</code> in another * call to this method will raise an exception. * * @param session session to attach <code>comObject</code> to. * @param javaComponent * @return * @throws JIException */ public static IJIComObject buildObject(JISession session,JILocalCoClass javaComponent) throws JIException { return JIFrameworkHelper.instantiateLocalComObject(session, javaComponent); }
lengthVar = JIFrameworkHelper.reverseArrayForDispatch ( arrayOfVariantsInParams ); variants = (JIVariant[])arrayOfVariantsInParams.getArrayInstance (); for ( int i = 0; i < variants.length; i++ ) if ( arrayOfNamedDispIds != null ) lengthPtr = JIFrameworkHelper.reverseArrayForDispatch ( arrayOfNamedDispIds );
final JIInterfacePointer stubPtr = JIFrameworkHelper.getInterfacePointerOfStub ( session ); if ( !JIInterfacePointer.isOxidEqual ( stubPtr, ptr ) ) JISession newsession = JIFrameworkHelper.resolveSessionForOXID ( ptr.getOXID () ); if ( newsession == null ) final JIComServer comServer = new JIComServer ( newsession, ptr, null ); retval = comServer.getInstance (); JIFrameworkHelper.link2Sessions ( session, newsession );
JIComServer comServer = new JIComServer(newsession,comObjectImpl.internal_getInterfacePointer(),null); comObject = comServer.getInstance(); JIFrameworkHelper.link2Sessions(session, newsession); comObject = JIFrameworkHelper.instantiateComObject2(session, comObjectImpl.internal_getInterfacePointer()); JIFrameworkHelper.addComObjectToSession(comObjectImpl.getAssociatedSession(), comObjectImpl); if (!fromCallback)
/** Returns a COM Object from raw bytes. These bytes must conform to the Marshalled Interface Pointer template as per DCOM specifications. * * @param session session to attach <code>comObject</code> to. If required the framework will create a new session * for this <code>comObject</code> and link the <code>session</code> to the new one. This new session will be * destroyed when the parent <code>session</code> is destroyed. * @param rawBytes bytes representing the interface pointer. * @return * @throws JIException * @throws IllegalArgumentException if <code>rawBytes</code> is an invalid representation. */ public static IJIComObject buildObject(JISession session, byte[] rawBytes) throws JIException { return narrowObject(JIFrameworkHelper.instantiateComObject(session, rawBytes,null)); }
/** Returns a <b>local</b> COM Object representation for the Java component. <code>IJIComObject.IsLocalReference()</code> * method will return <code>true</code> for all objects built by this method. Another important point to note is that a * <code>javaComponent</code> can only export one reference to itself. Reusing the same <code>javaComponent</code> in another * call to this method will raise an exception. * * @param session session to attach <code>comObject</code> to. * @param javaComponent * @return * @throws JIException */ public static IJIComObject buildObject(JISession session,JILocalCoClass javaComponent) throws JIException { return JIFrameworkHelper.instantiateLocalComObject(session, javaComponent); }
lengthVar = JIFrameworkHelper.reverseArrayForDispatch(arrayOfVariantsInParams); variants = (JIVariant[])arrayOfVariantsInParams.getArrayInstance(); for (int i = 0;i < variants.length;i++) if (arrayOfNamedDispIds != null) lengthPtr = JIFrameworkHelper.reverseArrayForDispatch(arrayOfNamedDispIds);
JIInterfacePointer stubPtr = JIFrameworkHelper.getInterfacePointerOfStub(session); if (!JIInterfacePointer.isOxidEqual(stubPtr, ptr)) JISession newsession = JIFrameworkHelper.resolveSessionForOXID(ptr.getOXID()); if (newsession == null) JIComServer comServer = new JIComServer(newsession,ptr,null); retval = comServer.getInstance(); JIFrameworkHelper.link2Sessions(session, newsession);
JIComServer comServer = new JIComServer(newsession,comObjectImpl.internal_getInterfacePointer(),null); comObject = comServer.getInstance(); JIFrameworkHelper.link2Sessions(session, newsession); comObject = JIFrameworkHelper.instantiateComObject2(session, comObjectImpl.internal_getInterfacePointer()); JIFrameworkHelper.addComObjectToSession(comObjectImpl.getAssociatedSession(), comObjectImpl);
/** Returns a COM Object from raw bytes. These bytes must conform to the Marshalled Interface Pointer template as per DCOM specifications. * * @param session session to attach <code>comObject</code> to. If required the framework will create a new session * for this <code>comObject</code> and link the <code>session</code> to the new one. This new session will be * destroyed when the parent <code>session</code> is destroyed. * @param rawBytes bytes representing the interface pointer. * @param ipAddress can be <code>null</code>. Sometimes there are many adapters (virtual as well) on the Target machine to which this interface pointer belongs, * which may get sent as part of the interface pointer and consequently this call will fail since it is a possibility that IP is not reachable via this machine. * The developer can send in the valid IP and if found in the interface pointer list will be used to talk to the target machine, overriding the other IP addresses * present in the interface pointer. If this IP is not found then the "machine name" binding will be used. If this param is <code>null</code> then the first * binding obtained from the interface pointer is used. * @return * @throws JIException * @throws IllegalArgumentException if <code>rawBytes</code> is an invalid representation. */ public static IJIComObject buildObject(JISession session, byte[] rawBytes, String ipAddress) throws JIException { return narrowObject(JIFrameworkHelper.instantiateComObject(session, rawBytes,ipAddress)); }
/** 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; }
/**Detaches the event handler identified by <code>identifier</code> and associated with this <code>comObject</code>. This method * will raise an exception if the <code>identifier</code> is invalid. * * @param comObject * @param identifier * @throws JIException */ public static void detachEventHandler(IJIComObject comObject, String identifier) throws JIException { JIFrameworkHelper.detachEventHandler(comObject, identifier); }
/**<p> Attaches an event handler to <code>comObject</code> for the source event interface of COM , identified by the * <code>sourceUUID</code>. The event listener is itself identified by <code>eventListener</code>. An exception will be raised if * <code>sourceUUID</code> is not supported by the COM Server. * </p> * * @param comObject object to which the listener will be attached. * @param sourceUUID <code>IID</code> of the call back interface. * @param eventListener <code>IJIComObject</code> obtained using {@link #buildObject(JISession, JILocalCoClass)} * @return string identifier for this connection, please save this for eventual release using {@link #detachEventHandler(IJIComObject, String)} * @throws JIException * @throws IllegalArgumentException if any parameter is <code>null</code> or <code>sourceUUID</code> is empty. */ public static String attachEventHandler(IJIComObject comObject,String sourceUUID,IJIComObject eventListener) throws JIException { return JIFrameworkHelper.attachEventHandler(comObject, sourceUUID, eventListener); } /**Detaches the event handler identified by <code>identifier</code> and associated with this <code>comObject</code>. This method
/** * Returns a <b>local</b> COM Object representation for the Java component. * <code>IJIComObject.IsLocalReference()</code> method will return * <code>true</code> for all objects built by this method. Another important * point to note is that a <code>javaComponent</code> can only export one * reference to itself. Reusing the same <code>javaComponent</code> in * another * call to this method will raise an exception. * * @param session * session to attach <code>comObject</code> to. * @param javaComponent * @return * @throws JIException */ public static IJIComObject buildObject ( final JISession session, final JILocalCoClass javaComponent ) throws JIException { return JIFrameworkHelper.instantiateLocalComObject ( session, javaComponent ); }