private void populateExtensions() { List<PluginExtension> exts = pluginRgty.getExtensionByInterfaceName(VipReleaseExtensionPoint.class.getName()); for (PluginExtension ext : exts) { VipReleaseExtensionPoint extp = (VipReleaseExtensionPoint) ext.getInstance(); VipReleaseExtensionPoint old = vipReleaseExts.get(extp.getVipUse()); if (old != null) { throw new CloudRuntimeException(String.format("duplicate VirtualRouterVipReleaseExtensionPoint for %s, old[%s], new[%s]", old.getClass().getName(), extp.getClass().getName(), old.getVipUse())); } vipReleaseExts.put(extp.getVipUse(), extp); } exts = pluginRgty.getExtensionByInterfaceName(VipBackend.class.getName()); for (PluginExtension ext : exts) { VipBackend extp = (VipBackend) ext.getInstance(); VipBackend old = vipBackends.get(extp.getServiceProviderTypeForVip()); if (old != null) { throw new CloudRuntimeException( String.format("duplicate VipBackend[%s, %s] for provider type[%s]", old.getClass().getName(), extp.getClass().getName(), extp.getServiceProviderTypeForVip()) ); } vipBackends.put(extp.getServiceProviderTypeForVip(), extp); } for (VipFactory ext : pluginRgty.getExtensionList(VipFactory.class)) { VipFactory old = factories.get(ext.getNetworkServiceProviderType()); if (old != null) { throw new CloudRuntimeException(String.format("duplicate VipFactory[%s, %s] for the network service provider type[%s]", old.getClass(), ext.getClass(), ext.getNetworkServiceProviderType())); } factories.put(ext.getNetworkServiceProviderType(), ext); } }