Java Doc for ByteCodeUtil.java in  » Net » Terracotta » com » tc » object » bytecode » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 » Net » Terracotta » com.tc.object.bytecode 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.tc.object.bytecode.ByteCodeUtil

ByteCodeUtil
public class ByteCodeUtil implements Opcodes(Code)
Utility methods for working with byte code.


Field Summary
final public static  StringDMI_METHOD_RENAME_PREFIX
    
final public static  StringMANAGEABLE_CLASS
    
final public static  StringMANAGEABLE_TYPE
    
final public static  StringMANAGED_VALUES_GETTER
    
final public static  StringMANAGED_VALUES_GETTER_DESCRIPTION
    
final public static  StringMANAGED_VALUES_SETTER
    
final public static  StringMETHOD_RENAME_PREFIX
    
final public static  StringNAMEDCLASSLOADER_CLASS
    
final public static  StringNAMEDCLASSLOADER_TYPE
    
final public static  StringSYNC_METHOD_RENAME_PREFIX
    
final public static  StringTC_FIELD_PREFIX
    
final public static  StringTC_METHOD_PREFIX
    
final public static  StringTRANSPARENT_ACCESS_CLASS
    
final public static  StringTRANSPARENT_ACCESS_TYPE
    
final public static  StringVALUES_GETTER
    
final public static  StringVALUES_GETTER_DESCRIPTION
    
final public static  StringVALUES_SETTER
    
final public static  StringVALUES_SETTER_DESCRIPTION
    
final public static  StringWEBAPPCONFIG_CLASS
    
final public static  StringWEBAPPCONFIG_TYPE
    


Method Summary
public static  String[]addInterfaces(String[] existing, String[] toAdd)
    
public static  voidaddTypeSpecificParameterLoad(MethodVisitor c, Type type, int offset)
     Add instructions to load type-specific value from local variable onto stack.
final public static  StringclassNameToFileName(String className)
    
public static  StringcodeToName(String typeCode)
    
public static  voidcreateParametersToArrayByteCode(MethodVisitor c, Type[] parameters)
    
public static  voidcreateParametersToArrayByteCode(MethodVisitor c, Type[] parameters, int offset)
    
public static  StringfieldGetterMethod(String fieldName)
    
public static  StringfieldSetterMethod(String fieldName)
    
public static  StringgenerateAutolockName(ObjectID id)
    
public static  StringgenerateLiteralLockName(int literalValuesValueFor, Object obj)
     The first argument should be "(new LiteralValues()).valueFor(obj)", but I didn't want to slurp in a whole mess of classes into the boot jar by including LiteralValues.
public static  StringgenerateNamedLockName(Object obj)
    
public static  StringgenerateVolatileLockName(ObjectID id, String fieldName)
    
final public static  byte[]getBytesForClass(String className, ClassLoader loader)
    
final public static  byte[]getBytesForInputstream(InputStream is)
     Read input stream into a byte array using a 4k buffer.
public static  intgetFirstLocalVariableOffset(int callingMethodModifier, String desc)
    
public static  intgetLocalVariableOffset(int methodModifier)
     Returns 0 if the method is static.
public static  booleanisAutolockName(String lockName)
    
public static  booleanisParent(String fieldName)
     Check whether the field name indicates that this is an inner classes synthetic field referring to the parent "this" reference.
public static  booleanisPrimitive(Type t)
    
public static  booleanisSynthetic(String fieldName)
    
public static  booleanisSynthetic(int access)
    
public static  booleanisTCSynthetic(String fieldName)
    
public static  StringmethodDescriptionToMethodArgument(String desc)
    
public static  StringmethodDescriptionToReturnType(String desc)
    
public static  longobjectIdFromLockName(String lockName)
    
public static  voidprepareStackForMethodCall(int callingMethodModifier, String desc, MethodVisitor c)
    
public static  voidpushDefaultValue(int variable, MethodVisitor c, Type type)
    
public static  voidpushInstanceVariable(MethodVisitor c, String className, String fieldName, String description)
     Add instruction to retrieve specified field in the object on the stack and replace with the field value.
public static  voidpushMethodArguments(int callingMethodModifier, String desc, MethodVisitor c)
    
public static  voidpushThis(MethodVisitor c)
    
public static  StringsortToPrimitiveMethodName(int sort)
     Convert from com.tc.asm.Type.getSort to a primitive method name like "booleanValue".
public static  StringsortToWrapperName(int sort)
    
public static  StringstripGeneratedLockHeader(String lockName)
    
public static  voidsystemOutPrintln(MethodVisitor mv, String msg)
    

Field Detail
DMI_METHOD_RENAME_PREFIX
final public static String DMI_METHOD_RENAME_PREFIX(Code)



MANAGEABLE_CLASS
final public static String MANAGEABLE_CLASS(Code)



MANAGEABLE_TYPE
final public static String MANAGEABLE_TYPE(Code)



