Java Doc for ProxyMetaClass.java in  » Scripting » groovy-1.0 » groovy » lang » 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 » Scripting » groovy 1.0 » groovy.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   groovy.lang.MetaClass
      groovy.lang.MetaClassImpl
         groovy.lang.ProxyMetaClass

All known Subclasses:   groovy.mock.interceptor.MockProxyMetaClass,
ProxyMetaClass
public class ProxyMetaClass extends MetaClassImpl (Code)
As subclass of MetaClass, ProxyMetaClass manages calls from Groovy Objects to POJOs. It enriches MetaClass with the feature of making method invokations interceptable by an Interceptor. To this end, it acts as a decorator (decorator pattern) allowing to add or withdraw this feature at runtime. See groovy/lang/InterceptorTest.groovy for details.
author:
   Dierk Koenig


Field Summary
protected  MetaClassadaptee
    
protected  Interceptorinterceptor
    

Constructor Summary
public  ProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee)
    

Method Summary
public static  ProxyMetaClassgetInstance(Class theClass)
     convenience factory method for the most usual case.
public  InterceptorgetInterceptor()
    
public synchronized  voidinitialize()
    
public  ObjectinvokeConstructor(Object[] arguments)
     Call invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor.
public  ObjectinvokeMethod(Object object, String methodName, Object[] arguments)
     Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
public  ObjectinvokeStaticMethod(Object object, String methodName, Object[] arguments)
     Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor.
public  voidsetInterceptor(Interceptor interceptor)
    
public  voiduse(Closure closure)
     Use the ProxyMetaClass for the given Closure.
public  voiduse(GroovyObject object, Closure closure)
     Use the ProxyMetaClass for the given Closure.

Field Detail
adaptee
protected MetaClass adaptee(Code)



interceptor
protected Interceptor interceptor(Code)




Constructor Detail
ProxyMetaClass
public ProxyMetaClass(MetaClassRegistry registry, Class theClass, MetaClass adaptee) throws IntrospectionException(Code)

Parameters:
  adaptee - the MetaClass to decorate with interceptability




Method Detail
getInstance
public static ProxyMetaClass getInstance(Class theClass) throws IntrospectionException(Code)
convenience factory method for the most usual case.



getInterceptor
public Interceptor getInterceptor()(Code)
the interceptor in use or null if no interceptor is used



initialize
public synchronized void initialize()(Code)



invokeConstructor
public Object invokeConstructor(Object[] arguments)(Code)
Call invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.



invokeMethod
public Object invokeMethod(Object object, String methodName, Object[] arguments)(Code)
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.



invokeStaticMethod
public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)(Code)
Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.



setInterceptor
public void setInterceptor(Interceptor interceptor)(Code)

Parameters:
  interceptor - may be null to reset any interception



use
public void use(Closure closure)(Code)
Use the ProxyMetaClass for the given Closure. Cares for balanced register/unregister.
Parameters:
  closure - piece of code to be executed with registered ProxyMetaClass



use
public void use(GroovyObject object, Closure closure)(Code)
Use the ProxyMetaClass for the given Closure. Cares for balanced setting/unsetting ProxyMetaClass.
Parameters:
  closure - piece of code to be executed with ProxyMetaClass



Fields inherited from groovy.lang.MetaClassImpl
protected MetaClassRegistry registry(Code)(Java Doc)

