1 23 24 package com.sun.enterprise.tools.verifier.tests.webservices; 25 26 import java.util.List ; 27 import java.util.Iterator ; 28 29 import com.sun.enterprise.tools.verifier.Result; 30 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 31 import com.sun.enterprise.deployment.WebServiceEndpoint; 32 import com.sun.enterprise.deployment.WebServiceHandler; 33 import com.sun.enterprise.deployment.WebServiceHandlerChain; 34 35 38 public class HandlerChainClassCheck extends WSTest implements WSCheck { 39 40 public Result check (WebServiceEndpoint descriptor) { 41 42 Result result = getInitializedResult(); 43 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 44 List handlerChain = descriptor.getHandlerChain(); 47 for (Iterator it = handlerChain.iterator(); it.hasNext();) { 48 List handlers = ((WebServiceHandlerChain)it.next()).getHandlers(); 49 for(Iterator itr = handlers.iterator(); itr.hasNext();) { 50 String hClass = ((WebServiceHandler)itr.next()).getHandlerClass(); 51 try { 52 Class cl = Class.forName(hClass, false, getVerifierContext().getClassLoader()); 53 if (!((javax.xml.ws.handler.Handler.class).isAssignableFrom(cl))) { 54 addErrorDetails(result, compName); 55 result.failed(smh.getLocalString (getClass().getName() + ".failed", 56 "Handler Class [{0}] does not implement " + 57 "javax.xml.ws.handler.Handler Interface", 58 new Object [] {hClass})); 59 } 60 } catch (ClassNotFoundException e) { 61 addErrorDetails(result, compName); 63 result.failed(smh.getLocalString ( 64 "com.sun.enterprise.tools.verifier.tests.webservices.clfailed", 65 "The [{0}] Class [{1}] could not be Loaded", 66 new Object [] {"Handler Class", hClass})); 67 } 68 } 69 } 70 if (result.getStatus() != Result.FAILED) { 71 addGoodDetails(result, compName); 72 result.passed(smh.getLocalString (getClass().getName() + ".passed1", 73 "Handler chains, if any, are defined properly")); 74 } 75 return result; 76 } 77 } 78 | Popular Tags |