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

ServiceRef

public class ServiceRef extends Reference
Represents a reference web service.
author
Fabien Carrion

Fields Summary
public static final String
DEFAULT_FACTORY
Default factory for this reference.
public static final String
SERVICE_INTERFACE
Service Classname address type.
public static final String
SERVICE_NAMESPACE
ServiceQname address type.
public static final String
SERVICE_LOCAL_PART
public static final String
WSDL
Wsdl Location address type.
public static final String
JAXRPCMAPPING
Jaxrpcmapping address type.
public static final String
PORTCOMPONENTLINK
port-component-ref/port-component-link address type.
public static final String
SERVICEENDPOINTINTERFACE
port-component-ref/service-endpoint-interface address type.
private Vector
handlers
The vector to save the handler Reference objects, because they can't be saved in the addrs vector.
Constructors Summary
public ServiceRef(String refname, String serviceInterface, String[] serviceQname, String wsdl, String jaxrpcmapping)
Service Reference.

param
serviceClass Service class



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


                
           
                           
        this(refname, serviceInterface, serviceQname, wsdl, jaxrpcmapping,
                        null, null);
    
public ServiceRef(String refname, String serviceInterface, String[] serviceQname, String wsdl, String jaxrpcmapping, String factory, String factoryLocation)
Service Reference.

param
serviceClass Service class

        super(serviceInterface, factory, factoryLocation);
        StringRefAddr refAddr = null;
        if (serviceInterface != null) {
            refAddr = new StringRefAddr(SERVICE_INTERFACE, serviceInterface);
            add(refAddr);
        }
        if (serviceQname[0] != null) {
            refAddr = new StringRefAddr(SERVICE_NAMESPACE, serviceQname[0]);
            add(refAddr);
        }
        if (serviceQname[1] != null) {
            refAddr = new StringRefAddr(SERVICE_LOCAL_PART, serviceQname[1]);
            add(refAddr);
        }
        if (wsdl != null) {
            refAddr = new StringRefAddr(WSDL, wsdl);
            add(refAddr);
        }
        if (jaxrpcmapping != null) {
            refAddr = new StringRefAddr(JAXRPCMAPPING, jaxrpcmapping);
            add(refAddr);
        }
    
Methods Summary
public voidaddHandler(HandlerRef handler)

        handlers.add(handler);
    
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 HandlerRefgetHandler()
Add and Get Handlers classes.

        return handlers.remove(0);
    
public intgetHandlersSize()

        return handlers.size();
    
public java.lang.StringtoString()
Return a String rendering of this object.


        StringBuffer sb = new StringBuffer("ServiceRef[");
        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());