jodd

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jodd 
Jodd
License:BSD License
URL:http://jodd.sourceforge.net/
Description:Jodd is a generic purpose open-source Java library.
Package NameComment
jodd
jodd.bean Java Bean utilities, provides the fastest bean manipulation.
jodd.bean.loader Bean loaders iterate given bean, read property names and values which are stored into destination bean. Loaders also has static method for converision.
jodd.bean.modifier Bean modifiers changes values of bean properties.
jodd.bean.test
jodd.cache Some useful caches: LRU, LFU, FIFO.
jodd.datetime Finally, easy manipulation of date and time!
jodd.datetime.converter JDateTime converters to other objects.
jodd.datetime.formatter JDateTime formatters for converting date/time informations to/from strings.
jodd.db Simple and safe database access.
jodd.db.connection Various database connection providers.
jodd.db.jtx Database extension for simple propagated transactions.
jodd.db.orm ORM suite in less then 10 classes.
jodd.db.orm.mapper ResultSet to objects mappers.
jodd.db.orm.meta DbOrm annotations.
jodd.db.orm.sqlgen Various SQL generators for object-oriented and dynamic SQL queries.
jodd.db.orm.test
jodd.db.pool Various custom database pool implementations.
jodd.format Good, old, C-alike, enhanced and fast printf formatting utility.
jodd.introspector Very fast reflection introspector.
jodd.introspector.test
jodd.io File utilites.
jodd.io.filter Various file filters.
jodd.io.findfile Nice utilities for easier files and classes finding.
jodd.jtx Quick and dirty Java transactions management. No JTA, no two-phase commit, no XA, no theory; but - seems practical.
jodd.madvoc Madvoc.
jodd.madvoc.config Madvoc configurators.
jodd.madvoc.injector
jodd.madvoc.interceptor Various Madvoc action interceptors.
jodd.madvoc.meta Annotations used by Madvoc.
jodd.madvoc.result
jodd.mail Simple e-mail sending.
jodd.mutable Mutable number bean-alike implementations.
jodd.petite Petite container. Simple, small, fast.
jodd.petite.config Configurators for Petite container.
jodd.petite.meta Annotations used by Petite container.
jodd.petite.scope Petite bean scopes.
jodd.petite.test
jodd.proxetta

Proxetta creates the fastest proxy subclasses in an easy, java-friendly way.