MANAGED_VALUES_GETTER
final public static String MANAGED_VALUES_GETTER(Code)



MANAGED_VALUES_GETTER_DESCRIPTION
final public static String MANAGED_VALUES_GETTER_DESCRIPTION(Code)



MANAGED_VALUES_SETTER
final public static String MANAGED_VALUES_SETTER(Code)



METHOD_RENAME_PREFIX
final public static String METHOD_RENAME_PREFIX(Code)



NAMEDCLASSLOADER_CLASS
final public static String NAMEDCLASSLOADER_CLASS(Code)



NAMEDCLASSLOADER_TYPE
final public static String NAMEDCLASSLOADER_TYPE(Code)



SYNC_METHOD_RENAME_PREFIX
final public static String SYNC_METHOD_RENAME_PREFIX(Code)



TC_FIELD_PREFIX
final public static String TC_FIELD_PREFIX(Code)



TC_METHOD_PREFIX
final public static String TC_METHOD_PREFIX(Code)



TRANSPARENT_ACCESS_CLASS
final public static String TRANSPARENT_ACCESS_CLASS(Code)



TRANSPARENT_ACCESS_TYPE
final public static String TRANSPARENT_ACCESS_TYPE(Code)



VALUES_GETTER
final public static String VALUES_GETTER(Code)



VALUES_GETTER_DESCRIPTION
final public static String VALUES_GETTER_DESCRIPTION(Code)



VALUES_SETTER
final public static String VALUES_SETTER(Code)



VALUES_SETTER_DESCRIPTION
final public static String VALUES_SETTER_DESCRIPTION(Code)



WEBAPPCONFIG_CLASS
final public static String WEBAPPCONFIG_CLASS(Code)



WEBAPPCONFIG_TYPE
final public static String WEBAPPCONFIG_TYPE(Code)





Method Detail
addInterfaces
public static String[] addInterfaces(String[] existing, String[] toAdd)(Code)
Given a set of existing interfaces, add some more (without duplicates)
Parameters:
  existing - The existing interfaces
Parameters:
  toAdd - The interfaces to add A set of interfaces containing all of existing and toAdd with no dups



addTypeSpecificParameterLoad
public static void addTypeSpecificParameterLoad(MethodVisitor c, Type type, int offset)(Code)
Add instructions to load type-specific value from local variable onto stack. Primitve values are wrapped into their wrapper object.
Parameters:
  c - Method visitor
Parameters:
  type - The type of the variable
Parameters:
  offset - The local variable offset



classNameToFileName
final public static String classNameToFileName(String className)(Code)
Translate class name to file name
Parameters:
  className - The class name "java.lang.String" The file name on the classpath: "java/lang/String.class"



codeToName
public static String codeToName(String typeCode)(Code)
Translate type code to type name
Parameters:
  typeCode - Code from bytecode like B, C, etc Primitive type name: "byte", "char", etc



createParametersToArrayByteCode
public static void createParametersToArrayByteCode(MethodVisitor c, Type[] parameters)(Code)
Add instructions to convert the local variables typed with parameters into an array assuming values start at local variable offset of 1
Parameters:
  c - Method visitor
Parameters:
  parameters - Paramater to convert



createParametersToArrayByteCode
public static void createParametersToArrayByteCode(MethodVisitor c, Type[] parameters, int offset)(Code)
Add instructions to convert the parameters into an array
Parameters:
  c - Method visitor
Parameters:
  parameters - Paramater types to convert
Parameters:
  offset - Offset into local variables for values



fieldGetterMethod
public static String fieldGetterMethod(String fieldName)(Code)
Get name of synthetic field getter method added by Terracotta
Parameters:
  fieldName - The field name Getter method name



fieldSetterMethod
public static String fieldSetterMethod(String fieldName)(Code)
Get name of synthetic field setter method added by Terracotta
Parameters:
  fieldName - The field name Setter method name



generateAutolockName
public static String generateAutolockName(ObjectID id)(Code)
Get auto lock name for object identifier
Parameters:
  id - Identifier Auto lock name



generateLiteralLockName
public static String generateLiteralLockName(int literalValuesValueFor, Object obj)(Code)
The first argument should be "(new LiteralValues()).valueFor(obj)", but I didn't want to slurp in a whole mess of classes into the boot jar by including LiteralValues. It's gross, but ManagerImpl just makes the call itself.
Parameters:
  literalValuesValueFor - Literal value code
Parameters:
  obj - The lock object



generateNamedLockName
public static String generateNamedLockName(Object obj)(Code)
Get named lock name for the lock object
Parameters:
  obj - Lock object Named lock name



generateVolatileLockName
public static String generateVolatileLockName(ObjectID id, String fieldName)(Code)
Get volatile lock name
Parameters:
  id - Object identifier
Parameters:
  field - Volatile field Lock name



getBytesForClass
final public static byte[] getBytesForClass(String className, ClassLoader loader) throws ClassNotFoundException(Code)
Read the bytes defining the class
Parameters:
  className - The class