Methods inherited from groovy.lang.MetaClassImpl
protected void addMetaMethod(MetaMethod method)(Code)(Java Doc)
public void addNewInstanceMethod(Method method)(Code)(Java Doc)
public void addNewStaticMethod(Method method)(Code)(Java Doc)
protected void cacheInstanceMethod(MethodKey key, MetaMethod method)(Code)(Java Doc)
protected void cacheStaticMethod(MethodKey key, MetaMethod method)(Code)(Java Doc)
protected void checkInitalised()(Code)(Java Doc)
protected void clearInvocationCaches()(Code)(Java Doc)
public Object getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
public Object getAttribute(Object object, String attribute)(Code)(Java Doc)
public ClassNode getClassNode()(Code)(Java Doc)
public List getMetaMethods()(Code)(Java Doc)
public MetaMethod getMethodWithCaching(Class sender, String methodName, Class[] arguments, boolean isCallToSuper)(Code)(Java Doc)
public MetaMethod getMethodWithoutCaching(Class sender, String methodName, Class[] arguments, boolean isCallToSuper)(Code)(Java Doc)
public List getMethods()(Code)(Java Doc)
public List getProperties()(Code)(Java Doc)
public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
public Object getProperty(Object object, String property)(Code)(Java Doc)
public synchronized void initialize()(Code)(Java Doc)
public Object invokeConstructor(Object[] arguments)(Code)(Java Doc)
public Object invokeMethod(Object object, String methodName, Object[] originalArguments)(Code)(Java Doc)
public Object invokeMethod(Class sender, Object object, String methodName, Object[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)(Code)(Java Doc)
public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)(Code)(Java Doc)
protected boolean isInitialized()(Code)(Java Doc)
public MetaMethod pickMethod(String methodName, Class[] arguments)(Code)(Java Doc)
public Constructor retrieveConstructor(Class[] arguments)(Code)(Java Doc)
protected MetaMethod retrieveMethod(String methodName, Class[] arguments)(Code)(Java Doc)
public MetaMethod retrieveStaticMethod(String methodName, Class[] arguments)(Code)(Java Doc)
public int selectConstructorAndTransformArguments(int numberOfCosntructors, Object[] arguments)(Code)(Java Doc)
public void setAttribute(Class sender, Object object, String attribute, Object newValue, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
public void setAttribute(Object object, String attribute, Object newValue)(Code)(Java Doc)
public void setProperties(Object bean, Map map)(Code)(Java Doc)
public void setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
public void setProperty(Object object, String property, Object newValue)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Fields inherited from groovy.lang.MetaClass
final public static Object NO_METHOD_FOUND(Code)(Java Doc)
final protected static Logger log(Code)(Java Doc)
final protected Class theClass(Code)(Java Doc)
protected static boolean useReflection(Code)(Java Doc)

Methods inherited from groovy.lang.MetaClass
abstract public void addNewInstanceMethod(Method method)(Code)(Java Doc)
abstract public void addNewStaticMethod(Method method)(Code)(Java Doc)
public Object getAttribute(Class sender, Object receiver, String messageName, boolean useSuper)(Code)(Java Doc)
abstract public Object getAttribute(Object object, String attribute)(Code)(Java Doc)
abstract public ClassNode getClassNode()(Code)(Java Doc)
abstract public List getMetaMethods()(Code)(Java Doc)
abstract public List getMethods()(Code)(Java Doc)
abstract public List getProperties()(Code)(Java Doc)
public Object getProperty(Class sender, Object receiver, String messageName, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
abstract public Object getProperty(Object object, String property)(Code)(Java Doc)
abstract public void initialize()(Code)(Java Doc)
abstract public Object invokeConstructor(Object[] arguments)(Code)(Java Doc)
public Object invokeConstructorAt(Class at, Object[] arguments)(Code)(Java Doc)
public Object invokeMethod(Object object, String methodName, Object arguments)(Code)(Java Doc)
public Object invokeMethod(Class sender, Object receiver, String methodName, Object[] arguments, boolean isCallToSuper, boolean fromInsideClass)(Code)(Java Doc)
abstract public Object invokeMethod(Object object, String methodName, Object[] arguments)(Code)(Java Doc)
public Object invokeMissingMethod(Object instance, String methodName, Object[] arguments)(Code)(Java Doc)
abstract public Object invokeStaticMethod(Object object, String methodName, Object[] arguments)(Code)(Java Doc)
public boolean isGroovyObject()(Code)(Java Doc)
public static boolean isUseReflection()(Code)(Java Doc)
abstract public MetaMethod pickMethod(String methodName, Class[] arguments)(Code)(Java Doc)
protected MetaMethod retrieveMethod(String methodName, Class[] arguments)(Code)(Java Doc)
public void setAttribute(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
abstract public void setAttribute(Object object, String attribute, Object newValue)(Code)(Java Doc)
public void setProperty(Class sender, Object receiver, String messageName, Object messageValue, boolean useSuper, boolean fromInsideClass)(Code)(Java Doc)
abstract public void setProperty(Object object, String property, Object newValue)(Code)(Java Doc)
public static void setUseReflection(boolean useReflection)(Code)(Java Doc)

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.