Java Doc for InvocationContext.java in  » Testing » MockEJB » org » mockejb » interceptor » 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 » Testing » MockEJB » org.mockejb.interceptor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mockejb.interceptor.InvocationContext

InvocationContext
public class InvocationContext (Code)
Performs the invocation of interceptors in their order in the interceptor list. Each interceptor is called in turn until we get to the target object. At this point, the target object's method is called using reflection. Also keeps the invocation's custom context (properties). To be thread safe, clients should create a new object of this class for each method call.
author:
   Alexander Ananiev



Constructor Summary
public  InvocationContext(List interceptorList, Object proxyObj, Method proxyMethod, Object targetObj, Method targetMethod, Object[] paramVals)
     Creates a new instance of the InvocationContext.
Parameters:
  interceptorList - interceptors that will be invoked before the target method
Parameters:
  proxyObj - object that was intercepted, most likely it is the dynamic proxy object.
public  InvocationContext(List interceptorList, Object proxyObj, Method proxyMethod, Object targetObj, Method targetMethod, Object[] paramVals, Map contextProperties)
     Creates a new instance of the InvocationContext.
Parameters:
  interceptorList - interceptors that will be invoked before the target method
Parameters:
  proxyObj - object that was intercepted, most likely it is the dynamic proxy object.

Method Summary
public  voidclear()
     Clears the context properties and resets the interceptor iterator.
public  MethodgetInterceptedMethod()
    
public  ObjectgetInterceptedObject()
    
public  ListIteratorgetInterceptorIterator()
     Returns the iterator currently in use to traverse the interceptor list.
public  ListgetInterceptorList()
    
public  ObjectgetOptionalPropertyValue(String key)
    
public  Object[]getParamVals()
    
public  ObjectgetPropertyValue(String key)
    
public  MethodgetProxyMethod()
     Returns the proxy method, the method that was called on the proxy. For example, "find" method of the Entity business interface is the proxy method, and "ejbFind" method of the entity implementation class is the target method.
public  ObjectgetProxyObject()
     Returns the proxy object.
public  ObjectgetReturnObject()
     Returns the return value of the invocation.
public  MethodgetTargetMethod()
     Returns the target method of the invocation. This is the target method being called in response to the call to the proxy's method.
public  ObjectgetTargetObject()
     Returns the target object of the invocation. This is the target object being called in response to the call of the proxy (interface).
public  ObjectgetThrownThrowable()
     Returns the throwable thrown by the target method or by one of the interceptors.
protected  ObjectinvokeMethod(Object targetObj, Method method, Object[] paramVals)
     Calls the object's method using reflection. This method takes InvocationTargetException out of the stack in case of exception.
public  voidproceed()
     Calls the next interceptor in the list.
public  voidreset()
     Resets the interceptor iterator.
public  voidsetContext(String key, Object data)
     Adds the invocation context property.
public  voidsetInterceptorList(List interceptorList)
    
public  voidsetReturnObject(Object returnObject)
     Sets the return value of the invocation.
public  voidsetThrownThrowable(Throwable throwable)
    
public  StringtoString()
    


Constructor Detail
InvocationContext
public InvocationContext(List interceptorList, Object proxyObj, Method proxyMethod, Object targetObj, Method targetMethod, Object[] paramVals)(Code)
Creates a new instance of the InvocationContext.
Parameters:
  interceptorList - interceptors that will be invoked before the target method
Parameters:
  proxyObj - object that was intercepted, most likely it is the dynamic proxy object. Can be null.
Parameters:
  proxyMethod - method invoked on the proxy. The declaring class of the method is the interface's class.
Parameters:
  targetObj - target object being called.
Parameters:
  targetMethod - method being called.
Parameters:
  paramVals - parameter values



InvocationContext
public InvocationContext(List interceptorList, Object proxyObj, Method proxyMethod, Object targetObj, Method targetMethod, Object[] paramVals, Map contextProperties)(Code)
Creates a new instance of the InvocationContext.
Parameters:
  interceptorList - interceptors that will be invoked before the target method
