@Override public JIInterfacePointer internal_getInterfacePointer () { return this.ptr == null ? this.session.getStub ().getServerInterfacePointer () : this.ptr; }
/** * @exclude * @param src * @param target */ static JIInterfacePointer getInterfacePointerOfStub(JISession session) { return session.getStub().getServerInterfacePointer(); }
/** * @exclude * @param src * @param target */ static JIInterfacePointer getInterfacePointerOfStub(JISession session) { return session.getStub().getServerInterfacePointer(); }
/** * @exclude * @param src * @param target */ static JIInterfacePointer getInterfacePointerOfStub ( final JISession session ) { return session.getStub ().getServerInterfacePointer (); }
public JIInterfacePointer internal_getInterfacePointer() { return ptr == null ? session.getStub().getServerInterfacePointer() : ptr; }
public JIInterfacePointer internal_getInterfacePointer() { return ptr == null ? session.getStub().getServerInterfacePointer() : ptr; }
/** <p>Refer {@link #JIComServer(JIClsid, JISession)} for details. * * * @param clsid 128 bit string such as "00024500-0000-0000-C000-000000000046". * @param address address of the host where the <code>COM</code> object resides.This should be in the IEEE IP format (e.g. 192.168.170.6) or a resolvable HostName. * @param session session to be associated with. * @throws JIException will <i>also</i> get thrown in case the <code>session</code> is associated with another server already. * @throws IllegalArgumentException raised when any of the parameters is <code>null</code>. * @throws UnknownHostException */ public JIComServer(JIClsid clsid,String address, JISession session) throws JIException, UnknownHostException { super(); if (clsid == null || address == null || session == null) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMSTUB_ILLEGAL_ARGUMENTS)); } if (session.getStub() != null) { throw new JIException(JIErrorCodes.JI_SESSION_ALREADY_ESTABLISHED); } address = address.trim(); //address = address.replace(' ',''); address = "ncacn_ip_tcp:"+InetAddress.getByName(address).getHostAddress()+"[135]"; initialise(clsid,address,session); }
/** <p>Refer {@link #JIComServer(JIClsid, JISession)} for details. * * * @param clsid 128 bit string such as "00024500-0000-0000-C000-000000000046". * @param address address of the host where the <code>COM</code> object resides.This should be in the IEEE IP format (e.g. 192.168.170.6) or a resolvable HostName. * @param session session to be associated with. * @throws JIException will <i>also</i> get thrown in case the <code>session</code> is associated with another server already. * @throws IllegalArgumentException raised when any of the parameters is <code>null</code>. * @throws UnknownHostException */ public JIComServer(JIClsid clsid,String address, JISession session) throws JIException, UnknownHostException { super(); if (clsid == null || address == null || session == null) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COMSTUB_ILLEGAL_ARGUMENTS)); } if (session.getStub() != null) { throw new JIException(JIErrorCodes.JI_SESSION_ALREADY_ESTABLISHED); } address = address.trim(); //address = address.replace(' ',''); address = "ncacn_ip_tcp:"+InetAddress.getByName(address).getHostAddress()+"[135]"; initialise(clsid,address,session); }
@Override public IJIComObject queryInterface ( final String iid ) throws JIException { checkLocal (); return this.session.getStub ().getInterface ( iid, this.ptr.getIPID () ); }
public IJIComObject queryInterface(String iid) throws JIException { checkLocal(); return session.getStub().getInterface(iid,ptr.getIPID()); }
public IJIComObject queryInterface(String iid) throws JIException { checkLocal(); return session.getStub().getInterface(iid,ptr.getIPID()); }
if (session.getStub() != null)
/** * 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; } }
public Object[] call(JICallBuilder obj, int socketTimeout) throws JIException { checkLocal(); obj.attachSession(session); obj.setParentIpid(ptr.getIPID()); //Call is always made on your stub. if (socketTimeout != 0) //using instance level timeout { return session.getStub().call(obj,ptr.getIID(),socketTimeout); } else { return session.getStub().call(obj,ptr.getIID()); } }
/** 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; } }
public Object[] call(JICallBuilder obj, int socketTimeout) throws JIException { checkLocal(); obj.attachSession(session); obj.setParentIpid(ptr.getIPID()); //Call is always made on your stub. if (socketTimeout != 0) //using instance level timeout { return session.getStub().call(obj,ptr.getIID(),socketTimeout); } else { return session.getStub().call(obj,ptr.getIID()); } }
/** 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; } }
@Override public Object[] call ( final JICallBuilder obj, final int socketTimeout ) throws JIException { checkLocal (); obj.attachSession ( this.session ); obj.setParentIpid ( this.ptr.getIPID () ); //Call is always made on your stub. if ( socketTimeout != 0 ) //using instance level timeout { return this.session.getStub ().call ( obj, this.ptr.getIID (), socketTimeout ); } else { return this.session.getStub ().call ( obj, this.ptr.getIID () ); } }
public void release() throws JIException { checkLocal(); JICallBuilder obj = new JICallBuilder(true); obj.setParentIpid(ptr.getIPID()); obj.setOpnum(2);//release //length obj.addInParamAsShort((short)1,JIFlags.FLAG_NULL); //ipid to addfref on JIArray array = new JIArray(new rpc.core.UUID[]{new rpc.core.UUID(ptr.getIPID())},true); obj.addInParamAsArray(array,JIFlags.FLAG_NULL); //TODO requesting 5 for now, will later build caching mechnaism to exhaust 5 refs first before asking for more // same with release. obj.addInParamAsInt(5,JIFlags.FLAG_NULL); obj.addInParamAsInt(0,JIFlags.FLAG_NULL);//private refs = 0 if (JISystem.getLogger().isLoggable(Level.WARNING)) { JISystem.getLogger().warning("RELEASE called directly ! removing 5 references for " + ptr.getIPID()+ " session: " + session.getSessionIdentifier()); JISession.debug_delIpids(ptr.getIPID(), 5); } session.getStub().addRef_ReleaseRef(obj); }
session.getStub().addRef_ReleaseRef(obj);