public void visitType(Stateless annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { Scope scopeMetaAnnotation = annotation.annotationType().getAnnotation(Scope.class); String scopeName = scopeMetaAnnotation.value(); componentType.setScope(scopeName); } }
public void visitType(Domain annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { Scope scopeMetaAnnotation = annotation.annotationType().getAnnotation(Scope.class); String scopeName = scopeMetaAnnotation.value(); componentType.setScope(scopeName); } }
public void visitType(Composite annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { Scope scopeMetaAnnotation = annotation.annotationType().getAnnotation(Scope.class); String scopeName = scopeMetaAnnotation.value(); componentType.setScope(scopeName); } }
public void visitType(Scope annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { String scopeName = annotation.value(); if (!COMPOSITE.getScope().equals(scopeName) && !STATELESS.getScope().equals(scopeName) && !DOMAIN.getScope().equals(scopeName)) { InvalidScope failure = new InvalidScope(type, scopeName, componentType); context.addError(failure); return; } componentType.setScope(scopeName); } }
public void visitType(Scope annotation, Class<?> type, InjectingComponentType componentType, IntrospectionContext context) { String scopeName = annotation.value(); if (!COMPOSITE.getScope().equals(scopeName) && !STATELESS.getScope().equals(scopeName) && !DOMAIN.getScope().equals(scopeName)) { InvalidScope failure = new InvalidScope(type, scopeName, componentType); context.addError(failure); return; } org.fabric3.api.model.type.component.Scope scope = org.fabric3.api.model.type.component.Scope.getScope(scopeName); componentType.setScope(scope); } }
@Override public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException { org.oasisopen.sca.annotation.Scope annotation = clazz.getAnnotation(org.oasisopen.sca.annotation.Scope.class); if (annotation == null) { type.setJavaScope(JavaScopeImpl.STATELESS); return; } String name = annotation.value(); JavaScopeImpl scope; if ("COMPOSITE".equals(name)) { scope = JavaScopeImpl.COMPOSITE; } else if ("STATELESS".equals(name)) { scope = JavaScopeImpl.STATELESS; } else { scope = JavaScopeImpl.INVALID; } type.setJavaScope(scope); if (type.getJavaScope().equals(JavaScopeImpl.INVALID)) { throw new IntrospectionException("Invalid scope :" + name + " for " + type.getName()); } } }