ThreadPoolShuttle( String prefix, ExecutorService threadPool, Map<Class<?>, ThreadPoolProcessor> payloadTypes, ConcurrentHashMap<String, Shuttle> outShuttles) { Validate.notNull(prefix); Validate.notNull(threadPool); Validate.notNull(payloadTypes); Validate.notNull(outShuttles); // outShuttles is concurrent map -- entries added/removed on the fly, don't nullcheck keys or values Validate.noNullElements(payloadTypes.keySet()); Validate.noNullElements(payloadTypes.values()); this.prefix = prefix; this.threadPool = threadPool; this.payloadTypes = (UnmodifiableMap<Class<?>, ThreadPoolProcessor>) unmodifiableMap(new HashMap<>(payloadTypes)); this.outShuttles = outShuttles; }
InstrumentationResult( byte[] instrumentedClass, Map<String, byte[]> extraFiles) { Validate.notNull(instrumentedClass); Validate.notNull(extraFiles); Validate.noNullElements(extraFiles.keySet()); Validate.noNullElements(extraFiles.values()); this.instrumentedClass = Arrays.copyOf(instrumentedClass, instrumentedClass.length); this.extraFiles = (UnmodifiableMap<String, byte[]>) UnmodifiableMap.unmodifiableMap(new HashMap<>(extraFiles)); }
@Override public Map<K, Collection<V>> asMap() { return UnmodifiableMap.unmodifiableMap(decorated().asMap()); }
/** * Returns an unmodifiable map backed by the given map. * <p> * This method uses the implementation in the decorators subpackage. * * @param <K> the key type * @param <V> the value type * @param map the map to make unmodifiable, must not be null * @return an unmodifiable map backed by the given map * @throws NullPointerException if the map is null */ public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> map) { return UnmodifiableMap.unmodifiableMap(map); }
/** * Get extra files to include along with the instrumented class. * @return extra files to include along with the instrumented class */ public UnmodifiableMap<String, byte[]> getExtraFiles() { return extraFiles; }