public void start() { checkState(controllerRoot == null, "Binding Aware Broker was already started."); LOG.info("Starting Binding Aware Broker: {}", identifier); controllerRoot = new RootSalInstance(getRpcProviderRegistry(), getNotificationBroker(), getDataBroker()); final ImmutableClassToInstanceMap.Builder<BindingAwareService> consBuilder = ImmutableClassToInstanceMap .builder(); consBuilder.put(NotificationService.class, getRoot()); consBuilder.put(DataBrokerService.class, getRoot()); consBuilder.put(RpcConsumerRegistry.class, getRoot()); if (dataBroker != null) { consBuilder.put(DataBroker.class, dataBroker); } consBuilder.put(MountPointService.class, mountService); consBuilder.put(MountService.class, legacyMount).build(); supportedConsumerServices = consBuilder.build(); final ImmutableClassToInstanceMap.Builder<BindingAwareService> provBuilder = ImmutableClassToInstanceMap .builder(); provBuilder.putAll(supportedConsumerServices).put(NotificationProviderService.class, getRoot()) .put(DataProviderService.class, getRoot()).put(RpcProviderRegistry.class, getRoot()) .put(MountProviderService.class, legacyMount); if (notificationPublishService != null) { provBuilder.put(NotificationPublishService.class, notificationPublishService); } supportedConsumerServices = consBuilder.build(); supportedProviderServices = provBuilder.build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If {@code map} somehow * contains entries with duplicate keys (for example, if it is a {@code SortedMap} whose * comparator is not <i>consistent with equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is an {@code * ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If {@code map} somehow * contains entries with duplicate keys (for example, if it is a {@code SortedMap} whose * comparator is not <i>consistent with equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is an {@code * ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { return (ImmutableClassToInstanceMap<B>) (Map) map; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { return (ImmutableClassToInstanceMap<B>) (Map) map; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { return (ImmutableClassToInstanceMap<B>) (Map) map; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { return (ImmutableClassToInstanceMap<B>) (Map) map; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If * {@code map} somehow contains entries with duplicate keys (for example, if * it is a {@code SortedMap} whose comparator is not <i>consistent with * equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is * an {@code ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type * specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If {@code map} somehow * contains entries with duplicate keys (for example, if it is a {@code SortedMap} whose * comparator is not <i>consistent with equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is an {@code * ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If {@code map} somehow * contains entries with duplicate keys (for example, if it is a {@code SortedMap} whose * comparator is not <i>consistent with equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is an {@code * ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }
/** * Returns an immutable map containing the same entries as {@code map}. If {@code map} somehow * contains entries with duplicate keys (for example, if it is a {@code SortedMap} whose * comparator is not <i>consistent with equals</i>), the results of this method are undefined. * * <p><b>Note:</b> Despite what the method name suggests, if {@code map} is an {@code * ImmutableClassToInstanceMap}, no copy will actually be performed. * * @throws NullPointerException if any key or value in {@code map} is null * @throws ClassCastException if any value is not an instance of the type specified by its key */ public static <B, S extends B> ImmutableClassToInstanceMap<B> copyOf( Map<? extends Class<? extends S>, ? extends S> map) { if (map instanceof ImmutableClassToInstanceMap) { @SuppressWarnings("unchecked") // covariant casts safe (unmodifiable) // Eclipse won't compile if we cast to the parameterized type. ImmutableClassToInstanceMap<B> cast = (ImmutableClassToInstanceMap) map; return cast; } return new Builder<B>().putAll(map).build(); }