Lines 273-278
Link Here
|
273 |
} |
273 |
} |
274 |
|
274 |
|
275 |
public void ensureResourceDefinedForEjb(final String ejbname, final String ejbtype) { |
275 |
public void ensureResourceDefinedForEjb(final String ejbname, final String ejbtype) { |
|
|
276 |
if (ejbname == null || ejbtype == null) { |
277 |
throw new NullPointerException(); |
278 |
} |
279 |
DDBean ejbBean = findDDBean(ejbname, ejbtype); |
280 |
if (ejbBean != null) { |
281 |
DeploymentConfiguration config = getDeploymentConfiguration(); |
282 |
ConfigurationSupport serverConfig = server.getConfigurationSupport(); |
283 |
serverConfig.ensureResourceDefined(config, ejbBean); |
284 |
} |
285 |
} |
286 |
|
287 |
public void ensureResourceDefinedForEjb(String ejbname, String ejbtype, String jndiName) { |
288 |
if (ejbname == null || ejbtype == null || jndiName == null) { |
289 |
throw new NullPointerException(); |
290 |
} |
291 |
DDBean ejbBean = findDDBean(ejbname, ejbtype); |
292 |
if (ejbBean != null) { |
293 |
DeploymentConfiguration config = getDeploymentConfiguration(); |
294 |
ConfigurationSupport serverConfig = server.getConfigurationSupport(); |
295 |
serverConfig.ensureResourceDefined(config, ejbBean, jndiName); |
296 |
} |
297 |
} |
298 |
|
299 |
private DDBean findDDBean(String ejbname, String ejbtype) { |
276 |
if (! J2eeModule.EJB.equals(provider.getJ2eeModule().getModuleType())) { |
300 |
if (! J2eeModule.EJB.equals(provider.getJ2eeModule().getModuleType())) { |
277 |
throw new IllegalArgumentException("Trying to get config bean for ejb on non ejb module!"); //NONI18N |
301 |
throw new IllegalArgumentException("Trying to get config bean for ejb on non ejb module!"); //NONI18N |
278 |
} |
302 |
} |
Lines 296-306
Link Here
|
296 |
} |
320 |
} |
297 |
Exception e = new Exception("Failed to lookup: "+ejbname+" type "+ejbtype); |
321 |
Exception e = new Exception("Failed to lookup: "+ejbname+" type "+ejbtype); |
298 |
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); |
322 |
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); |
299 |
return; |
323 |
return null; |
300 |
} |
324 |
} |
301 |
DeploymentConfiguration config = getDeploymentConfiguration(); |
325 |
|
302 |
ConfigurationSupport serverConfig = server.getConfigurationSupport(); |
326 |
return ejbBean; |
303 |
serverConfig.ensureResourceDefined(config, ejbBean); |
|
|
304 |
} |
327 |
} |
305 |
|
328 |
|
306 |
public Set<Datasource> getDatasources() { |
329 |
public Set<Datasource> getDatasources() { |