use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode 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;
}
use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode in project Payara by payara.
the class ResourceAdapterNode 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, ResourceAdapter descriptor) {
Element raNode = (Element) super.writeDescriptor(parent, nodeName, descriptor);
appendTextChild(raNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription());
setAttribute(raNode, RuntimeTagNames.JNDI_NAME, (String) descriptor.getValue(ResourceAdapter.JNDI_NAME));
setAttribute(raNode, RuntimeTagNames.MAX_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.MAX_POOL_SIZE));
setAttribute(raNode, RuntimeTagNames.STEADY_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.STEADY_POOL_SIZE));
setAttribute(raNode, RuntimeTagNames.MAX_WAIT_TIME_IN_MILLIS, (String) descriptor.getValue(ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS));
setAttribute(raNode, RuntimeTagNames.IDLE_TIMEOUT_IN_SECONDS, (String) descriptor.getValue(ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS));
// properties...
NameValuePairDescriptor[] properties = descriptor.getPropertyElement();
if (properties != null && properties.length > 0) {
RuntimeNameValuePairNode subNode = new RuntimeNameValuePairNode();
for (int i = 0; i < properties.length; i++) {
subNode.writeDescriptor(raNode, RuntimeTagNames.PROPERTY, properties[i]);
}
}
return raNode;
}
use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode in project Payara by payara.
the class EnterpriseBeansRuntimeNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, EjbBundleDescriptorImpl bundleDescriptor) {
Node ejbs = super.writeDescriptor(parent, nodeName, bundleDescriptor);
// NOTE : unique-id is no longer written out to sun-ejb-jar.xml. It is persisted via
// domain.xml deployment context properties instead.
// ejb*
EjbNode ejbNode = new EjbNode();
for (Iterator ejbIterator = bundleDescriptor.getEjbs().iterator(); ejbIterator.hasNext(); ) {
EjbDescriptor ejbDescriptor = (EjbDescriptor) ejbIterator.next();
ejbNode.writeDescriptor(ejbs, RuntimeTagNames.EJB, ejbDescriptor);
}
// pm-descriptors?
PMDescriptorsNode pmsNode = new PMDescriptorsNode();
pmsNode.writeDescriptor(ejbs, RuntimeTagNames.PM_DESCRIPTORS, bundleDescriptor);
// cmpresource?
ResourceReferenceDescriptor rrd = bundleDescriptor.getCMPResourceReference();
if (rrd != null) {
CmpResourceNode crn = new CmpResourceNode();
crn.writeDescriptor(ejbs, RuntimeTagNames.CMP_RESOURCE, rrd);
}
// message-destination*
writeMessageDestinationInfo(ejbs, bundleDescriptor);
// webservice-description*
WebServiceRuntimeNode webServiceNode = new WebServiceRuntimeNode();
webServiceNode.writeWebServiceRuntimeInfo(ejbs, bundleDescriptor);
for (NameValuePairDescriptor p : bundleDescriptor.getEnterpriseBeansProperties()) {
RuntimeNameValuePairNode nameValNode = new RuntimeNameValuePairNode();
nameValNode.writeDescriptor(ejbs, RuntimeTagNames.PROPERTY, p);
}
return ejbs;
}
use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode 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;
}
Aggregations