forked from apache/dubbo
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish apache#3946 : Dubbo Cloud Native : To Add Dubbo metadata service
- Loading branch information
1 parent
e2faa73
commit 8fbf452
Showing
3 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...o-common/src/main/java/org/apache/dubbo/common/metadata/DubboMetadataServiceExporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.dubbo.common.metadata; | ||
|
||
import org.apache.dubbo.common.URL; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* The exporter of {@link DubboMetadataService} | ||
* | ||
* @see DubboMetadataService | ||
* @see #export() | ||
* @see #unexport() | ||
* @since 2.7.2 | ||
*/ | ||
public interface DubboMetadataServiceExporter { | ||
|
||
/** | ||
* Exports the {@link DubboMetadataService} as a Dubbo service | ||
* | ||
* @return the exported {@link URL URLs} | ||
*/ | ||
List<URL> export(); | ||
|
||
/** | ||
* Unexports the {@link DubboMetadataService} | ||
*/ | ||
void unexport(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
.../main/java/org/apache/dubbo/config/metadata/ConfigurableDubboMetadataServiceExporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.dubbo.config.metadata; | ||
|
||
import org.apache.dubbo.common.URL; | ||
import org.apache.dubbo.common.logger.Logger; | ||
import org.apache.dubbo.common.logger.LoggerFactory; | ||
import org.apache.dubbo.common.metadata.DubboMetadataService; | ||
import org.apache.dubbo.common.metadata.DubboMetadataServiceExporter; | ||
import org.apache.dubbo.config.ApplicationConfig; | ||
import org.apache.dubbo.config.ProtocolConfig; | ||
import org.apache.dubbo.config.RegistryConfig; | ||
import org.apache.dubbo.config.ServiceConfig; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* @since 2.7.2 | ||
*/ | ||
public class ConfigurableDubboMetadataServiceExporter implements DubboMetadataServiceExporter { | ||
|
||
private final Logger logger = LoggerFactory.getLogger(getClass()); | ||
|
||
private Optional<DubboMetadataService> dubboMetadataService; | ||
|
||
private ApplicationConfig applicationConfig; | ||
|
||
private List<ProtocolConfig> protocols; | ||
|
||
private List<RegistryConfig> registries; | ||
|
||
/** | ||
* The ServiceConfig of DubboMetadataConfigService to be exported, can be nullable. | ||
*/ | ||
private ServiceConfig<DubboMetadataService> serviceConfig; | ||
|
||
|
||
@Override | ||
public List<URL> export() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void unexport() { | ||
|
||
} | ||
} |