org.apache.dubbo.common.Extension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dubbo Show documentation
Show all versions of dubbo Show documentation
The all in one project of dubbo
/*
* 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;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Marker for extension interface
*
* Changes on extension configuration file
* Use Protocol
as an example, its configuration file 'META-INF/dubbo/com.xxx.Protocol' is changes from:
*
* com.foo.XxxProtocol
* com.foo.YyyProtocol
*
*
* to key-value pair
*
* xxx=com.foo.XxxProtocol
* yyy=com.foo.YyyProtocol
*
*
* The reason for this change is:
*
* If there's third party library referenced by static field or by method in extension implementation, its class will
* fail to initialize if the third party library doesn't exist. In this case, dubbo cannot figure out extension's id
* therefore cannot be able to map the exception information with the extension, if the previous format is used.
*
* For example:
*
* Fails to load Extension("mina"). When user configure to use mina, dubbo will complain the extension cannot be loaded,
* instead of reporting which extract extension implementation fails and the extract reason.
*
*
* @deprecated because it's too general, switch to use {@link org.apache.dubbo.common.extension.SPI}
*/
@Deprecated
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface Extension {
/**
* @deprecated
*/
@Deprecated
String value() default "";
}