/** 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 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 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)); }
/** 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)); }
/** Typically used in the Man-In-The-Middle scenario. * <p> Some possible use-cases :- * <ul> * <li>One j-Interop system interacts with another over the wire.</li> * <li>The <code>IJIComObject</code> is read from a database and is not <i>attached</i> to a session.</li> * </ul> * @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 comObject <i>drifting</i> object. * @return * @throws JIException * @throws IllegalArgumentException if <code>comObject</code> is <code>null</code> or a local reference. * @see IJIComObject#isLocalReference() */ public static IJIComObject narrowObject(JISession session, IJIComObject comObject) throws JIException { return narrowObject(JIFrameworkHelper.instantiateComObject(session, comObject)); } }
/** Typically used in the Man-In-The-Middle scenario. * <p> Some possible use-cases :- * <ul> * <li>One j-Interop system interacts with another over the wire.</li> * <li>The <code>IJIComObject</code> is read from a database and is not <i>attached</i> to a session.</li> * </ul> * @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 comObject <i>drifting</i> object. * @return * @throws JIException * @throws IllegalArgumentException if <code>comObject</code> is <code>null</code> or a local reference. * @see IJIComObject#isLocalReference() */ public static IJIComObject narrowObject(JISession session, IJIComObject comObject) throws JIException { return narrowObject(JIFrameworkHelper.instantiateComObject(session, comObject)); } }
/** * 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 ( final JISession session, final byte[] rawBytes ) throws JIException { return narrowObject ( JIFrameworkHelper.instantiateComObject ( session, rawBytes, null ) ); }
/** * Typically used in the Man-In-The-Middle scenario. * <p> * Some possible use-cases :- * <ul> * <li>One j-Interop system interacts with another over the wire.</li> * <li>The <code>IJIComObject</code> is read from a database and is not * <i>attached</i> to a session.</li> * </ul> * * @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 comObject * <i>drifting</i> object. * @return * @throws JIException * @throws IllegalArgumentException * if <code>comObject</code> is <code>null</code> or a local * reference. * @see IJIComObject#isLocalReference() */ public static IJIComObject narrowObject ( final JISession session, final IJIComObject comObject ) throws JIException { return narrowObject ( JIFrameworkHelper.instantiateComObject ( session, comObject ) ); } }
return narrowObject ( JIFrameworkHelper.instantiateComObject ( session, rawBytes, ipAddress ) );
comObject = JIFrameworkHelper.instantiateComObject(session,interfacePtrCtor);
comObject = JIFrameworkHelper.instantiateComObject(session,interfacePtrCtor);
comObject = JIFrameworkHelper.instantiateComObject ( this.session, this.interfacePtrCtor );
/** 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()); }
/** * 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 ( final JISession session, final 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 () ); }
/** Returns an Interface Pointer representation from raw bytes. * * @exclude * @param session * @param rawBytes * @return * @throws JIException */ public static IJIComObject instantiateComObject(JISession session,byte[] rawBytes, String ipAddress) throws JIException { NetworkDataRepresentation ndr = new NetworkDataRepresentation(); NdrBuffer ndrBuffer = new NdrBuffer(rawBytes,0); ndr.setBuffer(ndrBuffer); ndrBuffer.length = rawBytes.length; //this is a brand new session. if (session.getStub() == null) { JIComServer comServer = new JIComServer(session,JIInterfacePointer.decode(ndr, new ArrayList(), JIFlags.FLAG_REPRESENTATION_INTERFACEPTR_DECODE2, new HashMap()),ipAddress); return comServer.getInstance(); } else { IJIComObject retval = instantiateComObject(session, JIInterfacePointer.decode(ndr, new ArrayList(), JIFlags.FLAG_REPRESENTATION_INTERFACEPTR_DECODE2, new HashMap())); //increasing the reference count. retval.addRef(); return retval; } }
/** * Returns an Interface Pointer representation from raw bytes. * * @exclude * @param session * @param rawBytes * @return * @throws JIException */ public static IJIComObject instantiateComObject ( final JISession session, final byte[] rawBytes, final String ipAddress ) throws JIException { final NetworkDataRepresentation ndr = new NetworkDataRepresentation (); final NdrBuffer ndrBuffer = new NdrBuffer ( rawBytes, 0 ); ndr.setBuffer ( ndrBuffer ); ndrBuffer.length = rawBytes.length; //this is a brand new session. if ( session.getStub () == null ) { final JIComServer comServer = new JIComServer ( session, JIInterfacePointer.decode ( ndr, new ArrayList (), JIFlags.FLAG_REPRESENTATION_INTERFACEPTR_DECODE2, new HashMap () ), ipAddress ); return comServer.getInstance (); } else { final IJIComObject retval = instantiateComObject ( session, JIInterfacePointer.decode ( ndr, new ArrayList (), JIFlags.FLAG_REPRESENTATION_INTERFACEPTR_DECODE2, new HashMap () ) ); //increasing the reference count. retval.addRef (); return retval; } }
/** Returns an Interface Pointer representation from raw bytes. * * @exclude * @param session * @param rawBytes * @return * @throws JIException */ public static IJIComObject instantiateComObject(JISession session,byte[] rawBytes, String ipAddress) throws JIException { NetworkDataRepresentation ndr = new NetworkDataRepresentation(); NdrBuffer ndrBuffer = new NdrBuffer(rawBytes,0); ndr.setBuffer(ndrBuffer); ndrBuffer.length = rawBytes.length; //this is a brand new session. if (session.getStub() == null) { JIComServer comServer = new JIComServer(session,JIInterfacePointer.decode(ndr, new ArrayList(), JIFlags.FLAG_REPRESENTATION_INTERFACEPTR_DECODE2, new HashMap()),ipAddress); return comServer.getInstance(); } else { IJIComObject retval = instantiateComObject(session, JIInterfacePointer.decode(ndr, new ArrayList(), JIFlags.FLAG_REPRESENTATION_INTERFACEPTR_DECODE2, new HashMap())); //increasing the reference count. retval.addRef(); return retval; } }
comObject = JIFrameworkHelper.instantiateComObject(session, remoteActivation.getMInterfacePointer()); if (remoteActivation.isDual)
comObject = JIFrameworkHelper.instantiateComObject ( this.session, this.remoteActivation.getMInterfacePointer () ); if ( this.remoteActivation.isDual )