本文整理了Java中javax.ejb.Local.value()
方法的一些代码示例,展示了Local.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Local.value()
方法的具体详情如下:
包路径:javax.ejb.Local
类名称:Local
方法名:value
暂无
代码示例来源:origin: jersey/jersey
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
final List<Class> allLocalOrRemoteIfaces = new LinkedList<>();
if (resourceClass.isAnnotationPresent(Remote.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
}
if (resourceClass.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value()));
}
for (Class<?> i : resourceClass.getInterfaces()) {
if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.add(i);
}
}
return allLocalOrRemoteIfaces;
}
代码示例来源:origin: wildfly/wildfly
private Collection<Class<?>> getLocalBusinessInterfaces(final DeploymentUnit deploymentUnit, final Class<?> sessionBeanClass) throws DeploymentUnitProcessingException {
final Local localViewAnnotation = sessionBeanClass.getAnnotation(Local.class);
if (localViewAnnotation == null) {
Collection<Class<?>> interfaces = getBusinessInterfacesFromInterfaceAnnotations(sessionBeanClass, Local.class);
if (!interfaces.isEmpty()) {
return interfaces;
}
return Collections.emptySet();
}
Class<?>[] localViews = localViewAnnotation.value();
if (localViews == null || localViews.length == 0) {
Set<Class<?>> interfaces = getPotentialBusinessInterfaces(sessionBeanClass);
// For version < 3.2, the EJB spec didn't allow more than one implementing interfaces to be considered as local when the bean class had the @Local annotation without any explicit value.
// EJB 3.2 allows it (core spec, section 4.9.7)
if (interfaces.size() != 1 && !isEjbVersionGreaterThanOrEqualTo32(deploymentUnit)) {
throw EjbLogger.ROOT_LOGGER.beanWithLocalAnnotationImplementsMoreThanOneInterface(sessionBeanClass);
}
return interfaces;
}
return Arrays.asList(localViews);
}
代码示例来源:origin: com.sun.jersey/jersey-servlet
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>();
if (resourceClass.isAnnotationPresent(Remote.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
}
if (resourceClass.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value()));
}
for (Class<?> i : resourceClass.getInterfaces()) {
if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.add(i);
}
}
return allLocalOrRemoteIfaces;
}
代码示例来源:origin: jersey/jersey-1.x
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>();
if (resourceClass.isAnnotationPresent(Remote.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
}
if (resourceClass.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value()));
}
for (Class<?> i : resourceClass.getInterfaces()) {
if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.add(i);
}
}
return allLocalOrRemoteIfaces;
}
代码示例来源:origin: com.sun.jersey/jersey-bundle
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>();
if (resourceClass.isAnnotationPresent(Remote.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
}
if (resourceClass.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value()));
}
for (Class<?> i : resourceClass.getInterfaces()) {
if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
allLocalOrRemoteIfaces.add(i);
}
}
return allLocalOrRemoteIfaces;
}
代码示例来源:origin: org.seasar.container/s2-tiger
/**
* {@link Local}アノテーションで指定されたビジネスインターフェースを検出します。
*/
protected void detectLocalBusinessInterfaces() {
final Local local = beanClass.getAnnotation(Local.class);
if (local != null) {
for (final Class<?> type : local.value()) {
if (isBusinessInterface(type)) {
businessInterfaces.add(type);
}
}
return;
}
for (final Class<?> type : beanClass.getInterfaces()) {
final Local annotation = type.getAnnotation(Local.class);
if (annotation != null) {
businessInterfaces.add(type);
}
}
}
代码示例来源:origin: eclipse-ee4j/tyrus
@Override
public Method getInvocableMethod(Method method) {
final Class<?> declaringClass = method.getDeclaringClass();
final List<Class> interfaces = new LinkedList<Class>();
if (declaringClass.isAnnotationPresent(Remote.class)) {
interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Remote.class).value()));
}
if (declaringClass.isAnnotationPresent(Local.class)) {
interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Local.class).value()));
}
for (Class<?> i : declaringClass.getInterfaces()) {
if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
interfaces.add(i);
}
}
for (Class iface : interfaces) {
try {
final Method interfaceMethod = iface.getDeclaredMethod(method.getName(), method.getParameterTypes());
if (interfaceMethod != null) {
return interfaceMethod;
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, e.getMessage(), e);
}
}
return method;
}
代码示例来源:origin: org.glassfish.tyrus/tyrus-container-glassfish-ejb
@Override
public Method getInvocableMethod(Method method) {
final Class<?> declaringClass = method.getDeclaringClass();
final List<Class> interfaces = new LinkedList<Class>();
if (declaringClass.isAnnotationPresent(Remote.class)) {
interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Remote.class).value()));
}
if (declaringClass.isAnnotationPresent(Local.class)) {
interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Local.class).value()));
}
for (Class<?> i : declaringClass.getInterfaces()) {
if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
interfaces.add(i);
}
}
for (Class iface : interfaces) {
try {
final Method interfaceMethod = iface.getDeclaredMethod(method.getName(), method.getParameterTypes());
if (interfaceMethod != null) {
return interfaceMethod;
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, e.getMessage(), e);
}
}
return method;
}
代码示例来源:origin: org.jboss.as/jboss-as-ejb3
private Collection<Class<?>> getLocalBusinessInterfaces(Class<?> sessionBeanClass) throws DeploymentUnitProcessingException {
final Local localViewAnnotation = sessionBeanClass.getAnnotation(Local.class);
if (localViewAnnotation == null) {
Collection<Class<?>> interfaces = getBusinessInterfacesFromInterfaceAnnotations(sessionBeanClass, Local.class);
if (!interfaces.isEmpty()) {
return interfaces;
}
return Collections.emptySet();
}
Class<?>[] localViews = localViewAnnotation.value();
if (localViews == null || localViews.length == 0) {
Set<Class<?>> interfaces = getPotentialBusinessInterfaces(sessionBeanClass);
if (interfaces.size() != 1)
throw MESSAGES.beanWithLocalAnnotationImplementsMoreThanOneInterface(sessionBeanClass);
return interfaces;
}
return Arrays.asList(localViews);
}
代码示例来源:origin: org.jboss/jboss-metadata
public void process(SessionBeanMetaData metaData, Class<?> type)
{
Local local = finder.getAnnotation(type, Local.class);
if(local == null)
return;
if(type.isInterface())
{
addBusinessInterface(metaData, type);
}
else
{
if(local.value() == null || local.value().length == 0)
{
Class<?> businessInterface = ClassHelper.getDefaultInterface(type);
addBusinessInterface(metaData, businessInterface);
}
else
{
for(Class<?> businessInterface : local.value())
{
addBusinessInterface(metaData, businessInterface);
}
}
}
}
}
代码示例来源:origin: org.jboss.ws/jbossws-jboss510-metadata
public void process(SessionBeanMetaData metaData, Class<?> type)
{
Local local = finder.getAnnotation(type, Local.class);
if(local == null)
return;
if(type.isInterface())
{
addBusinessInterface(metaData, type);
}
else
{
if(local.value() == null || local.value().length == 0)
{
Class<?> businessInterface = ClassHelper.getDefaultInterface(type);
addBusinessInterface(metaData, businessInterface);
}
else
{
for(Class<?> businessInterface : local.value())
{
addBusinessInterface(metaData, businessInterface);
}
}
}
}
代码示例来源:origin: org.jboss.ws/jbossws-jboss510-metadata
public void process(JBossSessionBeanMetaData metaData, Class<?> type)
{
Local local = finder.getAnnotation(type, Local.class);
if(local == null)
return;
if(type.isInterface())
{
addBusinessInterface(metaData, type);
}
else
{
if(local.value() == null || local.value().length == 0)
{
Class<?> businessInterface = ClassHelper.getDefaultInterface(type);
addBusinessInterface(metaData, businessInterface);
}
else
{
for(Class<?> businessInterface : local.value())
{
addBusinessInterface(metaData, businessInterface);
}
}
}
}
代码示例来源:origin: org.graniteds/granite-server-ejb
for (Class<?> i : clazz.getAnnotation(Local.class).value())
scannedClasses.put(i, clazz);
代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-core
if (localAnnotation != null)
Class[] locals = localAnnotation.value();
for (int i = 0; i < locals.length; ++i)
代码示例来源:origin: org.jboss.jbossas/jboss-as-resteasy
if (localAnnotation.value() == null || localAnnotation.value().length == 0)
for (Class<?> clazz : localAnnotation.value())
代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-core
if (local.value().length < 1 && local.value().length < 1)
for (Class<?> localClass : local.value())
代码示例来源:origin: org.jboss.arquillian.container/arquillian-weld-ee-embedded-1.1
if (localAnnotation != null)
for (final Class<?> clazz : localAnnotation.value())
代码示例来源:origin: org.jboss.weld.arquillian.container/arquillian-weld-ee-embedded-1.1
if (localAnnotation != null)
for (final Class<?> clazz : localAnnotation.value())
代码示例来源:origin: com.caucho/resin
if (local != null && local.value() != null) {
_localList.clear();
for (Class<?> api : local.value()) {
代码示例来源:origin: com.caucho/resin
for (Class<?> localClass : local.value()) {
addLocal(localClass);
for (Class<?> localClass : local.value()) {
addRemote(localClass);
内容来源于网络,如有侵权,请联系作者删除!