KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > support > DummyDelegate


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28  
29 /*
30  */

31
32 package com.sun.enterprise.management.support;
33
34 import java.io.IOException JavaDoc;
35
36 import javax.management.ObjectName JavaDoc;
37 import javax.management.MBeanServer JavaDoc;
38 import javax.management.MBeanServerConnection JavaDoc;
39 import javax.management.MBeanInfo JavaDoc;
40 import javax.management.MBeanAttributeInfo JavaDoc;
41 import javax.management.AttributeList JavaDoc;
42 import javax.management.Attribute JavaDoc;
43 import javax.management.AttributeNotFoundException JavaDoc;
44 import javax.management.InvalidAttributeValueException JavaDoc;
45 import javax.management.InstanceNotFoundException JavaDoc;
46 import javax.management.IntrospectionException JavaDoc;
47 import javax.management.ReflectionException JavaDoc;
48
49 /**
50     Delegate which delegates to another MBean.
51     This is a dummy delegate which is used when the
52     remote server instance is yet to be started.
53         
54  */

55 public class DummyDelegate extends DelegateBase
56 {
57
58         private
59     DummyDelegate()
60     {
61         super( DummyDelegate.class.getName(), null);
62     }
63     
64         public synchronized DummyDelegate
65     getInstance()
66     {
67         if ( INSTANCE == null )
68         {
69             INSTANCE = new DummyDelegate();
70         }
71         return( INSTANCE );
72     }
73
74     static public DummyDelegate INSTANCE = null;
75     
76         public Object JavaDoc
77     getAttribute( final String JavaDoc attrName )
78         throws AttributeNotFoundException JavaDoc
79     {
80         return null;
81     }
82     
83         public void
84     setAttribute( final Attribute JavaDoc attr )
85         throws AttributeNotFoundException JavaDoc, InvalidAttributeValueException JavaDoc
86     {
87         throw new AttributeNotFoundException JavaDoc("no attributes defined for dummy delegate");
88     }
89     
90         public MBeanInfo JavaDoc
91     getMBeanInfo()
92     {
93         return null;
94     }
95
96
97     /**
98      */

99         public final Object JavaDoc
100     invoke(
101         String JavaDoc operationName,
102         Object JavaDoc[] args,
103         String JavaDoc[] types )
104     {
105         return null;
106     }
107 }
108
Popular Tags