Java Doc for AbstractIndirectionHandler.java in  » Database-ORM » db-ojb » org » apache » ojb » broker » core » proxy » 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 » Database ORM » db ojb » org.apache.ojb.broker.core.proxy 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.ojb.broker.core.proxy.AbstractIndirectionHandler

All known Subclasses:   org.apache.ojb.broker.core.proxy.IndirectionHandlerCGLIBImpl,  org.apache.ojb.broker.core.proxy.IndirectionHandlerJDKImpl,
AbstractIndirectionHandler
abstract public class AbstractIndirectionHandler implements IndirectionHandler(Code)
Abstract implementation for the indirection handler used by ojb's proxies.
version:
   $Id$

Inner Class :final static class TemporaryBrokerWrapper

Field Summary
final static  longserialVersionUID
    

Constructor Summary
public  AbstractIndirectionHandler(PBKey brokerKey, Identity id)
     Creates a new indirection handler for the indicated object.

Method Summary
public synchronized  voidaddListener(MaterializationListener listener)
     Adds a materialization listener.
protected  voidafterMaterialization()
     Calls afterMaterialization on all registered listeners in the reverse order of registration.
public  booleanalreadyMaterialized()
     Determines whether the real subject already has been materialized.
protected  voidbeforeMaterialization()
     Calls beforeMaterialization on all registered listeners in the reverse order of registration.
protected  TemporaryBrokerWrappergetBroker()
     Gets the persistence broker used by this indirection handler.
public  PBKeygetBrokerKey()
     Returns the key of the persistence broker used by this indirection handler.
public  IdentitygetIdentity()
     Returns the identity of the subject.
public  ObjectgetRealSubject()
     Returns the proxies real subject.
public  Objectinvoke(Object proxy, Method method, Object[] args)
     [Copied from java.lang.reflect.InvocationHandler ]:
Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
Parameters:
  proxy - The proxy instance that the method was invoked on
Parameters:
  method - The Method instance corresponding to theinterface method invoked on the proxy instance.
protected synchronized  ObjectmaterializeSubject()
     Retrieves the real subject from the underlying RDBMS.
public synchronized  voidremoveListener(MaterializationListener listener)
     Removes a materialization listener.
protected  voidsetBrokerKey(PBKey brokerKey)
     Sets the key of the persistence broker used by this indirection handler.
protected  voidsetIdentity(Identity identity)
     Sets the identity of the subject of this indirection handler.
public  voidsetRealSubject(Object object)
     [olegnitz] This looks stupid, but is really necessary for OTM: the materialization listener replaces the real subject by its clone to ensure transaction isolation.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)




Constructor Detail
AbstractIndirectionHandler
public AbstractIndirectionHandler(PBKey brokerKey, Identity id)(Code)
Creates a new indirection handler for the indicated object.
Parameters:
  brokerKey - The key of the persistence broker
Parameters:
  id - The identity of the subject




Method Detail
addListener
public synchronized void addListener(MaterializationListener listener)(Code)
Adds a materialization listener.
Parameters:
  listener - The listener to add



afterMaterialization
protected void afterMaterialization()(Code)
Calls afterMaterialization on all registered listeners in the reverse order of registration.



alreadyMaterialized
public boolean alreadyMaterialized()(Code)
Determines whether the real subject already has been materialized. true if the real subject has already been loaded



beforeMaterialization
protected void beforeMaterialization()(Code)
Calls beforeMaterialization on all registered listeners in the reverse order of registration.



getBroker
protected TemporaryBrokerWrapper getBroker() throws PBFactoryException(Code)
Gets the persistence broker used by this indirection handler. If no PBKey is available a runtime exception will be thrown. a PersistenceBroker



getBrokerKey
public PBKey getBrokerKey()(Code)
Returns the key of the persistence broker used by this indirection handler. The broker key



getIdentity
public Identity getIdentity()(Code)
Returns the identity of the subject. The identity



getRealSubject
public Object getRealSubject() throws PersistenceBrokerException(Code)
Returns the proxies real subject. The subject will be materialized if necessary. The subject



invoke
public Object invoke(Object proxy, Method method, Object[] args)(Code)
[Copied from java.lang.reflect.InvocationHandler ]:
Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
Parameters:
  proxy - The proxy instance that the method was invoked on
Parameters:
  method - The Method instance corresponding to theinterface method invoked on the proxy instance. The declaringclass of the Method object will be theinterface that the method was declared in, which may be asuperinterface of the proxy interface that the proxy classinherits the method through.
Parameters:
  args - An array of objects containing the values of the argumentspassed in the method invocation on the proxy instance, ornull if interface method takes no arguments.Arguments of primitive types are wrapped in instances of theappropriate primitive wrapper class, such asjava.lang.Integer orjava.lang.Boolean. The value to return from the method invocation on the proxyinstance. If the declared return type of the interface method isa primitive type, then the value returned by this method must bean instance of the corresponding primitive wrapper class;otherwise, it must be a type assignable to the declared returntype. If the value returned by this method is nulland the interface method's return type is primitive, then aNullPointerException will be thrown by the methodinvocation on the proxy instance. If the value returned by thismethod is otherwise not compatible with the interface method'sdeclared return type as described above, aClassCastException will be thrown by the methodinvocation on the proxy instance.
throws:
  PersistenceBrokerException - The exception to throw from the method invocation on theproxy instance. The exception's type must be assignableeither to any of the exception types declared in thethrows clause of the interface method or tothe unchecked exception typesjava.lang.RuntimeException orjava.lang.Error. If a checked exception isthrown by this method that is not assignable to any of theexception types declared in the throws clauseof the interface method, then anjava.lang.reflect.UndeclaredThrowableExceptioncontaining the exception that was thrown by this method willbe thrown by the method invocation on the proxy instance.
See Also:   java.lang.reflect.UndeclaredThrowableException



materializeSubject
protected synchronized Object materializeSubject() throws PersistenceBrokerException(Code)
Retrieves the real subject from the underlying RDBMS. Override this method if the object is to be materialized in a specific way. The real subject of the proxy



removeListener
public synchronized void removeListener(MaterializationListener listener)(Code)
Removes a materialization listener.
Parameters:
  listener - The listener to remove



setBrokerKey
protected void setBrokerKey(PBKey brokerKey)(Code)
Sets the key of the persistence broker used by this indirection handler.
Parameters:
  brokerKey - The broker key



setIdentity
protected void setIdentity(Identity identity)(Code)
Sets the identity of the subject of this indirection handler.
Parameters:
  identity -



setRealSubject
public void setRealSubject(Object object)(Code)
[olegnitz] This looks stupid, but is really necessary for OTM: the materialization listener replaces the real subject by its clone to ensure transaction isolation. Is there a better way to do this?



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.