/** * @deprecated use getAnnotation */ @SuppressWarnings("unchecked") public Object resolveAnnotation(Field field, Class annotationType) { return getAnnotation(annotationType, field); }
/** * @deprecated use getAnnotation */ @SuppressWarnings("unchecked") public Object resolveAnnotation(Class annotationType) { return getAnnotation(annotationType); }
/** * @deprecated use getAnnotation */ @SuppressWarnings("unchecked") public Object resolveAnnotation(Method method, Class annotationType) { return getAnnotation(annotationType, method); }
public static Class<?> getRemoteHomeInterface(Container container) { RemoteHome li = ((EJBContainer) container).getAnnotation(javax.ejb.RemoteHome.class); if (li != null) return li.value(); return null; }
public static Class<?> getLocalHomeInterface(Container container) { LocalHome li = ((EJBContainer) container).getAnnotation(javax.ejb.LocalHome.class); if (li != null) return li.value(); return null; }
public static String getRemoteBusinessJndiName(EJBContainer container, boolean check) { RemoteBinding binding = container.getAnnotation(RemoteBinding.class); return ProxyFactoryHelper.getRemoteBusinessJndiName(container, binding); }
public <T extends Annotation> T getAnnotation(Class<T> annotation) { T result = ejbContainer != null ? ejbContainer.getAnnotation(annotation) : null; if (result == null) { Class bean = getComponentClass(); if(bean.isAnnotationPresent(annotation)) { result = (T)bean.getAnnotation(annotation); } } return result; }
public <T extends Annotation> T getAnnotation(Class<T> annotation) { T result = ejbContainer != null ? ejbContainer.getAnnotation(annotation) : null; if (result == null) { Class bean = getComponentClass(); if(bean.isAnnotationPresent(annotation)) { result = (T)bean.getAnnotation(annotation); } } return result; }
public <T extends Annotation> T getAnnotation(Class<T> annotation) { T result = ejbContainer != null ? ejbContainer.getAnnotation(annotation) : null; if (result == null) { Class bean = getComponentClass(); if(bean.isAnnotationPresent(annotation)) { result = (T)bean.getAnnotation(annotation); } } return result; }
public <T extends Annotation> T getAnnotation(Class<T> annotation) { T result = ejbContainer != null ? ejbContainer.getAnnotation(annotation) : null; if (result == null) { Class bean = getComponentClass(); if(bean.isAnnotationPresent(annotation)) { result = (T)bean.getAnnotation(annotation); } } return result; }
/** * Returns requested annotation associated with EJB container or EJB bean. * * @param annotationType annotation type * @param <T> annotation class type * @return requested annotation or null if not found */ public <T extends Annotation> T getAnnotation(final Class<T> annotationType) { final boolean haveEjbContainer = this.ejbContainer != null; if (haveEjbContainer) { return this.ejbContainer.getAnnotation(annotationType); } else { final Class<?> bean = this.getComponentClass(); return (T) bean.getAnnotation(annotationType); } }
/** * Returns requested annotation associated with EJB container or EJB bean. * * @param annotationType annotation type * @param <T> annotation class type * @return requested annotation or null if not found */ public <T extends Annotation> T getAnnotation(final Class<T> annotationType) { final boolean haveEjbContainer = this.ejbContainer != null; if (haveEjbContainer) { return this.ejbContainer.getAnnotation(annotationType); } else { final Class<?> bean = this.getComponentClass(); return (T) bean.getAnnotation(annotationType); } }
/** * Returns requested annotation associated with EJB container or EJB bean. * * @param annotationType annotation type * @param <T> annotation class type * @return requested annotation or null if not found */ public <T extends Annotation> T getAnnotation(final Class<T> annotationType) { final boolean haveEjbContainer = this.ejbContainer != null; if (haveEjbContainer) { return this.ejbContainer.getAnnotation(annotationType); } else { final Class<?> bean = this.getComponentClass(); return (T) bean.getAnnotation(annotationType); } }
/** * @see EJBContext#getCallerPrincipal() */ public Principal getCallerPrincipal() { EJBContainer ec = (EJBContainer) container; SecurityDomain domain = ec.getAnnotation(SecurityDomain.class); Principal callerPrincipal = ejbContextHelper.getCallerPrincipal(SecurityActions.getSecurityContext(), rm, domain); // This method never returns null. if (callerPrincipal == null) throw new java.lang.IllegalStateException("No valid security context for the caller identity"); return callerPrincipal; }
public static String getLocalHomeJndiName(EJBContainer container) { // Use explicitly-specified binding, if defined LocalHomeBinding binding = container.getAnnotation(LocalHomeBinding.class); if (binding != null) return binding.jndiBinding(); // Use Default JNDI Binding Policy JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData)container.getXml(); return smd.getLocalHomeJndiName(); }
public static String getHomeJndiName(EJBContainer container) { // Use explicitly-specified binding, if defined RemoteHomeBinding binding = container.getAnnotation(RemoteHomeBinding.class); if (binding != null) return binding.jndiBinding(); JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData)container.getXml(); return smd.getHomeJndiName(); }
protected void initializePool() throws Exception { org.jboss.ejb3.annotation.Pool poolAnnotation = getAnnotation(org.jboss.ejb3.annotation.Pool.class); if (poolAnnotation == null) throw new IllegalStateException("No pool annotation"); String registeredPoolName = poolAnnotation.value(); // EJBTHREE-1119 if(registeredPoolName==null||registeredPoolName.trim().equals("")) { // Default the Pool Implementation registeredPoolName = PoolDefaults.POOL_IMPLEMENTATION_THREADLOCAL; } int maxSize = poolAnnotation.maxSize(); long timeout = poolAnnotation.timeout(); PoolFactoryRegistry registry = deployment.getPoolFactoryRegistry(); PoolFactory factory = registry.getPoolFactory(registeredPoolName); pool = factory.createPool(); pool.initialize(this, maxSize, timeout); pool.setInjectors(injectors.toArray(new Injector[injectors.size()])); }
private static void checkForJndiNamingConflict(EJBContainer container) { if (container.getAnnotation(Local.class) != null) { JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData)container.getXml(); String localJndiName = smd.getLocalJndiName(); String remoteJndiName = smd.getJndiName(); String ejbName = container.getEjbName(); if (localJndiName != null) { if (localJndiName.equals(remoteJndiName) || localJndiName.startsWith(remoteJndiName + "/")) throw new javax.ejb.EJBException("Conflict between default jndi name " + remoteJndiName + " for both remote and local for ejb-name:" + ejbName + ", bean class=" + container.getBeanClass() + "\nLocal JNDI Name: " + localJndiName + "\nRemote JNDI Name: " + remoteJndiName); } } }
private static String getLocalJndiName(EJBContainer container, boolean conflictCheck) { // See if local binding is explicitly-defined LocalBinding localBinding = container.getAnnotation(LocalBinding.class); // If none specified if (localBinding == null || (localBinding.jndiBinding() != null && localBinding.jndiBinding().trim().length() == 0)) { JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData)container.getXml(); String name = smd.getLocalJndiName(); // If we should check for naming conflict if (conflictCheck){ // Check ProxyFactoryHelper.checkForJndiNamingConflict(container); } // Return return name; } // Local Binding was explicitly-specified, use it else { return localBinding.jndiBinding(); } }
/** * @see EJBContext#isCallerInRole(String) */ public boolean isCallerInRole(String roleName) { EJBContainer ejbc = (EJBContainer)container; //Take care of Policy Context ID for callbacks SecurityActions.setContextID(ejbc.getJaccContextId()); return ejbContextHelper.isCallerInRole(SecurityActions.getSecurityContext(), ejbc.getAnnotation(SecurityDomain.class), rm, ejbc.getXml(), roleName, ejbc.getEjbName()); }