private static Reference createReference(final ResourceBase resource) { final Reference ref; if (resource instanceof ContextResource) { final ContextResource cr = (ContextResource) resource; ref = new ResourceRef(resource.getType(), resource.getDescription(), cr.getScope(), cr.getAuth(), cr.getSingleton()); } else { ref = new ResourceEnvRef(resource.getType()); } final Iterator<String> params = resource.listProperties(); while (params.hasNext()) { final String paramName = params.next(); final String paramValue = (String) resource.getProperty(paramName); final StringRefAddr refAddr = new StringRefAddr(paramName, paramValue); ref.add(refAddr); } return ref; }
if (cr.getSingleton()) { String closeMethod = cr.getCloseMethod(); if (closeMethod != null && closeMethod.length() > 0) {
if (cr.getSingleton()) { String closeMethod = cr.getCloseMethod(); if (closeMethod != null && closeMethod.length() > 0) {
if (cr.getSingleton()) { String closeMethod = cr.getCloseMethod(); if (closeMethod != null && closeMethod.length() > 0) {
(resource.getType(), resource.getDescription(), resource.getScope(), resource.getAuth(), resource.getSingleton()); resource.getSingleton()) { try { ObjectName on = createObjectName(resource);
resource.getScope(), resource.getAuth(), resource.getSingleton()); resource.getSingleton()) { try { ObjectName on = createObjectName(resource);
resource.getScope(), resource.getAuth(), resource.getSingleton()); resource.getSingleton()) { try { ObjectName on = createObjectName(resource);
final boolean isAlreadyCreated = ContextResource.class.isInstance(resource) && ContextResource.class.cast(resource).getSingleton() && isDataSource;