private boolean isWebServiceBean(EJBContainer container) { boolean isWebServiceBean = false; if (container instanceof StatelessContainer || container instanceof MessagingContainer) { boolean isWebService = container.resolveAnnotation(WebService.class) != null; boolean isWebServiceProvider = container.resolveAnnotation(WebServiceProvider.class) != null; isWebServiceBean = isWebService || isWebServiceProvider; } return isWebServiceBean; } }
private boolean isWebServiceBean(EJBContainer container) { boolean isWebServiceBean = false; if (container instanceof StatelessContainer || container instanceof MessagingContainer) { boolean isWebService = container.resolveAnnotation(WebService.class) != null; boolean isWebServiceProvider = container.resolveAnnotation(WebServiceProvider.class) != null; isWebServiceBean = isWebService || isWebServiceProvider; } return isWebServiceBean; } }
/** * Checks whether a method declares a Timeout annotation * @param container EJBContainer * @param meth The method under investigation for an annotation * @return @Timeout annotation exists */ public boolean containsTimeoutAnnotation(EJBContainer container, Method meth) { return (Timeout) container.resolveAnnotation(meth, Timeout.class) != null; }
private boolean isWebServiceBean(EJBContainer container) { boolean isWebServiceBean = false; if (container instanceof StatelessContainer) { boolean isWebService = container.resolveAnnotation(WebService.class) != null; boolean isWebServiceProvider = container.resolveAnnotation(WebServiceProvider.class) != null; isWebServiceBean = isWebService || isWebServiceProvider; } return isWebServiceBean; } }
private boolean isWebServiceBean(EJBContainer container) { boolean isWebServiceBean = false; if (container instanceof StatelessContainer || container instanceof MessagingContainer) { boolean isWebService = container.resolveAnnotation(WebService.class) != null; boolean isWebServiceProvider = container.resolveAnnotation(WebServiceProvider.class) != null; isWebServiceBean = isWebService || isWebServiceProvider; } return isWebServiceBean; } }
/** * @deprecated this is going to be gone soon */ @SuppressWarnings("unchecked") public Object resolveAnnotation(Method m, Class[] annotationChoices) { Object value = null; int i = 0; while (value == null && i < annotationChoices.length){ value = resolveAnnotation(m, annotationChoices[i++]); } return value; }
public static Object getAnnotation(Class<? extends Annotation> annotation, EJBContainer container, Class<?> annotatedClass, boolean isContainer) { if (isContainer) { return container.resolveAnnotation(annotation); } else { return annotatedClass.getAnnotation(annotation); } }
public static Object getAnnotation(Class<? extends Annotation> annotation, EJBContainer container, Field field, boolean isContainer) { if (isContainer) { return container.resolveAnnotation(field, annotation); } else { return field.getAnnotation(annotation); } }
public static Object getAnnotation(Class<? extends Annotation> annotation, EJBContainer container, Method method, boolean isContainer) { if (isContainer) { return container.resolveAnnotation(method, annotation); } else { return method.getAnnotation(annotation); } }
private static String getEndpointInterface(Container container) { WebService ws = (javax.jws.WebService) ((EJBContainer) container).resolveAnnotation(javax.jws.WebService.class); if (ws != null) { return ws.endpointInterface(); } return null; }
protected Object getInvokedInterface(Method method) Remote remoteAnnotation = (Remote) resolveAnnotation(Remote.class); if (remoteAnnotation != null) Local localAnnotation = (Local) resolveAnnotation(Local.class); if (localAnnotation != null)
private void buildWebServiceMetaData(EJBArchiveMetaData appMetaData, EJBContainer container) { WebContext webContext = (WebContext)container.resolveAnnotation(WebContext.class); if(webContext!=null) { appMetaData.setWebServiceContextRoot(webContext.contextRoot()); } }
private void buildWebServiceMetaData(EJBArchiveMetaData appMetaData, EJBContainer container) { WebContext webContext = (WebContext)container.resolveAnnotation(WebContext.class); if(webContext!=null) { appMetaData.setWebServiceContextRoot(webContext.contextRoot()); } }
Object annotation = container.resolveAnnotation(method, classes); annotation = container.resolveAnnotation(classes[classIndex++]);
@SuppressWarnings("unchecked") public <T> T getSecurityManager(Class<T> type) { try { InitialContext ctx = getInitialContext(); SecurityDomain securityAnnotation = (SecurityDomain) resolveAnnotation(SecurityDomain.class); if (securityAnnotation != null && securityAnnotation.value().length() > 0) { return (T) SecurityDomainManager.getSecurityManager(securityAnnotation.value(),ctx); } return null; } catch (NamingException e) { throw new RuntimeException(e); } }
public void addSecurityDomain(Element jbossWeb, Deployment dep) { String securityDomain = null; Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class); if (ejb3Deployment != null) { Iterator it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext()) { EJBContainer container = (EJBContainer)it.next(); SecurityDomain anSecurityDomain = (SecurityDomain)container.resolveAnnotation(SecurityDomain.class); if (anSecurityDomain != null) { if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value())) throw new IllegalStateException("Multiple security domains not supported"); securityDomain = anSecurityDomain.value(); } } } if (securityDomain != null) { if (securityDomain.startsWith("java:/jaas/") == false) securityDomain = "java:/jaas/" + securityDomain; jbossWeb.addElement("security-domain").addText(securityDomain); } }
if (container.resolveAnnotation(found, ann) == null)
public void addSecurityRoles(Element webApp, Deployment dep) { Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class); if (ejb3Deployment != null) { Iterator it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext()) { EJBContainer container = (EJBContainer)it.next(); RolesAllowed anRolesAllowed = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class); if (anRolesAllowed != null) { for (String role : anRolesAllowed.value()) { webApp.addElement("security-role").addElement("role-name").addText(role); } } } } } }
/** * Interceptors are additive. What's in the annotations and in the XML is * merged */ private void addClassLevelInterceptorBindingAnnotations( EJBContainer container, InterceptorBindingMetaData binding) throws ClassNotFoundException { Interceptors interceptors = (Interceptors) container .resolveAnnotation(Interceptors.class); if (binding != null) { Interceptors impl = createInterceptorsFromInterceptorBinding(interceptors, binding); addClassAnnotation(container, impl.annotationType(), impl); } boolean exclude = false; if (binding != null) exclude = binding.isExcludeDefaultInterceptors(); if (exclude && container.resolveAnnotation(ExcludeDefaultInterceptors.class) == null) { addClassAnnotation(container, ExcludeDefaultInterceptors.class, new ExcludeDefaultInterceptorsImpl()); } }
return null; RunAsPrincipal rap = (RunAsPrincipal) container.resolveAnnotation(RunAsPrincipal.class); String runAsPrincipal = null; if (rap != null)