Parameters:
  loader - The classloader The underlying bytes



getBytesForInputstream
final public static byte[] getBytesForInputstream(InputStream is) throws IOException(Code)
Read input stream into a byte array using a 4k buffer. Close stream when done.
Parameters:
  is - Input stream Bytes read from stream
throws:
  IOException - If there is an error reading the stream



getFirstLocalVariableOffset
public static int getFirstLocalVariableOffset(int callingMethodModifier, String desc)(Code)
Get offset of first local variable after method args
Parameters:
  callingMethodModifier - Calling method modifier
Parameters:
  desc - Method descriptor First local variable offset



getLocalVariableOffset
public static int getLocalVariableOffset(int methodModifier)(Code)
Returns 0 if the method is static. 1 If the method is not.
Parameters:
  methodModifier - 0 if static, 1 if not



isAutolockName
public static boolean isAutolockName(String lockName)(Code)
Determine whether a lock is an autolock based on its name
Parameters:
  lockName - The lock name True if an autolock



isParent
public static boolean isParent(String fieldName)(Code)
Check whether the field name indicates that this is an inner classes synthetic field referring to the parent "this" reference.
Parameters:
  fieldName - The field name True if this field refers to the parent this



isPrimitive
public static boolean isPrimitive(Type t)(Code)
Check whether the type is a primitve
Parameters:
  t - The ASM type True if primitive



isSynthetic
public static boolean isSynthetic(String fieldName)(Code)
Determine whether a field is synthetic
Parameters:
  fieldName - The field name True if synthetic



isSynthetic
public static boolean isSynthetic(int access)(Code)
Determine whether an access modifier code indicates synthetic
Parameters:
  access - Access modifier code True if synthetic flag is set



isTCSynthetic
public static boolean isTCSynthetic(String fieldName)(Code)
Determine whether a field is synthetic and was added by Terracotta
Parameters:
  fieldName - The field name True if synthetic and added by Terracotta



methodDescriptionToMethodArgument
public static String methodDescriptionToMethodArgument(String desc)(Code)
Turn method description with byte code types into a readable signature
Parameters:
  desc - The bytecode description The method argument form



methodDescriptionToReturnType
public static String methodDescriptionToReturnType(String desc)(Code)
Get return type (class name) from method descriptor
Parameters:
  desc - Method descriptor Return type class name



objectIdFromLockName
public static long objectIdFromLockName(String lockName)(Code)
Get lock ID from autolock name
Parameters:
  lockName - The lock name Lock ID
throws:
  IllegalArgumentException - If not an autolock



prepareStackForMethodCall
public static void prepareStackForMethodCall(int callingMethodModifier, String desc, MethodVisitor c)(Code)
Push this (if not static) and all method args onto stack
Parameters:
  callingMethodModifier - Calling method modifier
Parameters:
  desc - Method descriptor
Parameters:
  c - Calling method visitor



pushDefaultValue
public static void pushDefaultValue(int variable, MethodVisitor c, Type type)(Code)
Assign the default value to the variable
Parameters:
  variable - The local variable to which the default value will be assigned
Parameters:
  c - MethodVisitor
Parameters:
  type - Type of the variable



pushInstanceVariable
public static void pushInstanceVariable(MethodVisitor c, String className, String fieldName, String description)(Code)
Add instruction to retrieve specified field in the object on the stack and replace with the field value.
Parameters:
  c - Current method visitor
Parameters:
  className - The field class
Parameters:
  fieldName - The field name
Parameters:
  description - The field type



pushMethodArguments
public static void pushMethodArguments(int callingMethodModifier, String desc, MethodVisitor c)(Code)
Add instructions to load method args into the stack
Parameters:
  callingMethodModifier - Calling method modifier
Parameters:
  desc - Method descriptor
Parameters:
  c - Current method visitor



pushThis
public static void pushThis(MethodVisitor c)(Code)
Add instruction to retrieve "this" from the local vars and load onto the stack
Parameters:
  c - The current method visitor



sortToPrimitiveMethodName
public static String sortToPrimitiveMethodName(int sort)(Code)
Convert from com.tc.asm.Type.getSort to a primitive method name like "booleanValue".
Parameters:
  Type - kind Primitive method name



sortToWrapperName
public static String sortToWrapperName(int sort)(Code)
Map from primite type to wrapper class type
Parameters:
  sort - Kind of primitve type as in com.tc.asm.Type.getSort Wrapper class name, like "java/lang/Boolean"



stripGeneratedLockHeader
public static String stripGeneratedLockHeader(String lockName)(Code)
Strip generated lock header from lock name
Parameters:
  lockName - Lock name Real lock name



systemOutPrintln
public static void systemOutPrintln(MethodVisitor mv, String msg)(Code)
Add instructions to print msg to System.out
Parameters:
  mv - Method visitor
Parameters:
  msg - Message to print



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.