Java Doc for MBeanClientInterceptor.java in  » J2EE » spring-framework-2.0.6 » 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.0.6 » 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,InitializingBean,DisposableBean(Code)
MethodInterceptor implementation 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()
     Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.
public  voiddestroy()
     Closes any JMXConnector that may be managed by this interceptor.
public  Objectinvoke(MethodInvocation invocation)
     Route the invocation to the configured managed resource.
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  voidsetAgentId(String agentId)
     Set the agent id of the MBeanServer to locate.

Default is none.

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  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() throws MBeanServerNotFoundException, MBeanInfoRetrievalException(Code)
Ensures that an MBeanServerConnection is configured and attempts to detect a local connection if one is not supplied.



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



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



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)




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)




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".



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.