/** * {@inheritDoc} */ public Activation getActivation(String uniqueId) throws NotFoundException { if (uniqueId == null) throw new IllegalArgumentException("UniqueId is null"); if (uniqueId.trim().equals("")) throw new IllegalArgumentException("UniqueId is empty"); if (!activations.containsKey(uniqueId)) throw new NotFoundException(bundle.keyNotRegistered(uniqueId)); return activations.get(uniqueId); }
/** * {@inheritDoc} */ public File getRoot(String uniqueId) throws NotFoundException { if (uniqueId == null) throw new IllegalArgumentException("UniqueId is null"); if (uniqueId.trim().equals("")) throw new IllegalArgumentException("UniqueId is empty"); if (!raRoots.containsKey(uniqueId)) throw new NotFoundException(bundle.keyNotRegistered(uniqueId)); return raRoots.get(uniqueId); }
/** * {@inheritDoc} */ public void unregisterResourceAdapter(String uniqueId) throws NotFoundException { if (uniqueId == null) throw new IllegalArgumentException("UniqueId is null"); if (uniqueId.trim().equals("")) throw new IllegalArgumentException("UniqueId is empty"); if (!raTemplates.containsKey(uniqueId)) throw new NotFoundException(bundle.keyNotRegistered(uniqueId)); raTemplates.remove(uniqueId); raRoots.remove(uniqueId); activations.remove(uniqueId); }
/** * {@inheritDoc} */ public Map<String, List<String>> getJndiMappings(String uniqueId) throws NotFoundException { if (uniqueId == null) throw new IllegalArgumentException("UniqueId is null"); if (uniqueId.trim().equals("")) throw new IllegalArgumentException("UniqueId is empty"); if (!jndiMappings.containsKey(uniqueId)) throw new NotFoundException(bundle.keyNotRegistered(uniqueId)); Map<String, List<String>> mappings = jndiMappings.get(uniqueId); if (mappings == null) return Collections.unmodifiableMap(new HashMap<String, List<String>>(0)); return Collections.unmodifiableMap(mappings); }
/** * {@inheritDoc} */ public Connector getResourceAdapter(String uniqueId) throws NotFoundException { if (uniqueId == null) throw new IllegalArgumentException("UniqueId is null"); if (uniqueId.trim().equals("")) throw new IllegalArgumentException("UniqueId is empty"); if (!raTemplates.containsKey(uniqueId)) throw new NotFoundException(bundle.keyNotRegistered(uniqueId)); Connector md = raTemplates.get(uniqueId); // Always return a copy as the caller may make changes to it return (Connector)md.copy(); }
throw new NotFoundException(bundle.keyNotRegistered(uniqueId));