use of org.glassfish.deployment.common.Descriptor in project Payara by payara.
the class DeploymentDescriptorNode method addPrefixMapping.
/**
* notify of a new prefix mapping used in this document
*/
public void addPrefixMapping(String prefix, String uri) {
Object o = getDescriptor();
if (o instanceof Descriptor) {
Descriptor descriptor = (Descriptor) o;
descriptor.addPrefixMapping(prefix, uri);
}
}
use of org.glassfish.deployment.common.Descriptor in project Payara by payara.
the class EjbReferenceNode method writeDescriptor.
@Override
public Node writeDescriptor(Node parent, String nodeName, EjbReference descriptor) {
Node ejbRefNode = appendChild(parent, nodeName);
if (descriptor instanceof Descriptor) {
Descriptor ejbRefDesc = (Descriptor) descriptor;
writeLocalizedDescriptions(ejbRefNode, ejbRefDesc);
}
appendTextChild(ejbRefNode, TagNames.EJB_REFERENCE_NAME, descriptor.getName());
appendTextChild(ejbRefNode, TagNames.EJB_REFERENCE_TYPE, descriptor.getType());
if (descriptor.isLocal()) {
appendTextChild(ejbRefNode, TagNames.LOCAL_HOME, descriptor.getEjbHomeInterface());
appendTextChild(ejbRefNode, TagNames.LOCAL, descriptor.getEjbInterface());
} else {
appendTextChild(ejbRefNode, TagNames.HOME, descriptor.getEjbHomeInterface());
appendTextChild(ejbRefNode, TagNames.REMOTE, descriptor.getEjbInterface());
}
appendTextChild(ejbRefNode, TagNames.EJB_LINK, descriptor.getLinkName());
if (descriptor instanceof EnvironmentProperty) {
EnvironmentProperty envProp = (EnvironmentProperty) descriptor;
appendTextChild(ejbRefNode, TagNames.MAPPED_NAME, envProp.getMappedName());
}
if (descriptor.isInjectable()) {
InjectionTargetNode ijNode = new InjectionTargetNode();
for (InjectionTarget target : descriptor.getInjectionTargets()) {
ijNode.writeDescriptor(ejbRefNode, TagNames.INJECTION_TARGET, target);
}
}
if (descriptor.hasLookupName()) {
appendTextChild(ejbRefNode, TagNames.LOOKUP_NAME, descriptor.getLookupName());
}
return ejbRefNode;
}
use of org.glassfish.deployment.common.Descriptor in project Payara by payara.
the class MailSessionDeployer method unRegisterMailSessions.
private void unRegisterMailSessions(Descriptor descriptor) {
if (descriptor instanceof JndiNameEnvironment) {
JndiNameEnvironment env = (JndiNameEnvironment) descriptor;
for (Descriptor msd : env.getResourceDescriptors(JavaEEResourceType.MSD)) {
assert msd instanceof MailSessionDescriptor;
unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
}
}
// ejb descriptor
if (descriptor instanceof EjbBundleDescriptor) {
EjbBundleDescriptor ejbDesc = (EjbBundleDescriptor) descriptor;
Set<EjbDescriptor> ejbDescriptors = (Set<EjbDescriptor>) ejbDesc.getEjbs();
for (EjbDescriptor ejbDescriptor : ejbDescriptors) {
for (Descriptor msd : ejbDescriptor.getResourceDescriptors(JavaEEResourceType.MSD)) {
assert msd instanceof MailSessionDescriptor;
unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
}
}
// ejb interceptors
Set<EjbInterceptor> ejbInterceptors = ejbDesc.getInterceptors();
for (EjbInterceptor ejbInterceptor : ejbInterceptors) {
for (Descriptor msd : ejbInterceptor.getResourceDescriptors(JavaEEResourceType.MSD)) {
assert msd instanceof MailSessionDescriptor;
unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
}
}
}
// managed bean descriptors
if (descriptor instanceof BundleDescriptor) {
Set<ManagedBeanDescriptor> managedBeanDescriptors = ((BundleDescriptor) descriptor).getManagedBeans();
for (ManagedBeanDescriptor mbd : managedBeanDescriptors) {
for (Descriptor msd : mbd.getResourceDescriptors(JavaEEResourceType.MSD)) {
assert msd instanceof MailSessionDescriptor;
unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
}
}
}
}
use of org.glassfish.deployment.common.Descriptor in project Payara by payara.
the class DataSourceDefinitionDeployer method registerDataSourceDefinitions.
public void registerDataSourceDefinitions(com.sun.enterprise.deployment.Application application) {
String appName = application.getAppName();
// Register data source definitions defined in application.xml
registerDataSourceDefinitions(appName, application);
// Register data source definition defined in web.xml and ejb-jar.xml
for (BundleDescriptor bundle : application.getBundleDescriptors()) {
registerDataSourceDefinitions(appName, bundle);
Collection<RootDeploymentDescriptor> descriptors = bundle.getExtensionsDescriptors();
if (descriptors != null) {
for (Descriptor descriptor : descriptors) {
registerDataSourceDefinitions(appName, descriptor);
}
}
}
}
use of org.glassfish.deployment.common.Descriptor in project Payara by payara.
the class EjbBundleDescriptorImpl method print.
/**
* Returns a formatted String representing my state.
*/
@Override
public void print(StringBuffer toStringBuffer) {
toStringBuffer.append("EjbBundleDescriptor\n");
super.print(toStringBuffer);
if (cmpResourceReference != null) {
toStringBuffer.append("\ncmp resource ");
cmpResourceReference.print(toStringBuffer);
}
toStringBuffer.append("\nclient JAR ").append(getEjbClientJarUri());
for (Descriptor o : getEjbs()) {
toStringBuffer.append("\n------------\n");
o.print(toStringBuffer);
toStringBuffer.append("\n------------");
}
}
Aggregations