本文整理汇总了Java中org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory类的典型用法代码示例。如果您正苦于以下问题:Java AbstractContainerRequestValueFactory类的具体用法?Java AbstractContainerRequestValueFactory怎么用?Java AbstractContainerRequestValueFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractContainerRequestValueFactory类属于org.glassfish.jersey.server.internal.inject包,在下文中一共展示了AbstractContainerRequestValueFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createValueFactory
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory; //导入依赖的package包/类
@Override
protected Factory<RequestRateLimiterFactory> createValueFactory(final Parameter parameter) {
final RateLimiting annotation = parameter.getAnnotation(RateLimiting.class);
if (null == annotation) {
return null;
} else {
return new AbstractContainerRequestValueFactory<RequestRateLimiterFactory>() {
public RequestRateLimiterFactory provide() {
return requestRateLimiterFactory;
}
};
}
}
示例2: createValueFactory
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory; //导入依赖的package包/类
@Override
protected Factory<?> createValueFactory(final Parameter parameter) {
final RateLimiting annotation = parameter.getAnnotation(RateLimiting.class);
if (null == annotation) {
return null;
} else {
return new AbstractContainerRequestValueFactory<RequestRateLimiterFactory>() {
public RequestRateLimiterFactory provide() {
return requestRateLimiterFactory;
}
};
}
}
示例3: createValueFactory
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory; //导入依赖的package包/类
@Override protected Factory<?> createValueFactory(final Parameter parameter) {
final Class<?> classType = parameter.getRawType();
final Auth auth = parameter.getAnnotation(Auth.class);
if (auth == null) {
return null;
}
if (classType.equals(Client.class)) {
return new AbstractContainerRequestValueFactory<Client>() {
@Override public Client provide() {
return clientAuthFactory.provide(getContainerRequest());
}
};
}
if (classType.equals(AutomationClient.class)) {
return new AbstractContainerRequestValueFactory<AutomationClient>() {
@Override public AutomationClient provide() {
return automationClientAuthFactory.provide(getContainerRequest());
}
};
}
if (classType.equals(User.class)) {
return new AbstractContainerRequestValueFactory<User>() {
@Override public User provide() {
return userAuthFactory.provide(getContainerRequest());
}
};
}
return null;
}
示例4: createValueFactory
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory; //导入依赖的package包/类
@Override
protected Factory<?> createValueFactory(Parameter parameter) {
if (!parameter.isAnnotationPresent(Auth.class)) {
return null;
}
return new AbstractContainerRequestValueFactory<Principal>() {
public Principal provide() {
return user;
}
};
}