use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class WsCompile method createHandlerInfo.
private HandlerInfo createHandlerInfo(WebServiceHandler handler) {
HandlerInfo handlerInfo = rpcFactory.createHandlerInfo();
handlerInfo.setHandlerClassName(handler.getHandlerClass());
for (Iterator iter = handler.getSoapHeaders().iterator(); iter.hasNext(); ) {
QName next = (QName) iter.next();
handlerInfo.addHeaderName(next);
}
Map properties = handlerInfo.getProperties();
for (Iterator iter = handler.getInitParams().iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
properties.put(next.getName(), next.getValue());
}
return handlerInfo;
}
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 NameValuePairNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node in the DOM tree
* @param node name for the root element of this xml fragment
* @param iterator on the descriptors to write
* @return the DOM tree top node
*/
public void writeDescriptor(Node parent, String nodeName, Iterator props) {
if (props == null)
return;
while (props.hasNext()) {
NameValuePairDescriptor aProp = (NameValuePairDescriptor) props.next();
writeDescriptor(parent, nodeName, aProp);
}
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class MessageDrivenHandler method setEjbDescriptorInfo.
/**
* Set Annotation information to Descriptor.
* This method will also be invoked for an existing descriptor with
* annotation as user may not specific a complete xml.
* @param ejbDesc
* @param ainfo
* @return HandlerProcessingResult
*/
protected HandlerProcessingResult setEjbDescriptorInfo(EjbDescriptor ejbDesc, AnnotationInfo ainfo) throws AnnotationProcessorException {
MessageDriven mdAn = (MessageDriven) ainfo.getAnnotation();
Class ejbClass = (Class) ainfo.getAnnotatedElement();
EjbMessageBeanDescriptor ejbMsgBeanDesc = (EjbMessageBeanDescriptor) ejbDesc;
HandlerProcessingResult procResult = setMessageListenerInterface(mdAn, ejbMsgBeanDesc, ejbClass, ainfo);
doDescriptionProcessing(mdAn.description(), ejbMsgBeanDesc);
doMappedNameProcessing(mdAn.mappedName(), ejbMsgBeanDesc);
for (ActivationConfigProperty acProp : mdAn.activationConfig()) {
EnvironmentProperty envProp = new EnvironmentProperty(acProp.propertyName(), TranslatedConfigView.expandValue(acProp.propertyValue()), "");
// xml override
switch(acProp.propertyName()) {
case "resourceAdapter":
ejbMsgBeanDesc.setResourceAdapterMid(envProp.getValue());
break;
case DescriptorConstants.MAX_POOL_SIZE:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setMaxPoolSize(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.POOL_RESIZE_QTY:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setPoolResizeQuantity(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.STEADY_POOL_SIZE:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setSteadyPoolSize(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.MAX_WAIT_TIME:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setMaxWaitTimeInMillis(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.POOL_IDLE_TIMEOUT:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setPoolIdleTimeoutInSeconds(Integer.valueOf(envProp.getValue()));
break;
case "SingletonBeanPool":
NameValuePairDescriptor singletonProperty = new NameValuePairDescriptor();
singletonProperty.setName("singleton-bean-pool");
singletonProperty.setValue(envProp.getValue());
ejbMsgBeanDesc.getEjbBundleDescriptor().addEnterpriseBeansProperty(singletonProperty);
break;
default:
if (ejbMsgBeanDesc.getActivationConfigValue(envProp.getName()) == null) {
ejbMsgBeanDesc.putActivationConfigProperty(envProp);
}
break;
}
}
return procResult;
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class WebServiceEndpointRuntimeNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param node name for the descriptor
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, WebServiceEndpoint endpoint) {
Node endpointNode = super.writeDescriptor(parent, nodeName, endpoint);
appendTextChild(endpointNode, WebServicesTagNames.PORT_COMPONENT_NAME, endpoint.getEndpointName());
appendTextChild(endpointNode, WebServicesTagNames.ENDPOINT_ADDRESS_URI, endpoint.getEndpointAddressUri());
// this info is described in web application itself.
if (endpoint.implementedByEjbComponent() && endpoint.hasAuthMethod()) {
Node loginConfigNode = appendChild(endpointNode, RuntimeTagNames.LOGIN_CONFIG);
appendTextChild(loginConfigNode, RuntimeTagNames.AUTH_METHOD, endpoint.getAuthMethod());
appendTextChild(loginConfigNode, RuntimeTagNames.REALM, endpoint.getRealm());
}
// message-security-binding
MessageSecurityBindingDescriptor messageSecBindingDesc = endpoint.getMessageSecurityBinding();
if (messageSecBindingDesc != null) {
MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
messageSecBindingNode.writeDescriptor(endpointNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
}
appendTextChild(endpointNode, WebServicesTagNames.TRANSPORT_GUARANTEE, endpoint.getTransportGuarantee());
QName serviceName = endpoint.getServiceName();
if (serviceName != null) {
Node serviceQnameNode = appendChild(endpointNode, WebServicesTagNames.SERVICE_QNAME);
appendTextChild(serviceQnameNode, WebServicesTagNames.NAMESPACE_URI, serviceName.getNamespaceURI());
appendTextChild(serviceQnameNode, WebServicesTagNames.LOCAL_PART, serviceName.getLocalPart());
}
appendTextChild(endpointNode, WebServicesTagNames.TIE_CLASS, endpoint.getTieClassName());
if (endpoint.implementedByWebComponent() && (endpoint.getServletImplClass() != null)) {
appendTextChild(endpointNode, WebServicesTagNames.SERVLET_IMPL_CLASS, endpoint.getServletImplClass());
}
// debugging-enabled?
appendTextChild(endpointNode, WebServicesTagNames.DEBUGGING_ENABLED, endpoint.getDebugging());
// property*
Iterator properties = endpoint.getProperties();
if (properties != null) {
RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
while (properties.hasNext()) {
NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
propNode.writeDescriptor(endpointNode, RuntimeTagNames.PROPERTY, aProp);
}
}
return endpointNode;
}
Aggregations