use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class WebServiceHandlerNode method writeDescriptor.
/**
* write the method descriptor class to a query-method DOM tree and
* return it
*
* @param parent node in the DOM tree
* @param nodeName name for the root element of this xml fragment
* @param handler the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, WebServiceHandler handler) {
Node wshNode = super.writeDescriptor(parent, nodeName, handler);
writeDisplayableComponentInfo(wshNode, handler);
appendTextChild(wshNode, WebServicesTagNames.HANDLER_NAME, handler.getHandlerName());
appendTextChild(wshNode, WebServicesTagNames.HANDLER_CLASS, handler.getHandlerClass());
for (Iterator iter = handler.getInitParams().iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
Node initParamNode = appendChild(wshNode, WebServicesTagNames.INIT_PARAM);
appendTextChild(initParamNode, WebServicesTagNames.INIT_PARAM_NAME, next.getName());
appendTextChild(initParamNode, WebServicesTagNames.INIT_PARAM_VALUE, next.getValue());
}
for (Iterator iter = handler.getSoapHeaders().iterator(); iter.hasNext(); ) {
QName next = (QName) iter.next();
// Append soap header QName. NOTE : descriptor does not contain
// a prefix so always generate one.
appendQNameChild(WebServicesTagNames.SOAP_HEADER, wshNode, next.getNamespaceURI(), next.getLocalPart(), null);
}
for (Iterator iter = handler.getSoapRoles().iterator(); iter.hasNext(); ) {
String next = (String) iter.next();
appendTextChild(wshNode, WebServicesTagNames.SOAP_ROLE, next);
}
for (Iterator iter = handler.getPortNames().iterator(); iter.hasNext(); ) {
String next = (String) iter.next();
appendTextChild(wshNode, WebServicesTagNames.HANDLER_PORT_NAME, next);
}
return wshNode;
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class CmpResourceNode method writeDescriptor.
@Override
public Node writeDescriptor(Node parent, String nodeName, ResourceReferenceDescriptor descriptor) {
Node cmp = super.writeDescriptor(parent, nodeName, descriptor);
appendTextChild(cmp, RuntimeTagNames.JNDI_NAME, descriptor.getJndiName());
if (descriptor.getResourcePrincipal() != null) {
DefaultResourcePrincipalNode drpNode = new DefaultResourcePrincipalNode();
drpNode.writeDescriptor(cmp, RuntimeTagNames.DEFAULT_RESOURCE_PRINCIPAL, descriptor.getResourcePrincipal());
}
// properties*
Iterator properties = descriptor.getProperties();
if (properties != null) {
RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
while (properties.hasNext()) {
NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
propNode.writeDescriptor(cmp, RuntimeTagNames.PROPERTY, aProp);
}
}
// createTableAtDeploy, dropTableAtUndeploy
if (descriptor.isCreateTablesAtDeploy()) {
appendTextChild(cmp, RuntimeTagNames.CREATE_TABLES_AT_DEPLOY, RuntimeTagNames.TRUE);
}
if (descriptor.isDropTablesAtUndeploy()) {
appendTextChild(cmp, RuntimeTagNames.DROP_TABLES_AT_UNDEPLOY, RuntimeTagNames.TRUE);
}
// database vendor name
appendTextChild(cmp, RuntimeTagNames.DATABASE_VENDOR_NAME, descriptor.getDatabaseVendorName());
// schema-generator-properties?
Properties schemaGeneratorProps = descriptor.getSchemaGeneratorProperties();
if (schemaGeneratorProps != null) {
PropertiesNode pn = new PropertiesNode();
pn.writeDescriptor(cmp, RuntimeTagNames.SCHEMA_GENERATOR_PROPERTIES, schemaGeneratorProps);
}
return cmp;
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class WLServiceRefPortInfoRuntimeNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param nodeName node name for the descriptor
* @param desc the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, ServiceRefPortInfo desc) {
Node serviceRefPortInfoRuntimeNode = super.writeDescriptor(parent, nodeName, desc);
QName port = desc.getWsdlPort();
if (port != null) {
appendTextChild(serviceRefPortInfoRuntimeNode, WLWebServicesTagNames.SERVICE_REFERENCE_PORT_NAME, port.getLocalPart());
// stub-property*
NameValuePairNode nameValueNode = new NameValuePairNode();
Set stubProperties = desc.getStubProperties();
for (Iterator iter = stubProperties.iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.STUB_PROPERTY, next);
}
// call-property*
for (Iterator iter = desc.getCallProperties().iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.CALL_PROPERTY, next);
}
}
return serviceRefPortInfoRuntimeNode;
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class WebServiceHandlerNode method setElementValue.
/**
* receives notification of the value for a particular tag
*
* @param element the xml element
* @param value it's associated value
*/
public void setElementValue(XMLElement element, String value) {
String qname = element.getQName();
WebServiceHandler handler = (WebServiceHandler) getDescriptor();
if (WebServicesTagNames.INIT_PARAM_NAME.equals(qname)) {
initParam = new NameValuePairDescriptor();
initParam.setName(value);
} else if (WebServicesTagNames.INIT_PARAM_VALUE.equals(qname)) {
initParam.setValue(value);
handler.addInitParam(initParam);
} else if (TagNames.DESCRIPTION.equals(qname)) {
if (initParam != null) {
// description for the init-param
initParam.setDescription(value);
initParam = null;
} else {
// must be the description element of the handler itself.
super.setElementValue(element, value);
}
} else if (WebServicesTagNames.SOAP_HEADER.equals(qname)) {
String prefix = getPrefixFromQName(value);
String localPart = getLocalPartFromQName(value);
String namespaceUri = resolvePrefix(element, prefix);
if (namespaceUri == null) {
logger.log(Level.SEVERE, LogUtils.INVALID_DESC_MAPPING_FAILURE, new Object[] { prefix, handler.getHandlerName() });
} else {
QName soapHeader = new QName(namespaceUri, localPart);
handler.addSoapHeader(soapHeader);
}
} else
super.setElementValue(element, value);
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class PortCreationCallbackImpl method postCreateProxy.
public void postCreateProxy(WSBindingProvider bp, Class<?> serviceEndpointInterface) {
ServiceRefPortInfo portInfo = ref.getPortInfoBySEI(serviceEndpointInterface.getName());
if (portInfo != null) {
// Set MTOM for this port
boolean mtomEnabled = false;
if (portInfo.getMtomEnabled() != null && Boolean.valueOf(portInfo.getMtomEnabled())) {
mtomEnabled = true;
}
if (mtomEnabled) {
Binding bType = bp.getBinding();
// enable mtom valid only for SOAPBindings
if (SOAPBinding.class.isAssignableFrom(bType.getClass())) {
((SOAPBinding) bType).setMTOMEnabled(true);
} else {
logger.log(Level.SEVERE, LogUtils.INVALID_MTOM, portInfo.getName());
}
}
// Set stub properties
Set properties = portInfo.getStubProperties();
for (Iterator iter = properties.iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
bp.getRequestContext().put(next.getName(), next.getValue());
}
}
}
Aggregations