FileDocCategorySizeDatePackage
DelegateToMBeanDelegate.javaAPI DocGlassfish v2 API5737Fri May 04 22:23:42 BST 2007com.sun.enterprise.management.support

DelegateToMBeanDelegate

public class DelegateToMBeanDelegate extends DelegateBase
Delegate which delegates to another MBean.

Fields Summary
private final ObjectName
mTarget
private final MBeanServerConnection
mConn
private final MBeanInfo
mTargetMBeanInfo
private static final String[]
SINGLE_STRING_SIG
Constructors Summary
public DelegateToMBeanDelegate(MBeanServerConnection conn, ObjectName target)

		super( "DelegateToMBeanDelegate." + target.toString(), null );
		
		mConn	= conn;
		mTarget	= target;
		
		mTargetMBeanInfo	= mConn.getMBeanInfo( target );
	
public DelegateToMBeanDelegate(MBeanServer server, ObjectName target)

		super( "DelegateToMBeanDelegate." + target.toString(), null);
		
		mConn	= server;
		mTarget	= target;
		
		mTargetMBeanInfo	= server.getMBeanInfo( target );
		
		//trace( "\nMBeanInfo for: " + target + ":\n" +
			//MBeanInfoStringifier.DEFAULT.stringify( mTargetMBeanInfo ) );
	
Methods Summary
protected final java.lang.String_getDefaultValue(java.lang.String name)

    
    
          
        
         
    
        return (String)invoke( "getDefaultAttributeValue", new String[] { name }, SINGLE_STRING_SIG );
    
private voiddelegateFailed(java.lang.Throwable t)

		if ( getOwner() != null )
		{
			getOwner().delegateFailed( t );
		}
	
public final java.lang.ObjectgetAttribute(java.lang.String attrName)

		try
		{
			final Object value	=
				getMBeanServerConnection().getAttribute( mTarget, attrName );
			return( value );
		}
		catch( Exception e )
		{
			e.printStackTrace();
			throw new RuntimeException( e );
		}
	
public javax.management.MBeanInfogetMBeanInfo()

		return( mTargetMBeanInfo );
	
public final javax.management.MBeanServerConnectiongetMBeanServerConnection()

		return( mConn );
	
public final javax.management.ObjectNamegetTarget()

		return( mTarget );
	
public final java.lang.Objectinvoke(java.lang.String operationName, java.lang.Object[] args, java.lang.String[] types)

		try
		{
			final Object	result	= getMBeanServerConnection().invoke( getTarget(),
										operationName, args, types );
			
			return( result );
		}
		catch ( InstanceNotFoundException e )
		{
			delegateFailed( e );
			throw new RuntimeException( e );
		}
		catch ( IOException e )
		{
			try
			{
				getMBeanServerConnection().isRegistered( getTarget() );
			}
			catch( IOException ee )
			{
				delegateFailed( e );
			}
			throw new RuntimeException( e );
		}
		catch( Exception e )
		{
			throw new RuntimeException( e );
		}
	
public voidsetAttribute(javax.management.Attribute attr)

		try
		{
			getMBeanServerConnection().setAttribute( mTarget, attr );
		}
		catch( Exception e )
		{
			throw new RuntimeException( e );
		}