本文整理汇总了Java中javax.enterprise.inject.Typed类的典型用法代码示例。如果您正苦于以下问题:Java Typed类的具体用法?Java Typed怎么用?Java Typed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Typed类属于javax.enterprise.inject包,在下文中一共展示了Typed类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mockEndpointFromUri
import javax.enterprise.inject.Typed; //导入依赖的package包/类
@Uri("")
@Produces
@Typed(MockEndpoint.class)
// Qualifiers are dynamically added in CdiCamelExtension
private static MockEndpoint mockEndpointFromUri(InjectionPoint ip, @Any Instance<CamelContext> instance, CdiCamelExtension extension) {
Uri uri = getQualifierByType(ip, Uri.class).get();
try {
CamelContext context = uri.context().isEmpty()
? selectContext(ip, instance, extension)
: selectContext(uri.context(), instance);
return context.getEndpoint(uri.value(), MockEndpoint.class);
} catch (Exception cause) {
throw new InjectionException("Error injecting mock endpoint annotated with " + uri
+ " into " + ip, cause);
}
}
示例2: calcBeanTypes
import javax.enterprise.inject.Typed; //导入依赖的package包/类
private Set<Type> calcBeanTypes(Type implTpye) {
Set<Type> beanTypes = Sets.newHashSet();
if (implTpye instanceof ParameterizedType) {
beanTypes.add((ParameterizedType) implTpye);
} else {
Typed typedAnnotation = ((Class<?>) implTpye).getAnnotation(Typed.class);
if (typedAnnotation != null) {
for (Class<?> cls : typedAnnotation.value()) {
beanTypes.add(cls);
}
} else {
beanTypes.addAll(getTypeClasses((Class<?>) implTpye));
}
}
return beanTypes;
}
示例3: mockEndpointFromMember
import javax.enterprise.inject.Typed; //导入依赖的package包/类
@Produces
@Typed(MockEndpoint.class)
// Qualifiers are dynamically added in CdiCamelExtension
private static MockEndpoint mockEndpointFromMember(InjectionPoint ip, @Any Instance<CamelContext> instance, CdiCamelExtension extension) {
String uri = "mock:" + ip.getMember().getName();
try {
return selectContext(ip, instance, extension).getEndpoint(uri, MockEndpoint.class);
} catch (Exception cause) {
throw new InjectionException("Error injecting mock endpoint into " + ip, cause);
}
}
示例4: createMockEndpoint
import javax.enterprise.inject.Typed; //导入依赖的package包/类
@Mock
@Produces
@Typed(MockEndpoint.class)
// Qualifiers are dynamically added in CdiCamelExtension
private static MockEndpoint createMockEndpoint(InjectionPoint ip, @Any Instance<CamelContext> instance, CdiCamelExtension extension) {
Mock mock = getQualifierByType(ip, Mock.class).get();
try {
CamelContext context = mock.context().isEmpty()
? selectContext(ip, instance, extension)
: selectContext(mock.context(), instance);
return context.getEndpoint(mock.value(), MockEndpoint.class);
} catch (Exception cause) {
throw new InjectionException("Error injecting mock endpoint annotated with " + mock + " into " + ip, cause);
}
}
示例5: equalsAsTyped
import javax.enterprise.inject.Typed; //导入依赖的package包/类
boolean equalsAsTyped(BeanType given) {
if (!equalsWithoutType(given)) {
return false;
}
for (Class<?> t : type.getAnnotation(Typed.class).value()) {
if (given.getType() == t) {
return true;
}
}
return false;
}
示例6: produceClientDataRequest
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the ClientDataRequest.
*/
@Produces @PortletRequestScoped @Named("clientDataRequest") @Typed(ClientDataRequest.class)
public static ClientDataRequest produceClientDataRequest() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
ClientDataRequest req = null;
if (pap.req instanceof ClientDataRequest) {
req = (ClientDataRequest) pap.req;
}
return req;
}
示例7: produceMimeResponse
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the MimeResponse.
*/
@Produces @PortletRequestScoped @Named("mimeResponse") @Typed(MimeResponse.class)
public static MimeResponse produceMimeResponse() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
MimeResponse resp = null;
if (pap.resp instanceof MimeResponse) {
resp = (MimeResponse) pap.resp;
}
return resp;
}
示例8: produceStateAwareResponse
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the StateAwareResponse.
*/
@Produces @PortletRequestScoped @Named("stateAwareResponse") @Typed(StateAwareResponse.class)
public static StateAwareResponse produceStateAwareResponse() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
StateAwareResponse resp = null;
if (pap.resp instanceof StateAwareResponse) {
resp = (StateAwareResponse) pap.resp;
}
return resp;
}
示例9: produceActionRequest
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the ActionRequest.
*/
@Produces @PortletRequestScoped @Named("actionRequest") @Typed(ActionRequest.class)
public static ActionRequest produceActionRequest() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
ActionRequest req = null;
if (pap.req instanceof ActionRequest) {
req = (ActionRequest) pap.req;
}
return req;
}
示例10: produceActionResponse
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the ActionResponse.
*/
@Produces @PortletRequestScoped @Named("actionResponse") @Typed(ActionResponse.class)
public static ActionResponse produceActionResponse() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
ActionResponse resp = null;
if (pap.resp instanceof ActionResponse) {
resp = (ActionResponse) pap.resp;
}
return resp;
}
示例11: produceHeaderRequest
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the HeaderRequest.
*/
@Produces @PortletRequestScoped @Named("headerRequest") @Typed(HeaderRequest.class)
public static HeaderRequest produceHeaderRequest() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
HeaderRequest req = null;
if (pap.req instanceof HeaderRequest) {
req = (HeaderRequest) pap.req;
}
return req;
}
示例12: produceHeaderResponse
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the HeaderResponse.
*/
@Produces @PortletRequestScoped @Named("headerResponse") @Typed(HeaderResponse.class)
public static HeaderResponse produceHeaderResponse() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
HeaderResponse resp = null;
if (pap.resp instanceof HeaderResponse) {
resp = (HeaderResponse) pap.resp;
}
return resp;
}
示例13: produceRenderRequest
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the RenderRequest.
*/
@Produces @PortletRequestScoped @Named("renderRequest") @Typed(RenderRequest.class)
public static RenderRequest produceRenderRequest() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
RenderRequest req = null;
if ((pap.req instanceof RenderRequest) && !(pap.req instanceof HeaderRequest)) {
req = (RenderRequest) pap.req;
}
return req;
}
示例14: produceRenderResponse
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the RenderResponse.
*/
@Produces @PortletRequestScoped @Named("renderResponse") @Typed(RenderResponse.class)
public static RenderResponse produceRenderResponse() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
RenderResponse resp = null;
if (pap.resp instanceof RenderResponse) {
resp = (RenderResponse) pap.resp;
}
return resp;
}
示例15: produceEventRequest
import javax.enterprise.inject.Typed; //导入依赖的package包/类
/**
* Producer method for the EventRequest.
*/
@Produces @PortletRequestScoped @Named("eventRequest") @Typed(EventRequest.class)
public static EventRequest produceEventRequest() {
PortletArtifactProducer pap = producers.get();
assert pap != null;
EventRequest req = null;
if (pap.req instanceof EventRequest) {
req = (EventRequest) pap.req;
}
return req;
}