Parameters:
  proxyObj - object that was intercepted, most likely it is the dynamic proxy object. Can be null if the object is not known.
Parameters:
  proxyMethod - method invoked on the proxy. The declaring class of the method is the interface's class.
Parameters:
  targetObj - target object being called.
Parameters:
  targetMethod - method being called.
Parameters:
  paramVals - parameter values
Parameters:
  contextProperties - any additional context info for the interceptors




Method Detail
clear
public void clear()(Code)
Clears the context properties and resets the interceptor iterator.



getInterceptedMethod
public Method getInterceptedMethod()(Code)



getInterceptedObject
public Object getInterceptedObject()(Code)
proxy object



getInterceptorIterator
public ListIterator getInterceptorIterator()(Code)
Returns the iterator currently in use to traverse the interceptor list. Clients can use the returned iterator to find out their place in the call chain. list iterator



getInterceptorList
public List getInterceptorList()(Code)



getOptionalPropertyValue
public Object getOptionalPropertyValue(String key)(Code)
Returns the context property value associated with the provided key or null if the key is not found
Parameters:
  key - contextProperties key contextProperties data



getParamVals
public Object[] getParamVals()(Code)



getPropertyValue
public Object getPropertyValue(String key)(Code)
Returns the custome context's property value associated with the provided key or throws IllegalStateException if the key is not found
Parameters:
  key - contextProperties key contextProperties data



getProxyMethod
public Method getProxyMethod()(Code)
Returns the proxy method, the method that was called on the proxy. For example, "find" method of the Entity business interface is the proxy method, and "ejbFind" method of the entity implementation class is the target method. proxy method



getProxyObject
public Object getProxyObject()(Code)
Returns the proxy object. This is a dynamic proxy object implementing an interface or a CGLIB-enhanced class intercepted object



getReturnObject
public Object getReturnObject()(Code)
Returns the return value of the invocation. Normally, this is a return value of the target method, however interceptors can change it. Object or null if the method has void type or if the method threw exception



getTargetMethod
public Method getTargetMethod()(Code)
Returns the target method of the invocation. This is the target method being called in response to the call to the proxy's method. For example, "find" method of the Entity business interface is the intercepted method, whereas "ejbFind" method of the entity implementation class is the target method. method



getTargetObject
public Object getTargetObject()(Code)
Returns the target object of the invocation. This is the target object being called in response to the call of the proxy (interface). target object



getThrownThrowable
public Object getThrownThrowable()(Code)
Returns the throwable thrown by the target method or by one of the interceptors. throwable or null if no exceptions were thrown during the invocation



invokeMethod
protected Object invokeMethod(Object targetObj, Method method, Object[] paramVals) throws Throwable(Code)
Calls the object's method using reflection. This method takes InvocationTargetException out of the stack in case of exception. This allows exception handlers not to deal with reflection-specific exceptions.
Parameters:
  targetObj - target object being called
Parameters:
  method - method being called
Parameters:
  paramVals - parameter values value returned by the given method



proceed
public void proceed() throws Exception(Code)
Calls the next interceptor in the list. If this is the end of the list, calls the given method of the target object using reflection if the target object is not null. "proceed" name is consistent with the "proceed" keyword used by AspectJ for "around" advices. Use "getReturnObject" to get the return value for this invocation.



reset
public void reset()(Code)
Resets the interceptor iterator.



setContext
public void setContext(String key, Object data)(Code)
Adds the invocation context property. Context property is a piece of data made available to all interceptors. Interceptors can add/modify the context properties during the call.
Parameters:
  key - key for this contextProperties's data
Parameters:
  data - contextProperties data



setInterceptorList
public void setInterceptorList(List interceptorList)(Code)
Sets the list of interceptors
Parameters:
  interceptorList - list to set



setReturnObject
public void setReturnObject(Object returnObject)(Code)
Sets the return value of the invocation. This allows interceptors to change the current return value.
Parameters:
  returnObject - return object to set



setThrownThrowable
public void setThrownThrowable(Throwable throwable)(Code)
Sets the throwable thrown by the invoked method
Parameters:
  throwable -



toString
public String toString()(Code)



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.