Posts

Showing posts from October, 2014

Get System Information under JAVA

How to get the Computer brand and model from JAVA under Windows. private static String execCmd(String cmd) throws java.io.IOException { java.util.Scanner s = new java.util.Scanner(Runtime.getRuntime().exec(cmd).getInputStream()).useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; } public getSystemInfo() { try { String result=execCmd("wmic.exe computersystem get model,name,manufacturer,systemtype"); return result; } catch (IOException ex) { } return "Not available"; }

CORBA, OMNIORB, Asynchronous Method Invocation

AMI: Asynchronous Method Invocation under CORBA allows generation of asynchronous callback handlers and poolers. The idl compiler generates de corresponding code to handle the responses. 1- Create a 'idl' folder and create AMIExample.idl file into it: interface AMIExample {   string asyncMe(in string inputValue); }; 2- Create a compile script in the previous folder, for example idlcompile.bat: set OMINIDL=C:\omniorb\omniORB-4.2.0\bin\x86_win32\omniidl %OMINIDL% -bcxx -bami AmiExample.idl >> AmiExample.txt %OMINIDL% -bcxx -Wbami AmiExample.idl Parameter -bami AmiExample.idl >> AmiExample.txt indicates the compiler that it should create a description of the created interfaces and put it into AmiExample.txt. After executing the compiling script AmiExample.hh,AmiexampleSK.cc and AmiExample.txt will be created into the folder. AmiExample.txt gives a detailed definition of the available interfaces in the generated class. // ReplyHandler for interface AMIE