FileDocCategorySizeDatePackage
HandlerRef.javaAPI DocApache Tomcat 6.0.145110Fri Jul 20 04:20:34 BST 2007org.apache.naming

HandlerRef

public class HandlerRef extends Reference
Represents a reference handler for a web service.
author
Fabien Carrion

Fields Summary
public static final String
DEFAULT_FACTORY
Default factory for this reference.
public static final String
HANDLER_NAME
HandlerName address type.
public static final String
HANDLER_CLASS
Handler Classname address type.
public static final String
HANDLER_LOCALPART
Handler Classname address type.
public static final String
HANDLER_NAMESPACE
Handler Classname address type.
public static final String
HANDLER_PARAMNAME
Handler Classname address type.
public static final String
HANDLER_PARAMVALUE
Handler Classname address type.
public static final String
HANDLER_SOAPROLE
Handler SoapRole address type.
public static final String
HANDLER_PORTNAME
Handler PortName address type.
Constructors Summary
public HandlerRef(String refname, String handlerClass)
Service Reference.

param
serviceClass Service class



    // ----------------------------------------------------------- Constructors


                
         
        this(refname, handlerClass, null, null);
    
public HandlerRef(String refname, String handlerClass, String factory, String factoryLocation)
Service Reference.

param
serviceClass Service class

        super(refname, factory, factoryLocation);
        StringRefAddr refAddr = null;
        if (refname != null) {
            refAddr = new StringRefAddr(HANDLER_NAME, refname);
            add(refAddr);
        }
        if (handlerClass != null) {
            refAddr = new StringRefAddr(HANDLER_CLASS, handlerClass);
            add(refAddr);
        }
    
Methods Summary
public java.lang.StringgetFactoryClassName()
Retrieves the class name of the factory of the object to which this reference refers.

        String factory = super.getFactoryClassName();
        if (factory != null) {
            return factory;
        } else {
            factory = System.getProperty(Context.OBJECT_FACTORIES);
            if (factory != null) {
                return null;
            } else {
                return DEFAULT_FACTORY;
            }
        }
    
public java.lang.StringtoString()
Return a String rendering of this object.


        StringBuffer sb = new StringBuffer("HandlerRef[");
        sb.append("className=");
        sb.append(getClassName());
        sb.append(",factoryClassLocation=");
        sb.append(getFactoryClassLocation());
        sb.append(",factoryClassName=");
        sb.append(getFactoryClassName());
        Enumeration refAddrs = getAll();
        while (refAddrs.hasMoreElements()) {
            RefAddr refAddr = (RefAddr) refAddrs.nextElement();
            sb.append(",{type=");
            sb.append(refAddr.getType());
            sb.append(",content=");
            sb.append(refAddr.getContent());
            sb.append("}");
        }
        sb.append("]");
        return (sb.toString());