type.equals("javax.resource.cci.ConnectionFactory") ||
type.equals("org.omg.CORBA_2_3.ORB") ||
type.endsWith("ConnectionFactory")) {
// resource-ref element
ContextResource resource = new ContextResource();
resource.setName(name);
resource.setType(type);
if (annotation.authenticationType()
== Resource.AuthenticationType.CONTAINER) {
resource.setAuth("Container");
} else if (annotation.authenticationType()
== Resource.AuthenticationType.APPLICATION) {
resource.setAuth("Application");
}
resource.setScope(annotation.shareable() ? "Shareable" : "Unshareable");
resource.setProperty("mappedName", annotation.mappedName());
resource.setDescription(annotation.description());
context.getNamingResources().addResource(resource);
} else if (type.equals("javax.jms.Queue") ||
type.equals("javax.jms.Topic")) {
// message-destination-ref
MessageDestinationRef resource = new MessageDestinationRef();
resource.setName(name);
resource.setType(type);
resource.setUsage(annotation.mappedName());
resource.setDescription(annotation.description());
context.getNamingResources().addMessageDestinationRef(resource);
} else if (type.equals("javax.resource.cci.InteractionSpec") ||
type.equals("javax.transaction.UserTransaction") ||
true) {
// resource-env-ref
ContextResourceEnvRef resource = new ContextResourceEnvRef();
resource.setName(name);
resource.setType(type);
resource.setProperty("mappedName", annotation.mappedName());
resource.setDescription(annotation.description());
context.getNamingResources().addResourceEnvRef(resource);
}
}