code: @Override
      @FFDCIgnore(NoSuchMethodException.class)
      public XAResource getXAResource(Serializable xaresinfo) throws XAResourceNotAvailableException {
          XAResource xa = null;
          if (xaresinfo != null) {
              @SuppressWarnings("unchecked")
              ArrayList<Byte> byteList = (ArrayList<Byte>) xaresinfo;
              byte[] bytes = new byte[byteList.size()];
              int i = 0;
              for (Byte b : byteList)
                  bytes[i++] = b;
              try {
                  ActivationConfig config = (ActivationConfig) Utils.deserialize(bytes);
                  Object activationSpec = createActivationSpec(config.getActivationConfigProps(),
                                                               config.getAuthenticationAlias(),
                                                               null,
                                                               config.getDestinationRef(),
                                                               null,
                                                               config.getApplicationName());
                  if (qmidenabled) {
                      Class<? extends Object> mcImplClass = activationSpec.getClass();
                      try {
                          String qmid = config.getQmid();
                          Method m = mcImplClass.getMethod("setQmid", new Class[] { String.class });
                          m.invoke(activationSpec, qmid);
                      } catch (NoSuchMethodException nsme) {
                          qmidenabled = false;
                      } catch (InvocationTargetException ite) {
                          qmidenabled = false;
                      }
                  }
                  BootstrapContextImpl bootstrapContext = bootstrapContextRef.getServiceWithException();
                  ActivationSpec[] actspecs = new ActivationSpec[] { (ActivationSpec) activationSpec };
                  XAResource[] resources = bootstrapContext.resourceAdapter.getXAResources(actspecs);
                  if (resources != null && resources.length == 1) {
                      xa = resources[0];
                  } else if (resources != null && resources.length > 1) {
                      throw new IllegalStateException(Utils.getMessage("J2CA8800.multiple.xa.resources", bootstrapContext.getResourceAdapterName(), id));
                  }
              } catch (Exception e) {
                  throw new XAResourceNotAvailableException(e);
              }
          }
          return xa;
      }
docs: /*
  (non-Javadoc)
  
  @see com.ibm.tx.jta.XAResourceFactory#getXAResource(java.io.Serializable)