1 5 8 package com.opensymphony.workflow.spi.ejb; 9 10 11 16 public class WorkflowStoreHomeFactory { 17 19 public static final String COMP_NAME = "java:comp/env/ejb/WorkflowStore"; 20 public static final String JNDI_NAME = "WorkflowStore"; 21 22 23 private static com.opensymphony.workflow.spi.ejb.WorkflowStoreHome cachedRemoteHome = null; 24 25 27 29 33 public static com.opensymphony.workflow.spi.ejb.WorkflowStoreHome getHome() throws javax.naming.NamingException { 34 if (cachedRemoteHome == null) { 35 javax.naming.InitialContext initialContext = new javax.naming.InitialContext (); 37 38 try { 39 java.lang.Object objRef = initialContext.lookup(COMP_NAME); 40 cachedRemoteHome = (com.opensymphony.workflow.spi.ejb.WorkflowStoreHome) javax.rmi.PortableRemoteObject.narrow(objRef, com.opensymphony.workflow.spi.ejb.WorkflowStoreHome.class); 41 } finally { 42 initialContext.close(); 43 } 44 } 45 46 return cachedRemoteHome; 47 } 48 49 54 public static com.opensymphony.workflow.spi.ejb.WorkflowStoreHome getHome(java.util.Hashtable environment) throws javax.naming.NamingException { 55 javax.naming.InitialContext initialContext = new javax.naming.InitialContext (environment); 57 58 try { 59 java.lang.Object objRef = initialContext.lookup(COMP_NAME); 60 61 return (com.opensymphony.workflow.spi.ejb.WorkflowStoreHome) javax.rmi.PortableRemoteObject.narrow(objRef, com.opensymphony.workflow.spi.ejb.WorkflowStoreHome.class); 62 } finally { 63 initialContext.close(); 64 } 65 } 66 } 67 | Popular Tags |