Proxetta adds proxy methods arround the target method. Proxy method is defined in {@link ProxyTarget#invoke()} Proxy methods uses special 'macro'-alike static methods from ProxyTarget class. These static method invocations will be replaced with appropriate target invocation, once when proxy subclass is created. This unique feature makes generated code not to use reflections.

Replacements and modification rules

During creation of proxy method in proxy subclass, several replacement and modification rules are applied in order to produce valid subclass that will use its target superclass instead of ProxyTarget macros. Here is the list of all such rules.

Add all constructors [A1]

Proxy subclass must contain all constructors as a target subclass. New constructors simply delegates invocation to the super class. All contructor annotations are copied.

Add the last method in chain [A2]

Last method in proxy chain is the one that simply delegates the invocation to the target method in super class.

Add all type annotations [A3]

Proxy subclass must contain all type annotations as the target one.

Copy all annotations to the first method in proxy method chain [A4]

Proxy methods must contain all type annotations as the target one.

Fix the offset of local variables [F1]

Offset of all local variables has to be incremented by the size of target method argument list. Size of arguments list is the number of 32bit words used by arguments on stack, which means that all types has length of 1 word, except Long and Double that weight 2 words (or one dword).

iconst_1
istore_1
iconst_1
istore_13

Replace ProxyTarget.invoke [R1]

Call to ProxyTarget.invoke() has to be replaced with call to super target method. Since target methods may have one or more arguments, it is required to push all arguments to the stack prior to call of super target method. Note that aload_0 is always the first instruction, no matter how many arguments there are.

invokestatic package/ProxyTarget.invoke
aload_0
aload_1
iload_2
...
invokespecial package/Target.method

Fix return for ProxyTarget.invoke [F2]

When [R1] is applied, target methods with return value simply put the value onto stack. Since it is not used until the end of method, it may remain there. The only thing is to return this value at the end, if target method doesn't return void. Note that this is an optimized version of what java compiler would do: it will store internally the return value to new local variable and carry it until the return, where it will be loaded before returning.

...
return
...
areturn

Replace ProxyTarget.argsCount [R2]

Call to ProxyTarget.argsCount() has to be replaces with hardcoded arguments count. Method call is simply replaces with appropriate load instruction: iload_n where n is in [0. 5]; bipush n where n is in byte range; or sipush n when n is in integer range.


Replace ProxyTarget.getArgType [R3]

Call to ProxyTarget.getArgType(int ) has to be replaces with hardcoded argument Class, where argument index is provided as an argument for ProxyTarget.getArgType(int ). Method call is replaced with getClass() call on specified argument. If argument is an primitive then method is replaced with reading the TYPE attribute of appropriate wrapper.

One caveat: opcode for pushing argument offset to stack is not removed from the bytecode, due to performance issues. Instead, this value is poped from the stack before method call is replaced. It is assumed that this value is an integer.

iconst_1
invokestatic package/ProxyTarget.getArgClass
astore_1

iconst_2
invokestatic package/ProxyTarget.getArgClass
astore_2
(iconst_1
pop)
aload_1
invokevirtual java/lang/Object.getClass
astore 13

(iconst_2
pop)
getstatic java/lang/Byte.TYPE
astore 14

Replace ProxyTarget.getArg [R4]

Call to ProxyTarget.getArg(int ) has to be replaces with hardcoded argument value, where index is provided as an argument for ProxyTarget.getArg(int ). If argument is a primitive, its wrapper object will be created.

iconst_1
invokestatic package/ProxyTarget.getArg
astore_1

bipush 6
invokestatic package/ProxyTarget.getArg
astore_3
aload_1
astore_13

lload 6
invokestatic java/lang/Long.<init>
astore 14


Replace ProxyTarget.setArg [R5]

Call to ProxyTarget.setArg(Object, int ) has to be replaces with hardcoded setting of the argument value, where index is provided as an argument for ProxyTarget.setArg(Object, int ). If argument is a primitive, its wrapper object must be provided.

Replace ProxyTarget.createArgsArray [R6]

Call to ProxyTarget.createArgsArray() has to be replaces with hardcoded creation of an object array, where elements are target method arguments. Primitive arguments are wrapped.

Replace ProxyTarget.invokeAndGetResult [R7]

Call to ProxyTarget.invokeAndGetResult() has to be replaced with call to super target method. Since target methods may have one or more arguments, it is required to push all arguments to the stack prior to call of super target method. Note that aload_0 is always the first instruction, no matter how many arguments there are.

Situation here is a bit more complicated since return value must be provided, so the following fixes has to be applied, too.

Fix POP for ProxyTarget.invokeAndGetResult [F3]

When ProxyTarget.invokeAndGetResult() is invoked without assignment, POP/POP2 instruction is added afterwards, to remove the value from the stack. For targets that do not return void, this opcode has to be fixed, i.e. removed. (Fact is that targets that return void, do not have POP:).

Fix ASTORE for ProxyTarget.invokeAndGetResult [F4]

When ProxyTarget.invokeAndGetResult() is invoked with assignment, xSTORE instruction is added afterwards, to assign return value to a local variable. Therefore, it has to be loaded again on stack before return.

Replace ProxyTarget.setReturnVal [R8]

Sets resulting value. Must be called after invokeAndGetResult.

Replace ProxyTarget.getTargetClass [R9]

Returns the target class.

Replace ProxyTarget.getTargetMethodName [R10]

Returns target method name.

Replace ProxyTarget.getReturnType [R11]

Returns return type of the target method or null if metod returns void.

jodd.servlet Servlet utils.
jodd.servlet.filter Just few common JSP filters.
jodd.servlet.upload Multipart http request and module for uploading files.
jodd.servlet.upload.impl Various implementations of uploaded files and their factories.
jodd.swing Misc Swing util classes.
jodd.typeconverter Slick and various type conversions.
jodd.util Huge set of various utilities.
jodd.util.collection Few collection enhancements.
jodd.util.idgen Various ID generators.
jodd.util.sort Fastest sorting algoritms and implementations.
jodd.util.testdata
jodd.util.testdata2
madvoc
madvoc.biz
madvoc.girl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.