public void setConformantIntArray() throws JIException, InterruptedException, UnknownHostException { System.gc(); JICallBuilder callObject = new JICallBuilder( true); callObject.setOpnum(9); Object results[]; int i = 4; Integer[] intAry = new Integer[i]; for(int j = 0; j < i; j++) { intAry[j] = new Integer(j); } JIArray ary = new JIArray(intAry, true); callObject.addInParamAsInt(i, JIFlags.FLAG_NULL); callObject.addInParamAsArray(ary, JIFlags.FLAG_NULL); results = comObject.call(callObject); }
public void setConformantIntArray() throws JIException, InterruptedException, UnknownHostException { System.gc(); JICallBuilder callObject = new JICallBuilder( true); callObject.setOpnum(9); Object results[]; int i = 4; Integer[] intAry = new Integer[i]; for(int j = 0; j < i; j++) { intAry[j] = new Integer(j); } JIArray ary = new JIArray(intAry, true); callObject.addInParamAsInt(i, JIFlags.FLAG_NULL); callObject.addInParamAsArray(ary, JIFlags.FLAG_NULL); results = comObject.call(callObject); }
public void setConformantIntArray () throws JIException, InterruptedException, UnknownHostException { System.gc (); final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 9 ); Object results[]; final int i = 4; final Integer[] intAry = new Integer[i]; for ( int j = 0; j < i; j++ ) { intAry[j] = new Integer ( j ); } final JIArray ary = new JIArray ( intAry, true ); callObject.addInParamAsInt ( i, JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( ary, JIFlags.FLAG_NULL ); results = this.comObject.call ( callObject ); }
private void releaseRefs ( final JIArray arrayOfStructs, final boolean fromDestroy ) throws JIException { logger.info ( "In releaseRefs for session : {} , array length is: {}", getSessionIdentifier (), (short) ( (Object[])arrayOfStructs.getArrayInstance () ).length ); final JICallBuilder obj = new JICallBuilder ( true ); obj.setOpnum ( 2 );//release //length obj.addInParamAsShort ( (short) ( (Object[])arrayOfStructs.getArrayInstance () ).length, JIFlags.FLAG_NULL ); obj.addInParamAsArray ( arrayOfStructs, JIFlags.FLAG_NULL ); obj.fromDestroySession = fromDestroy; this.stub2.addRef_ReleaseRef ( obj ); //ignore the results }
private void releaseRefs(JIArray arrayOfStructs, boolean fromDestroy) throws JIException { if (JISystem.getLogger().isLoggable(Level.INFO)) { JISystem.getLogger().info("In releaseRefs for session : " + getSessionIdentifier() + " , array length is: " + (short)(((Object[])arrayOfStructs.getArrayInstance()).length)); } JICallBuilder obj = new JICallBuilder(true); obj.setOpnum(2);//release //length obj.addInParamAsShort((short)(((Object[])arrayOfStructs.getArrayInstance()).length),JIFlags.FLAG_NULL); obj.addInParamAsArray(arrayOfStructs,JIFlags.FLAG_NULL); obj.fromDestroySession = fromDestroy; stub2.addRef_ReleaseRef(obj); //ignore the results }
private void releaseRefs(JIArray arrayOfStructs, boolean fromDestroy) throws JIException { if (JISystem.getLogger().isLoggable(Level.INFO)) { JISystem.getLogger().info("In releaseRefs for session : " + getSessionIdentifier() + " , array length is: " + (short)(((Object[])arrayOfStructs.getArrayInstance()).length)); } JICallBuilder obj = new JICallBuilder(true); obj.setOpnum(2);//release //length obj.addInParamAsShort((short)(((Object[])arrayOfStructs.getArrayInstance()).length),JIFlags.FLAG_NULL); obj.addInParamAsArray(arrayOfStructs,JIFlags.FLAG_NULL); obj.fromDestroySession = fromDestroy; stub.addRef_ReleaseRef(obj); //ignore the results }
public void SetSimpleArrayStructArray ( final String[] args ) throws JIException, InterruptedException, UnknownHostException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 21 ); //obtained from the IDL or TypeLib. ModifyStaticData Object results[]; final JIStruct simpleStruct = new JIStruct (); simpleStruct.addMember ( new Integer ( 5 ) ); simpleStruct.addMember ( new Double ( 25 ) ); simpleStruct.addMember ( new Float ( 2.5 ) ); final Integer shortValue = new Integer ( 1 ); final JIStruct simpleArrayStruct = new JIStruct (); simpleArrayStruct.addMember ( new Integer ( 54 ) ); simpleArrayStruct.addMember ( new Double ( 5 ) ); simpleArrayStruct.addMember ( JIUnsignedFactory.getUnsigned ( shortValue, JIFlags.FLAG_REPRESENTATION_UNSIGNED_SHORT ) ); final JIStruct[] structArray = new JIStruct[1]; structArray[0] = simpleStruct; simpleArrayStruct.addMember ( new JIPointer ( new JIArray ( structArray, true ) ) ); final JIStruct[] DataArray = new JIStruct[1]; DataArray[0] = simpleArrayStruct; final short size = 1; callObject.addInParamAsShort ( size, JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( new JIArray ( DataArray, true ), JIFlags.FLAG_NULL ); results = this.comObject.call ( callObject ); System.out.println ( "SetSimpleArrayStructArray worked!" ); }
public void SetSimpleArrayStructArray(String[] args) throws JIException, InterruptedException, UnknownHostException { JICallBuilder callObject = new JICallBuilder( true); callObject.setOpnum(21); //obtained from the IDL or TypeLib. ModifyStaticData Object results[]; JIStruct simpleStruct = new JIStruct(); simpleStruct.addMember(new Integer(5)); simpleStruct.addMember(new Double(25)); simpleStruct.addMember(new Float(2.5)); Integer shortValue = new Integer(1); JIStruct simpleArrayStruct = new JIStruct(); simpleArrayStruct.addMember(new Integer(54)); simpleArrayStruct.addMember(new Double(5)); simpleArrayStruct.addMember(JIUnsignedFactory.getUnsigned(shortValue, JIFlags.FLAG_REPRESENTATION_UNSIGNED_SHORT)); JIStruct[] structArray = new JIStruct[1]; structArray[0] = simpleStruct; simpleArrayStruct.addMember(new JIPointer(new JIArray(structArray, true))); JIStruct[] DataArray = new JIStruct[1]; DataArray[0] = simpleArrayStruct; short size = 1; callObject.addInParamAsShort(size, JIFlags.FLAG_NULL); callObject.addInParamAsArray(new JIArray(DataArray, true), JIFlags.FLAG_NULL); results = comObject.call(callObject); System.out.println("SetSimpleArrayStructArray worked!"); }
void releaseRef ( final String IPID, final int numinstances ) throws JIException { logger.info ( "releaseRef:Reclaiming from Session: {} , the IPID: {}, numinstances is {}", numinstances, new Object[] { getSessionIdentifier (), IPID, numinstances } ); final JICallBuilder obj = new JICallBuilder ( true ); obj.setParentIpid ( IPID ); obj.setOpnum ( 2 );//release //length obj.addInParamAsShort ( (short)1, JIFlags.FLAG_NULL ); //ipid to addfref on final JIArray array = new JIArray ( new rpc.core.UUID[] { new rpc.core.UUID ( IPID ) }, 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 ( numinstances, JIFlags.FLAG_NULL ); obj.addInParamAsInt ( 0, JIFlags.FLAG_NULL );//private refs = 0 if ( logger.isInfoEnabled () ) { debug_delIpids ( IPID, numinstances ); logger.info ( "releaseRef: Releasing numinstances {} references of IPID: {} session: {}", new Object[] { numinstances, IPID, getSessionIdentifier () } ); } this.stub2.addRef_ReleaseRef ( obj ); }
void releaseRef(String IPID) throws JIException { if (JISystem.getLogger().isLoggable(Level.INFO)) { JISystem.getLogger().info("releaseRef:Reclaiming from Session: " + getSessionIdentifier() + " , the IPID: " + IPID); } JICallBuilder obj = new JICallBuilder(true); obj.setParentIpid(IPID); 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(IPID)},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("releaseRef: Releasing 5 references of IPID: " + IPID + " session: " + getSessionIdentifier()); debug_delIpids(IPID, 5); } stub.addRef_ReleaseRef(obj); }
void releaseRef(String IPID,int numinstances) throws JIException { if (JISystem.getLogger().isLoggable(Level.INFO)) { JISystem.getLogger().info("releaseRef:Reclaiming from Session: " + getSessionIdentifier() + " , the IPID: " + IPID + ", numinstances is " + numinstances); } JICallBuilder obj = new JICallBuilder(true); obj.setParentIpid(IPID); 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(IPID)},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(numinstances,JIFlags.FLAG_NULL); obj.addInParamAsInt(0,JIFlags.FLAG_NULL);//private refs = 0 if (JISystem.getLogger().isLoggable(Level.INFO)) { JISystem.getLogger().warning("releaseRef: Releasing numinstances " + numinstances + " references of IPID: " + IPID + " session: " + getSessionIdentifier()); debug_delIpids(IPID, numinstances); } stub2.addRef_ReleaseRef(obj); }
@Override public void release () throws JIException { checkLocal (); final JICallBuilder obj = new JICallBuilder ( true ); obj.setParentIpid ( this.ptr.getIPID () ); obj.setOpnum ( 2 );//release //length obj.addInParamAsShort ( (short)1, JIFlags.FLAG_NULL ); //ipid to addfref on final JIArray array = new JIArray ( new rpc.core.UUID[] { new rpc.core.UUID ( this.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 ( logger.isInfoEnabled () ) { logger.info ( "RELEASE called directly ! removing 5 references for " + this.ptr.getIPID () + " session: " + this.session.getSessionIdentifier () ); JISession.debug_delIpids ( this.ptr.getIPID (), 5 ); } this.session.getStub2 ().addRef_ReleaseRef ( obj ); }
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); }
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.INFO)) { JISystem.getLogger().warning("RELEASE called directly ! removing 5 references for " + ptr.getIPID()+ " session: " + session.getSessionIdentifier()); JISession.debug_delIpids(ptr.getIPID(), 5); } session.getStub2().addRef_ReleaseRef(obj); }
public void read ( final IORequest[] requests ) throws JIException { if ( requests.length == 0 ) { return; } JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); JIString itemIDs[] = new JIString[requests.length]; Integer maxAges[] = new Integer[requests.length]; for ( int i = 0; i < requests.length; i++ ) { itemIDs[i] = new JIString ( requests[i].getItemID (), JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); maxAges[i] = new Integer ( requests[i].getMaxAge () ); } callObject.addInParamAsInt ( requests.length, JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( new JIArray ( itemIDs, true ), JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( new JIArray ( maxAges, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( JIVariant.class, null, 1, true ) ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( FILETIME.getStruct (), null, 1, true ) ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL ); getCOMObject ().call ( callObject ); } }
obj.addInParamAsArray(array,JIFlags.FLAG_NULL);
public ResultSet<Integer> remove ( final Integer... serverHandles ) throws JIException { if ( serverHandles.length == 0 ) { return new ResultSet<Integer> (); } final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 2 ); callObject.addInParamAsInt ( serverHandles.length, JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL ); final Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject ); final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance (); final ResultSet<Integer> results = new ResultSet<Integer> ( serverHandles.length ); for ( int i = 0; i < serverHandles.length; i++ ) { results.add ( new Result<Integer> ( serverHandles[i], errorCodes[i] ) ); } return results; }
public ResultSet<Integer> setActiveState ( final boolean state, final Integer... items ) throws JIException { if ( items.length == 0 ) { return new ResultSet<Integer> (); } final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 3 ); callObject.addInParamAsInt ( items.length, JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( new JIArray ( items, true ), JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( state ? 1 : 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL ); final Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject ); final Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance (); final ResultSet<Integer> results = new ResultSet<Integer> ( items.length ); for ( int i = 0; i < items.length; i++ ) { results.add ( new Result<Integer> ( items[i], errorCodes[i] ) ); } return results; }
callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( transactionId, JIFlags.FLAG_NULL );
public KeyedResultSet<Integer, OPCITEMSTATE> read ( final OPCDATASOURCE source, final Integer... serverHandles ) throws JIException { if ( serverHandles == null || serverHandles.length == 0 ) { return new KeyedResultSet<Integer, OPCITEMSTATE> (); } JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); callObject.addInParamAsShort ( (short)source.id (), JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( serverHandles.length, JIFlags.FLAG_NULL ); callObject.addInParamAsArray ( new JIArray ( serverHandles, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( OPCITEMSTATE.getStruct (), null, 1, true ) ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL ); Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject ); KeyedResultSet<Integer, OPCITEMSTATE> results = new KeyedResultSet<Integer, OPCITEMSTATE> (); JIStruct[] states = (JIStruct[]) ( (JIArray) ( (JIPointer)result[0] ).getReferent () ).getArrayInstance (); Integer[] errorCodes = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance (); for ( int i = 0; i < serverHandles.length; i++ ) { results.add ( new KeyedResult<Integer, OPCITEMSTATE> ( serverHandles[i], OPCITEMSTATE.fromStruct ( states[i] ), errorCodes[i] ) ); } return results; }