Thursday, May 13, 2010

Example Build File Using the Custom Ant Task

 

1 <?xml version="1.0"?>
2 <project name="CodegenExample" default="main" basedir=".">
3
4 <path id="example.classpath">
5 <fileset dir="classes">
6 <include name="**/*.jar" />
7 </fileset>
8 </path>
9
10 <target name="declare" >
11 <taskdef name="codegen"
12 classname="org.apache.axis2.tool.ant.AntCodegenTask"
13 classpathref="example.classpath"/>
15 </target>
16
17 <target name="main" depends="declare">
18 <codegen
19 wsdlfilename="C:\test\wsdl\CombinedService.wsdl"
20 output="C:\output"
21 serverside="true"
22 generateservicexml="true"/>
23 </target>
24
25 </project>

 

 

 

http://ws.apache.org/axis2/tools/1_4/CodegenToolReference.html


You might also like ..


SHARE & SAVE
Delicious Digg Furl Stumbleupon Technorati Squidoo Reddit live Yahoo MySpaceGoogle Yahoo Buzz Facebook Twitter Orkut Google Buzz Email this postby bbP

Monday, April 26, 2010

what will happen if I serialize and de-serialize a singleton instance in same JVM?

what will happen if I serialize and de-serialize a singleton instance in same JVM?

We will get two instances of Singleton object. To avoid that we should use a readResolve() method which returns the singleton instance.


Implementing a Serializable Singleton:

public class MySingleton implements Serializable
{
static MySingleton singleton = new MySingleton();
private MySingleton() {
}
// This method is called immediately after an object of this class is deserialized.
// This method returns the singleton instance.
protected Object readResolve()
{
return singleton;
}
}


You might also like ..


SHARE & SAVE
Delicious Digg Furl Stumbleupon Technorati Squidoo Reddit live Yahoo MySpaceGoogle Yahoo Buzz Facebook Twitter Orkut Google Buzz Email this postby bbP

what is JIT - Just In Time Compiler?

what is JIT - Just In Time Compiler?

JIT is sometimes called as Dynamic translation is a technique to improve the run time performance of a computer system.
JIT builds upon two earlier ideas in run-time environments: bytecode compilation and dynamic compilation.
It converts code at runtime prior to executing it natively, for example bytecode  into native machine code.

In a bytecode-compiled system, source code is translated to an intermediate representation known as bytecode. Bytecode is not the machine code for any particular computer, and may be portable among computer architectures. The bytecode may then be interpreted by, or run on, a virtual machine. A just-in-time compiler can be used as a way to speed up execution of bytecode. At the time the bytecode is run, the just-in-time compiler will compile some or all of it to native machine code for better performance. This can be done per-file, per-function or even on any arbitrary code fragment; the code can be compiled when it is about to be executed (hence the name "just-in-time").

Resource: http://en.wikipedia.org/wiki/Just-in-time_compilation


You might also like ..


SHARE & SAVE
Delicious Digg Furl Stumbleupon Technorati Squidoo Reddit live Yahoo MySpaceGoogle Yahoo Buzz Facebook Twitter Orkut Google Buzz Email this postby bbP