当前位置: 首页>>代码示例>>Java>>正文


Java Typed类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:CdiCamelFactory.java

示例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;
}
 
开发者ID:shillner,项目名称:maven-cdi-plugin-utils,代码行数:18,代码来源:CdiProducerBean.java

示例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);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:12,代码来源:CdiCamelFactory.java

示例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);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:CdiCamelFactory.java

示例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;
}
 
开发者ID:Tibor17,项目名称:javaee-samples,代码行数:14,代码来源:BeanType.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java

示例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;
}
 
开发者ID:apache,项目名称:portals-pluto,代码行数:14,代码来源:PortletArtifactProducer.java


注:本文中的javax.enterprise.inject.Typed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。