Methods Summary |
---|
public static com.sun.xml.ws.policy.PolicyMap | getPolicyMap(java.lang.String resourceName)
WSDLModel model = getWSDLModel(resourceName, true);
WSDLPolicyMapWrapper wrapper = model.getExtension(WSDLPolicyMapWrapper.class);
return wrapper.getPolicyMap();
|
public static com.sun.xml.ws.policy.PolicyMap | getPolicyMap(java.lang.String resourceName, boolean isClient)
WSDLModel model = getWSDLModel(resourceName, isClient);
WSDLPolicyMapWrapper wrapper = model.getExtension(WSDLPolicyMapWrapper.class);
return wrapper.getPolicyMap();
|
public static java.io.Reader | getResourceReader(java.lang.String resourceName)
return new InputStreamReader(getResourceStream(resourceName));
|
public static java.io.InputStream | getResourceStream(java.lang.String resourceName)
String fullName = POLICY_UNIT_TEST_RESOURCE_ROOT + resourceName;
InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(fullName);
if (input == null) {
throw new PolicyException("Failed to find resource \"" + fullName + "\"");
}
return input;
|
public static java.net.URL | getResourceUrl(java.lang.String resourceName)
return Thread.currentThread().getContextClassLoader().getResource(POLICY_UNIT_TEST_RESOURCE_ROOT + resourceName);
|
public static com.sun.xml.stream.buffer.XMLStreamBuffer | getResourceXmlBuffer(java.lang.String resourceName)
try {
return XMLStreamBuffer.createNewBufferFromXMLStreamReader(inputFactory.createXMLStreamReader(getResourceStream(resourceName)));
} catch (XMLStreamException ex) {
throw new PolicyException("Failed to create XMLStreamBuffer", ex);
}
|
public static com.sun.xml.ws.api.model.wsdl.WSDLModel | getWSDLModel(java.lang.String resourceName)
return getWSDLModel(resourceName, true);
|
public static com.sun.xml.ws.api.model.wsdl.WSDLModel | getWSDLModel(java.lang.String resourceName, boolean isClient)
URL resourceUrl = getResourceUrl(resourceName);
XMLStreamBuffer resourceBuffer = getResourceXmlBuffer(resourceName);
SDDocumentSource doc = SDDocumentSource.create(resourceUrl, resourceBuffer);
try {
Parser parser = new Parser(doc);
WSDLModel model = WSDLModel.WSDLParser.parse(parser, new PolicyConfigResolver(), isClient, new WSDLParserExtension[] {new PolicyWSDLParserExtension()});
return model;
} catch (XMLStreamException ex) {
throw new PolicyException("Failed to parse document", ex);
} catch (IOException ex) {
throw new PolicyException("Failed to parse document", ex);
} catch (SAXException ex) {
throw new PolicyException("Failed to parse document", ex);
}
|
public static com.sun.xml.ws.policy.Policy | loadPolicy(java.lang.String resourceName)
return translateModel(unmarshallModel(resourceName));
|
public static com.sun.xml.ws.policy.Policy | translateModel(com.sun.xml.ws.policy.sourcemodel.PolicySourceModel model)
return PolicyModelTranslator.getTranslator().translate(model);
|
public static com.sun.xml.ws.policy.sourcemodel.PolicySourceModel | unmarshallModel(java.lang.String resource)
Reader resourceReader = getResourceReader(resource);
PolicySourceModel model = PolicyModelUnmarshaller.getXmlUnmarshaller().unmarshalModel(resourceReader);
resourceReader.close();
return model;
|
public static com.sun.xml.ws.policy.sourcemodel.PolicySourceModel | unmarshallModel(java.io.Reader resourceReader)
PolicySourceModel model = PolicyModelUnmarshaller.getXmlUnmarshaller().unmarshalModel(resourceReader);
resourceReader.close();
return model;
|