Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.awesometodo.model.manager;
- import java.util.Hashtable;
- import javax.naming.Context;
- import javax.naming.InitialContext;
- import javax.naming.NamingException;
- public class EJBFactoryT {
- //context of EJB container
- Context context;
- public EJBFactoryT() throws NamingException
- {
- final Hashtable<String, String> jndiProperties = new Hashtable<>();
- jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
- context = new InitialContext(jndiProperties);
- }
- public TaskBeanManagerLocal getTaskBeanManagerLocal() throws NamingException
- {
- return (TaskBeanManagerLocal) context.lookup("java:global/awesometodolist/TaskBeanManager!" + TaskBeanManagerLocal.class.getName());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment