Java Doc for MBeanClientInterceptor.java in  » J2EE » spring-framework-2.5 » org » springframework » jmx » access » 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 » J2EE » spring framework 2.5 » org.springframework.jmx.access 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.jmx.access.MBeanClientInterceptor

All known Subclasses:   org.springframework.jmx.access.MBeanProxyFactoryBean,
MBeanClientInterceptor
public class MBeanClientInterceptor implements MethodInterceptor,BeanClassLoaderAware,InitializingBean,DisposableBean(Code)
org.aopalliance.intercept.MethodInterceptor that routes calls to an MBean running on the supplied MBeanServerConnection. Works for both local and remote MBeanServerConnections.

By default, the MBeanClientInterceptor will connect to the MBeanServer and cache MBean metadata at startup. This can be undesirable when running against a remote MBeanServer that may not be running when the application starts. Through setting the MBeanClientInterceptor.setConnectOnStartup(boolean) connectOnStartup property to "false", you can defer this process until the first invocation against the proxy.

Requires JMX 1.2's MBeanServerConnection feature. As a consequence, this class will not work on JMX 1.0.

This functionality is usually used through MBeanProxyFactoryBean . See the javadoc of that class for more information.
author:
   Rob Harrop
author:
   Juergen Hoeller
since:
   1.2
See Also:   MBeanProxyFactoryBean
See Also:   MBeanClientInterceptor.setConnectOnStartup



Field Summary
final protected  Loglogger
    


Method Summary
public  voidafterPropertiesSet()
     Prepares the MBeanServerConnection if the "connectOnStartup" is turned on (which it is by default).
protected  ObjectconvertResultValueIfNecessary(Object result, Class targetClass)
     Convert the given result object (from attribute access or operation invocation) to the specified target class for returning from the proxy method.
public  voiddestroy()
     Closes any JMXConnector that may be managed by this interceptor.
final protected  ClassgetManagementInterface()
     Return the management interface of the target MBean, or null if none specified.
public  Objectinvoke(MethodInvocation invocation)
     Route the invocation to the configured managed resource.
protected  booleanisPrepared()
     Return whether this client interceptor has already been prepared, i.e.
protected  MBeanServerlocateMBeanServer(String agentId)
     Attempt to locate an existing MBeanServer. Called if no MBeanClientInterceptor.setServiceUrl "serviceUrl" was specified.

The default implementation attempts to find an MBeanServer using a standard lookup.

public  voidprepare()
     Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.
public  voidsetAgentId(String agentId)
     Set the agent id of the MBeanServer to locate.

Default is none.

public  voidsetBeanClassLoader(ClassLoader beanClassLoader)
    
public  voidsetConnectOnStartup(boolean connectOnStartup)
     Set whether or not the proxy should connect to the MBeanServer at creation time ("true") or the first time it is invoked ("false").
public  voidsetManagementInterface(Class managementInterface)
     Set the management interface of the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.
public  voidsetObjectName(Object objectName)
     Set the ObjectName of the MBean which calls are routed to, as ObjectName instance or as String.
public  voidsetServer(MBeanServerConnection server)
     Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.
public  voidsetServiceUrl(String url)
     Set the service URL of the remote MBeanServer.
public  voidsetUseStrictCasing(boolean useStrictCasing)
     Set whether to use strict casing for attributes.

Field Detail
logger
final protected Log logger(Code)
Logger available to subclasses





Method Detail
afterPropertiesSet
public void afterPropertiesSet()(Code)
Prepares the MBeanServerConnection if the "connectOnStartup" is turned on (which it is by default).



convertResultValueIfNecessary
protected Object convertResultValueIfNecessary(Object result, Class targetClass)(Code)
Convert the given result object (from attribute access or operation invocation) to the specified target class for returning from the proxy method.
Parameters:
  result - the result object as returned by the MBeanServer
Parameters:
  targetClass - the result type of the proxy method that's been invoked the converted result object, or the passed-in object if no conversionis necessary



destroy
public void destroy() throws Exception(Code)
Closes any JMXConnector that may be managed by this interceptor.



getManagementInterface
final protected Class getManagementInterface()(Code)
Return the management interface of the target MBean, or null if none specified.



invoke
public Object invoke(MethodInvocation invocation) throws Throwable(Code)
Route the invocation to the configured managed resource. Correctly routes JavaBean property access to MBeanServerConnection.get/setAttribute and method invocation to MBeanServerConnection.invoke. Any attempt to invoke a method that does not correspond to an attribute or operation defined in the management interface of the managed resource results in an InvalidInvocationException.
Parameters:
  invocation - the MethodInvocation to re-route. the value returned as a result of the re-routed invocation.
throws:
  InvocationFailureException - if the invocation does not match an attribute oroperation on the management interface of the resource.
throws:
  Throwable - typically as the result of an error during invocation



isPrepared
protected boolean isPrepared()(Code)
Return whether this client interceptor has already been prepared, i.e. has already looked up the server and cached all metadata.



locateMBeanServer
protected MBeanServer locateMBeanServer(String agentId) throws MBeanServerNotFoundException(Code)
Attempt to locate an existing MBeanServer. Called if no MBeanClientInterceptor.setServiceUrl "serviceUrl" was specified.

The default implementation attempts to find an MBeanServer using a standard lookup. Subclasses may override to add additional location logic.
Parameters:
  agentId - the agent identifier of the MBeanServer to retrieve.If this parameter is null, all registered MBeanServers areconsidered. the MBeanServer if found
throws:
  org.springframework.jmx.MBeanServerNotFoundException - if no MBeanServer could be found
See Also:   JmxUtils.locateMBeanServer(String)
See Also:   javax.management.MBeanServerFactory.findMBeanServer(String)




prepare
public void prepare()(Code)
Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.



setAgentId
public void setAgentId(String agentId)(Code)
Set the agent id of the MBeanServer to locate.

Default is none. If specified, this will result in an attempt being made to locate the attendant MBeanServer, unless the MBeanClientInterceptor.setServiceUrl "serviceUrl" property has been set.
See Also:   javax.management.MBeanServerFactory.findMBeanServer(String)




setBeanClassLoader
public void setBeanClassLoader(ClassLoader beanClassLoader)(Code)



setConnectOnStartup
public void setConnectOnStartup(boolean connectOnStartup)(Code)
Set whether or not the proxy should connect to the MBeanServer at creation time ("true") or the first time it is invoked ("false"). Default is "true".



setManagementInterface
public void setManagementInterface(Class managementInterface)(Code)
Set the management interface of the target MBean, exposing bean property setters and getters for MBean attributes and conventional Java methods for MBean operations.



setObjectName
public void setObjectName(Object objectName) throws MalformedObjectNameException(Code)
Set the ObjectName of the MBean which calls are routed to, as ObjectName instance or as String.



setServer
public void setServer(MBeanServerConnection server)(Code)
Set the MBeanServerConnection used to connect to the MBean which all invocations are routed to.



setServiceUrl
public void setServiceUrl(String url) throws MalformedURLException(Code)
Set the service URL of the remote MBeanServer.



setUseStrictCasing
public void setUseStrictCasing(boolean useStrictCasing)(Code)
Set whether to use strict casing for attributes. Enabled by default.

When using strict casing, a JavaBean property with a getter such as getFoo() translates to an attribute called Foo. With strict casing disabled, getFoo() would translate to just foo.




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.