Tuesday, 29 November 2011
Alfresco documentation for connecting using WebServices
http://wiki.alfresco.com/wiki/Alfresco_Content_Management_Web_Services
http://wiki.alfresco.com/wiki/Web_Service_Samples_for_Java
Monday, 28 November 2011
Spring Roo 1.2.0.RC1 released
- Multi-module Maven project support
- Enhancements in Entity model
Sunday, 27 November 2011
ProGuard - obfuscator for Android
Use Proguard.
ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. Finally, it preverifies the processed code for Java 6 or for Java Micro Edition.
More information on the product page: http://proguard.sourceforge.net/Wednesday, 16 November 2011
How to change MANIFEST.MF generated by maven?
Here is an example of configuring default class run when executing generated jar:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>package.Class</mainClass> </manifest> </archive> </configuration> </plugin>Here is an example of using already generated MANIFEST.MF file as the manifest file of the jar:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> </archive> </configuration> </plugin>
More info about plugin parameters on: http://maven.apache.org/maven-1.x/plugins/jar/manifest.html
Loading properties file in java
Properties properties = new Properties(); properties.load(is);
Linux console tools for measuring performance
- top, htop - processes measurement
- df - storage space info
- hdparm - storage performance
- cat /proc/cpuinfo - CPU info
- cat /proc/meminfo - RAM info
- vmstat, dstat - processes, memory, swap, IO, CPU info
- netstat - network info
- mpstat - CPU summary
- iostat - IO info
- iptraf - many metrics
Latency and Responsiveness
- Latency - a measure of time delay experienced in a system
- Responsiveness - ability of a functional unit to complete assigned tasks within a given time
Tuesday, 15 November 2011
Runing ChromeDriver on Linux
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.5.0</version> </dependency>I have created a simple java code in my main method:
WebDriver driver = new ChromeDriver(); driver.get("http://google.pl"); driver.findElement(By.name("q")).sendKeys("Selenium"); driver.findElement(By.name("q")).submit();My program did not manage to connect to Chrome web browser. I needed to download chromedriver from http://code.google.com/p/chromium/downloads/list and add a system property webdriver.chrome.driver with path to this file.
It did work!
Thursday, 10 November 2011
CXF - maven plug-in
I was implementing a Webservice client. I used Apache CXF (http://cxf.apache.org/) an open source services framework. It is a natural successor of Axis library.
After some time spent with CFX I can say that it uses Collections over Arrays (that is a big plus). On the other hand it hasn't got as good documentation as I expected. I tried to use maven task for generating java classes from WSDL definition files. When I got an error I had to use wsdl2java from command line to get detailed error message. Also I couldn't find syntax for wsdl2java task. I wished to use more parameters. I spent some time on finding how to do it. Underneath you can see an example to define configuration in pom.xml for wsdl2java operation. You can use more wsdlOption tags for generating classes from more then one WSDL file.
<build> <plugins> <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/wsdl/authentication-service.wsdl</wsdl> <extraargs> <extraarg>-client</extraarg> <extraarg>-p</extraarg> <extraarg>http://www.alfresco.org/ws/service/authentication/1.0=org.alfresco.ws.service.authentication</extraarg> </extraargs> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
Sunday, 6 November 2011
Saturday, 5 November 2011
Java Decompiler for Eclipse - JD-Eclipse
Here are instructions how to install it:
http://java.decompiler.free.fr/?q=jdeclipse