void AttachEventListener() throws JIException { //6FBA474D-43AC-11CE-9A0E-00AA0062BB4C JILocalCoClass javaComponent = new JILocalCoClass(new JILocalInterfaceDefinition("6FBA474D-43AC-11CE-9A0E-00AA0062BB4C"),SysInfoEvents.class); javaComponent.getInterfaceDefinition().addMethodDescriptor(new JILocalMethodDescriptor("PowerStatusChanged",8,null)); javaComponent.getInterfaceDefinition().addMethodDescriptor(new JILocalMethodDescriptor("TimeChanged",3,null)); identifier = JIObjectFactory.attachEventHandler(sysInfoServer,"6FBA474D-43AC-11CE-9A0E-00AA0062BB4C",JIObjectFactory.buildObject(session,javaComponent)); try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //for call backs }
/** * Returns the interface identifier of this COCLASS. <br> * @return * @see #JILocalCoClass(JILocalInterfaceDefinition, Class) * @see #JILocalCoClass(JILocalInterfaceDefinition, Object) * @see JILocalInterfaceDefinition#getInterfaceIdentifier() */ public String getCoClassIID() { return interfaceDefinition.getInterfaceIdentifier(); }
if ( this.interfaceDefinition.isDispInterface () ) JILocalMethodDescriptor info = interfaceDefinitionOfClass.getMethodDescriptor ( apiName.getString () ); if ( info == null ) info = interfaceDefinitionOfClass.getMethodDescriptorForDispId ( dispId ); if ( info == null ) methodDescriptor = interfaceDefinitionOfClass.getMethodDescriptor ( Opnum - 3 ); //adjust for IUnknown if ( methodDescriptor == null )
if (component.getInterfaceDefinitionFromIPID(ipid).isDispInterface() && opnum == 6)
if (interfaceDefinition.isDispInterface()) JILocalMethodDescriptor info = interfaceDefinitionOfClass.getMethodDescriptor(apiName.getString()); if (info == null) info = interfaceDefinitionOfClass.getMethodDescriptorForDispId(dispId); if (info == null) methodDescriptor = interfaceDefinitionOfClass.getMethodDescriptor(Opnum - 3); //adjust for IUnknown if (methodDescriptor == null)
if ( this.component.getInterfaceDefinitionFromIPID ( ipid ).isDispInterface () && this.opnum == 6 )
void AttachEventListener() throws JIException { //6FBA474D-43AC-11CE-9A0E-00AA0062BB4C JILocalCoClass javaComponent = new JILocalCoClass(new JILocalInterfaceDefinition("6FBA474D-43AC-11CE-9A0E-00AA0062BB4C"),SysInfoEvents.class); javaComponent.getInterfaceDefinition().addMethodDescriptor(new JILocalMethodDescriptor("PowerStatusChanged",8,null)); javaComponent.getInterfaceDefinition().addMethodDescriptor(new JILocalMethodDescriptor("TimeChanged",3,null)); identifier = JIObjectFactory.attachEventHandler(sysInfoServer,"6FBA474D-43AC-11CE-9A0E-00AA0062BB4C",JIObjectFactory.buildObject(session,javaComponent)); try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //for call backs }
if (interfaceDefinition.isDispInterface()) JILocalMethodDescriptor info = interfaceDefinitionOfClass.getMethodDescriptor(apiName.getString()); if (info == null) info = interfaceDefinitionOfClass.getMethodDescriptorForDispId(dispId); if (info == null) methodDescriptor = interfaceDefinitionOfClass.getMethodDescriptor(Opnum - 3); //adjust for IUnknown if (methodDescriptor == null)
/** * Returns the interface identifier of this COCLASS. <br> * @return * @see #JILocalCoClass(JILocalInterfaceDefinition, Class) * @see #JILocalCoClass(JILocalInterfaceDefinition, Object) * @see JILocalInterfaceDefinition#getInterfaceIdentifier() */ public String getCoClassIID() { return interfaceDefinition.getInterfaceIdentifier(); }
if (component.getInterfaceDefinitionFromIPID(ipid).isDispInterface() && opnum == 6)
void AttachEventListener () throws JIException { //6FBA474D-43AC-11CE-9A0E-00AA0062BB4C final JILocalCoClass javaComponent = new JILocalCoClass ( new JILocalInterfaceDefinition ( "6FBA474D-43AC-11CE-9A0E-00AA0062BB4C" ), SysInfoEvents.class ); javaComponent.getInterfaceDefinition ().addMethodDescriptor ( new JILocalMethodDescriptor ( "PowerStatusChanged", 8, null ) ); javaComponent.getInterfaceDefinition ().addMethodDescriptor ( new JILocalMethodDescriptor ( "TimeChanged", 3, null ) ); this.identifier = JIObjectFactory.attachEventHandler ( this.sysInfoServer, "6FBA474D-43AC-11CE-9A0E-00AA0062BB4C", JIObjectFactory.buildObject ( this.session, javaComponent ) ); try { Thread.sleep ( 3000 ); } catch ( final InterruptedException e ) { // TODO Auto-generated catch block e.printStackTrace (); } //for call backs }
/** * Returns the interface identifier of this COCLASS. <br> * * @return * @see #JILocalCoClass(JILocalInterfaceDefinition, Class) * @see #JILocalCoClass(JILocalInterfaceDefinition, Object) * @see JILocalInterfaceDefinition#getInterfaceIdentifier() */ public String getCoClassIID () { return this.interfaceDefinition.getInterfaceIdentifier (); }
public static final JILocalCoClass getCoClass ( final JIOPCEventSink instance ) { //Define the onEvent method for this interface final JILocalParamsDescriptor oeParams = new JILocalParamsDescriptor (); oeParams.addInParamAsType ( Integer.class, JIFlags.FLAG_NULL ); oeParams.addInParamAsType ( Integer.class, JIFlags.FLAG_NULL ); oeParams.addInParamAsType ( Integer.class, JIFlags.FLAG_NULL ); oeParams.addInParamAsType ( Integer.class, JIFlags.FLAG_NULL ); oeParams.addInParamAsObject ( new JIArray ( outStruct (), null, 1, true ), JIFlags.FLAG_NULL ); final JILocalMethodDescriptor oeMethod = new JILocalMethodDescriptor ( "onEvent", 0, oeParams ); //This identify the JIOPCEventSink and not the interface final JILocalInterfaceDefinition def = new JILocalInterfaceDefinition ( LOCAL_CLASS_IID, false ); def.addMethodDescriptor ( oeMethod ); final JILocalCoClass coClass = instance == null ? new JILocalCoClass ( def, JIOPCEventSink.class ) : new JILocalCoClass ( def, instance ); final ArrayList list = new ArrayList (); //Supported interface list.add ( OPC_IID ); coClass.setSupportedEventInterfaces ( list ); return coClass; } }
private void init(JILocalInterfaceDefinition interfaceDefinition,Class clazz,Object instance,boolean realIID) { listOfSupportedInterfaces.add(IID_IDispatch.toUpperCase()); //IDispatch listOfSupportedInterfaces.add("00000131-0000-0000-C000-000000000046"); //IRemUnknown this.interfaceDefinition = interfaceDefinition; interfaceDefinition .clazz = clazz; interfaceDefinition.instance = instance; listOfSupportedInterfaces.add(interfaceDefinition.getInterfaceIdentifier().toUpperCase()); mapOfIIDsToInterfaceDefinitions.put(interfaceDefinition.getInterfaceIdentifier().toUpperCase(),interfaceDefinition); this.realIID = realIID; }
public static final JILocalCoClass getCoClass(JIOPCEventSink instance){ //Define the onEvent method for this interface JILocalParamsDescriptor oeParams=new JILocalParamsDescriptor(); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsObject(new JIArray(outStruct(),null,1,true), JIFlags.FLAG_NULL); JILocalMethodDescriptor oeMethod=new JILocalMethodDescriptor("onEvent",0,oeParams); //This identify the JIOPCEventSink and not the interface JILocalInterfaceDefinition def=new JILocalInterfaceDefinition(LOCAL_CLASS_IID,false); def.addMethodDescriptor(oeMethod); JILocalCoClass coClass=(instance==null) ? new JILocalCoClass(def,JIOPCEventSink.class) : new JILocalCoClass(def,instance); ArrayList list = new ArrayList(); //Supported interface list.add(OPC_IID); coClass.setSupportedEventInterfaces(list); return coClass; } }
private void init(JILocalInterfaceDefinition interfaceDefinition,Class clazz,Object instance,boolean realIID) { listOfSupportedInterfaces.add(IID_IDispatch.toUpperCase()); //IDispatch listOfSupportedInterfaces.add("00000131-0000-0000-C000-000000000046"); //IRemUnknown this.interfaceDefinition = interfaceDefinition; interfaceDefinition .clazz = clazz; interfaceDefinition.instance = instance; listOfSupportedInterfaces.add(interfaceDefinition.getInterfaceIdentifier().toUpperCase()); mapOfIIDsToInterfaceDefinitions.put(interfaceDefinition.getInterfaceIdentifier().toUpperCase(),interfaceDefinition); this.realIID = realIID; }
public static final JILocalCoClass getCoClass(JIOPCEventSink instance){ //Define the onEvent method for this interface JILocalParamsDescriptor oeParams=new JILocalParamsDescriptor(); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsType(Integer.class, JIFlags.FLAG_NULL); oeParams.addInParamAsObject(new JIArray(outStruct(),null,1,true), JIFlags.FLAG_NULL); JILocalMethodDescriptor oeMethod=new JILocalMethodDescriptor("onEvent",0,oeParams); //This identify the JIOPCEventSink and not the interface JILocalInterfaceDefinition def=new JILocalInterfaceDefinition(LOCAL_CLASS_IID,false); def.addMethodDescriptor(oeMethod); JILocalCoClass coClass=(instance==null) ? new JILocalCoClass(def,JIOPCEventSink.class) : new JILocalCoClass(def,instance); ArrayList list = new ArrayList(); //Supported interface list.add(OPC_IID); coClass.setSupportedEventInterfaces(list); return coClass; } }
private void init ( final JILocalInterfaceDefinition interfaceDefinition, final Class clazz, final Object instance, final boolean realIID ) { this.listOfSupportedInterfaces.add ( IID_IDispatch.toUpperCase () ); //IDispatch this.listOfSupportedInterfaces.add ( "00000131-0000-0000-C000-000000000046" ); //IRemUnknown this.interfaceDefinition = interfaceDefinition; interfaceDefinition.clazz = clazz; interfaceDefinition.instance = instance; this.listOfSupportedInterfaces.add ( interfaceDefinition.getInterfaceIdentifier ().toUpperCase () ); this.mapOfIIDsToInterfaceDefinitions.put ( interfaceDefinition.getInterfaceIdentifier ().toUpperCase (), interfaceDefinition ); this.realIID = realIID; }
JILocalCoClass javaComponent = new JILocalCoClass(new JILocalInterfaceDefinition("34A715A0-6587-11D0-924A-0020AFC7AC4D"),DWebBrowserEvents2.class); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); navigateObject.addInParamAsType(JIVariant.class,JIFlags.FLAG_NULL); methodDescriptor = new JILocalMethodDescriptor("BeforeNavigate2",0xFA,navigateObject); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); ProgressChange.addInParamAsType(Integer.class,JIFlags.FLAG_NULL); methodDescriptor = new JILocalMethodDescriptor("ProgressChange",0x6c,ProgressChange); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); CommandStateChange.addInParamAsType(Boolean.class,JIFlags.FLAG_NULL); methodDescriptor = new JILocalMethodDescriptor("CommandStateChange",0x69,CommandStateChange); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); NewWindow2.addInParamAsType(JIVariant.class,JIFlags.FLAG_NULL); methodDescriptor = new JILocalMethodDescriptor("NewWindow2",0xfb,NewWindow2); javaComponent.getInterfaceDefinition().addMethodDescriptor(methodDescriptor); NavigateComplete2.addInParamAsType(JIVariant.class,JIFlags.FLAG_NULL);
/**Add another interface definition and it's supporting object instance. * * @param interfaceDefinition implementing structurally the definition of the COM callback interface. * @param instance instance for serving requests from COM client. Must implement * the <code>interfaceDefinition</code> fully. * @throws IllegalArgumentException if <code>interfaceDefinition</code> or <code>instance</code> are <code>null</code>. */ public void addInterfaceDefinition(JILocalInterfaceDefinition interfaceDefinition, Object instance ) { if (interfaceDefinition == null || instance == null) { throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.JI_COM_RUNTIME_INVALID_CONTAINER_INFO)); } interfaceDefinition.instance = instance; String s = interfaceDefinition.getInterfaceIdentifier().toUpperCase(); listOfSupportedInterfaces.add(s); listOfSupportedEventInterfaces.add(s); mapOfIIDsToInterfaceDefinitions.put(s,interfaceDefinition); }