private LocalServiceLocatorImpl(String moduleName) { super(createInitialContext()); this.moduleName = moduleName == null ? "" : moduleName; this.bm = this.lookup(JNDI_NAME_BEAN_MANAGER); }
/** * Gets an instance of a remote JndiServiceLocator, configured by JU property files. * @return */ public static synchronized JndiServiceLocator getRemoteServiceLocator() { if (remoteServiceLocator == null) { remoteServiceLocator = ServiceLocatorBuilder.createRemoteByConfigurationFiles(); } return remoteServiceLocator; }
/** * Gets a builder to create a new Local ServiceLocator, i.e. a ServiceLocator * that will perform local JNDI and CDI lookups. * @return Builder instance */ public static LocalServiceLocatorBuilder buildLocal() { return new LocalServiceLocatorBuilder(); }
@Override public final void init() { this.serviceLocator = ServiceLocatorBuilder.buildLocal().createServiceLocator(); this.em = this.serviceLocator.cdi(EntityManager.class); this.emUtil = new JuEmUtil(this.em); this.doInit(); }
@Override protected void initVerifier(DataVerifier verifier) { if (verifier instanceof DataVerifierCdi) { ((DataVerifierCdi) verifier).init(ServiceLocatorBuilder.buildLocal().createServiceLocator()); } }
/** * Creates a new LocalServiceLocatorBuilder instance with the attributes specified * to the builder. * @return ServiceLocator instance */ public ServiceLocator createServiceLocator() { return new LocalServiceLocatorImpl(this.moduleName); } }
private LocalServiceLocatorImpl(BeanManager bm) { super(createInitialContext()); this.moduleName = ""; this.bm = bm; }
@Override public <T> CdiComplexLookupBuilder<T> cdiComplex(Class<T> clazz) { return new CdiComplexLookupBuilder<T>(clazz, this.bm); } }
/** * Gets a builder to create a new Remote ServiceLocator, i.e. a ServiceLocator * that will perform remote JBoss lookups. * <p> * Uses remote-naming for the lookup. * @return Builder instance */ public static RemoteServiceLocatorBuilder buildRemote() { return new RemoteServiceLocatorBuilder(); }
@Override public <T> T cdi(Class<T> clazz) { return cdiAnno(clazz); }
private ServiceLocator local() { return ServiceLocatorBuilder.createLocalByBeanManager(this.beanManager); } }
private LocalServiceLocatorImpl(String moduleName) { super(createInitialContext()); this.moduleName = moduleName == null ? "" : moduleName; this.bm = this.lookup(JNDI_NAME_BEAN_MANAGER); }
/** * Creates a new LocalServiceLocatorBuilder instance with the attributes specified * to the builder. * @return ServiceLocator instance */ public ServiceLocator createServiceLocator() { return new LocalServiceLocatorImpl(this.moduleName); } }
/** * Gets an instance of a remote JndiServiceLocator, configured by JU property files. * @return */ public static synchronized JndiServiceLocator getRemoteServiceLocator() { if (remoteServiceLocator == null) { remoteServiceLocator = ServiceLocatorBuilder.createRemoteByConfigurationFiles(); } return remoteServiceLocator; }
/** * Gets a builder to create a new Local ServiceLocator, i.e. a ServiceLocator * that will perform local JNDI and CDI lookups. * @return Builder instance */ public static LocalServiceLocatorBuilder buildLocal() { return new LocalServiceLocatorBuilder(); }
private LocalServiceLocatorImpl(BeanManager bm) { super(createInitialContext()); this.moduleName = ""; this.bm = bm; }
@Override public <T> CdiComplexLookupBuilder<T> cdiComplex(Class<T> clazz) { return new CdiComplexLookupBuilder<T>(clazz, this.bm); } }
/** * Gets a builder to create a new Remote ServiceLocator, i.e. a ServiceLocator * that will perform remote JBoss lookups. * <p> * Uses remote-naming for the lookup. * @return Builder instance */ public static RemoteServiceLocatorBuilder buildRemote() { return new RemoteServiceLocatorBuilder(); }
/** * Creates a local (CDI) ServiceLocator using the specified BeanManager implementation. * <p> * The BeanManager should be provided by the CDI container implementation we're using (e.g. Weld) * @param bm BeanManager used to perform the CDI lookups * @return ServiceLocator to perform local CDI lookups */ public static ServiceLocator createLocalByBeanManager(BeanManager bm) { return new LocalServiceLocatorImpl(bm); }
/** * Creates a local (CDI) ServiceLocator using the specified BeanManager implementation. * <p> * The BeanManager should be provided by the CDI container implementation we're using (e.g. Weld) * @param bm BeanManager used to perform the CDI lookups * @return ServiceLocator to perform local CDI lookups */ public static ServiceLocator createLocalByBeanManager(BeanManager bm) { return new LocalServiceLocatorImpl(bm); }