Skip to content

Commit

Permalink
Polish apache#3946 : Dubbo Cloud Native : To Add Dubbo metadata service
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed May 14, 2019
1 parent e2faa73 commit 8fbf452
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 1 deletion.
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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static org.apache.dubbo.common.URL.buildKey;

/**
* The {@link DubboMetadataService} implementation stores the metadata of Dubbo services in memory when they exported, and
* The {@link DubboMetadataService} implementation stores the metadata of Dubbo services in memory when they exported
*
* @since 2.7.2
*/
Expand Down
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() {

}
}

0 comments on commit 8fbf452

Please sign in to comment.