FileDocCategorySizeDatePackage
CompositeInvocationHandlerImpl.javaAPI DocJava SE 5 API1556Fri Aug 26 14:54:40 BST 2005com.sun.corba.se.spi.orbutil.proxy

CompositeInvocationHandlerImpl

public class CompositeInvocationHandlerImpl extends Object implements CompositeInvocationHandler

Fields Summary
private Map
classToInvocationHandler
private InvocationHandler
defaultHandler
Constructors Summary
Methods Summary
public voidaddInvocationHandler(java.lang.Class interf, java.lang.reflect.InvocationHandler handler)


         
	   
    
	classToInvocationHandler.put( interf, handler ) ;
    
public java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)

	// Note that the declaring class in method is the interface
	// in which the method was defined, not the proxy class.
	Class cls = method.getDeclaringClass() ;
	InvocationHandler handler = 
	    (InvocationHandler)classToInvocationHandler.get( cls ) ;

	if (handler == null) {
	    if (defaultHandler != null)
		handler = defaultHandler ;
	    else {
		ORBUtilSystemException wrapper = ORBUtilSystemException.get( 
		    CORBALogDomains.UTIL ) ;
		throw wrapper.noInvocationHandler( "\"" + method.toString() + 
		    "\"" ) ;
	    }
	}

	// handler should never be null here.

	return handler.invoke( proxy, method, args ) ;
    
public voidsetDefaultHandler(java.lang.reflect.InvocationHandler handler)

	defaultHandler = handler ;