ServiceConfig extends AbstractServiceConfig { public synchronized void unexport() { if (!exported.get()) { return; } try { ConfigHandler configHandler = ExtensionLoader.getExtensionLoader(ConfigHandler.class).getExtension(MotanConstants.DEFAULT_VALUE); configHandler.unexport(exporters, registryUrls); } finally { afterUnexport(); } }  static ConcurrentHashSet<String> getExistingServices(); Class<?> getInterface(); void setInterface(Class<T> interfaceClass); List<MethodConfig> getMethods(); void setMethods(MethodConfig methods); void setMethods(List<MethodConfig> methods); boolean hasMethods(); T getRef(); void setRef(T ref); List<Exporter<T>> getExporters(); synchronized void export(); synchronized void unexport(); @ConfigDesc(excluded = true) BasicServiceInterfaceConfig getBasicService(); void setBasicService(BasicServiceInterfaceConfig basicService); Map<String, Integer> getProtocolAndPort(); @ConfigDesc(excluded = true) String getHost(); void setHost(String host); AtomicBoolean getExported();  }
@Test public void testUnexport() { testExport(); serviceConfig.unexport(); assertFalse(serviceConfig.getExported().get()); assertEquals(serviceConfig.getExporters().size(), 0); }