1 29 30 package com.caucho.j2ee.appclient; 31 32 import com.caucho.config.ConfigException; 33 import com.caucho.naming.Jndi; 34 import com.caucho.naming.ObjectProxy; 35 import com.caucho.util.L10N; 36 37 import javax.annotation.PostConstruct; 38 import javax.naming.Context ; 39 import javax.naming.NamingException ; 40 import java.util.Hashtable ; 41 import java.util.logging.Logger ; 42 43 49 public class ClientEjbRef implements ObjectProxy { 50 private static final L10N L = new L10N(ClientEjbRef.class); 51 private static final Logger log 52 = Logger.getLogger(ClientEjbRef.class.getName()); 53 54 private Context _ic; 55 56 private String _ejbRefName; 57 private String _type; 58 private Class _home; 59 private Class _remote; 60 private String _jndiName; 61 private String _ejbLink; 62 63 public ClientEjbRef(Context ic) 64 { 65 _ic = ic; 66 } 67 68 public void setId(String id) 69 { 70 } 71 72 public void setDescription(String description) 73 { 74 } 75 76 87 public void setEjbRefName(String name) 88 { 89 _ejbRefName = name; 90 } 91 92 95 public String getEjbRefName() 96 { 97 return _ejbRefName; 98 } 99 100 public void setEjbRefType(String type) 101 { 102 _type = type; 103 } 104 105 public void setHome(Class home) 106 { 107 _home = home; 108 } 109 110 113 public Class getHome() 114 { 115 return _home; 116 } 117 118 public void setRemote(Class remote) 119 { 120 _remote = remote; 121 } 122 123 126 public Class getRemote() 127 { 128 return _remote; 129 } 130 131 138 public void setJndiName(String jndiName) 139 { 140 _jndiName = jndiName; 141 } 142 143 149 public void setEjbLink(String ejbLink) 150 { 151 _ejbLink = ejbLink; 152 } 153 154 @PostConstruct 155 public void init() 156 throws Exception 157 { 158 if (_ejbRefName == null) 159 throw new ConfigException(L.l("{0} is required", "<ejb-ref-name>")); 160 161 _ejbRefName = Jndi.getFullName(_ejbRefName); 162 } 163 164 169 public Object createObject(Hashtable env) 170 throws NamingException 171 { 172 return null; 173 } 174 175 public String toString() 176 { 177 return "ClientEjbRef[" + _ejbRefName + ", " + _ejbLink + ", " + _jndiName + "]"; 178 } 179 } 180 | Popular Tags |