Code example for Logger

Methods: fine

0
    /** 
     * Probes for the QName on construction. 
     * @param wsdlLocation The location of the WSDL of the service. 
     */ 
    public PlanetsServiceExplorer(URL wsdlLocation) {
    	log.fine("Creating new instance");
        this.wsdlLocation = wsdlLocation;
        this.qName = determineServiceQNameFromWsdl();
    } 
 
    /** 
     * @return the wsdlLocation 
     */ 
    public URL getWsdlLocation() {
        return wsdlLocation;
    } 
 
    /** 
     * @return the qName 
     */ 
    public QName getQName() {
        return qName;
    } 
 
    /** 
     * Attempts to instantiate a service, and so checks if the thing is 
     * essentially working. 
     *  
     * @return true if an instanstiable PlanetsService 
     */ 
    public boolean isServiceInstanciable() { 
        Service service = Service.create(wsdlLocation, qName);
        PlanetsService s = (PlanetsService) service.getPort(getServiceClass());
        if ( s  != null ) {
            return true; 
        } else { 
            return false; 
        } 
    } 
 
    /** 
     * @return the service description for this service, or null. 
     */ 
    public ServiceDescription getServiceDescription() { 
        Service service = Service.create(wsdlLocation, qName);
        PlanetsService s = (PlanetsService) service.getPort(getServiceClass());
        if ( s  != null ) {
            return s.describe();
        } else { 
            return null; 
        } 
    } 
 
    /** 
     * @return the service class 
     */ 
    public Class<?> getServiceClass() {
        return classmap.get(qName);
    } 
 
    /** 
     * This method examines a given service end-point and attempt to determine 
     * the QName of the wsdl:service. 
     *  
     * @param wsdlLocation 
     * @return the QName 
     */ 
    private QName determineServiceQNameFromWsdl() {
    	log.fine("determining qname");
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
 
        // Using factory get an instance of document builder 
        DocumentBuilder db;
        try { 
        	log.fine("new doc builder");
            db = dbf.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
            return null; 
        } 
 
        // parse using builder to get DOM representation of the XML file 
        Document dom;
        try { 
        	log.fine("parsing wsdl");
            dom = db.parse(wsdlLocation.openStream());
        } catch (Exception e) {
            e.printStackTrace();
            return null; 
        } 
 
        // get the root elememt 
        Element root = dom.getDocumentElement();
        log.fine("getting root element");
        return new QName(root.getAttribute("targetNamespace"), root
                .getAttribute("name"));
    } 
 
} 
Connect your IDE to all the code out there  Get Codota for Java