01: /**
02: * $Id:
03: * Copyright 2005 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.admin.console.util;
14:
15: import javax.management.MBeanServerConnection;
16:
17: /**
18: * A singleton class that returns objects that act as
19: * a wrapper to a MBeanServerConnection object returned
20: * from a JMX connector. There is one wrapper object
21: * for each authenticated user session. The wrapper object
22: * is used as a centralize way to capture interested
23: * exceptions thrown from MBean operations. Normally,
24: * the catch exceptions will terminate the current session
25: * and force a re-authentication.
26: */
27: public final class MBeanServerConnectionWrapperFactory {
28:
29: private MBeanServerConnectionWrapperFactory() {
30: }
31:
32: /**
33: * Create and return a new MBeanServerConnection wrapper
34: * object that forwards all requests from the MBeanServerConnection
35: * interface to <code>mbsc</code>. The returned wrapper performs
36: * additional checkings to all methods defined in the
37: * MBeanServerConnection interface so that under some exceptional
38: * conditions, such as SSO Toekn experation, the wrapper object
39: * will terminate the current user session and force a re-authentication.
40: * @param mbsc the wrapped MBeanServerConnection to forward to.
41: */
42: public static MBeanServerConnection getInstance(
43: MBeanServerConnection mbsc) {
44: return new PSConsoleMBeanServerConnectionWrapper(mbsc);
45: }
46: }
|