public JavaEEModuleJndiBinder(JavaEEModule javaEEModule) { super(javaEEModule.getApplication() != null? javaEEModule.getApplication().getName(): null, javaEEModule.getName()); this.javaEEModule = javaEEModule; }
@Override public String getName() { return javaeeModule.getName(); }
protected static JavaEEApplication getApplicationForComponent(JavaEEComponent javaEEComponent) { return javaEEComponent.getModule().getApplication(); }
private Context getContext() { if (this.javaeeModule == null) { throw new IllegalStateException("JavaEEModule is not set. Cannot return JNDI context"); } if (this.javaAppBinder) { return this.javaeeModule.getApplication().getContext(); } return this.javaeeModule.getContext(); } }
protected void unbindApp(View view) throws NamingException { bean.getModule().getApplication().getContext().unbind(getAppJNDIName(view.getBusinessInterface())); // unbind from the additional JNDI name, if the bean exposed just 1 view if (this.hasSingleView()) { bean.getModule().getApplication().getContext().unbind(getAppJNDIName(null)); } }
@Override protected Context getJavaCompContext() { return javaEEComponent.getContext(); }
@Override public Context getContext() { return javaeeModule.getContext(); } };
/** * Get global jndi name. * * @param businessInterface the business interface * @return the name within the global name space. */ protected String getGlobalJNDIName(Class<?> businessInterface) { JavaEEModule module = bean.getModule(); JavaEEApplication app = module.getApplication(); // EJB 3.1 4.4.1 <app-name> only applies if the session bean is packaged within an .ear file. String appName = app.isEnterpriseApplicationArchive() ? app.getName() : null; return (appName != null ? appName + "/" : "") + getAppJNDIName(businessInterface); }
@Override protected String getJavaContextDescription() { return javaEEComponent.getName(); }
public SimpleCompJndiBinder(DeploymentUnit deploymentUnit, JavaEEModule javaEEModule) { super(javaEEModule.getApplication()!=null?javaEEModule.getApplication().getName():null, javaEEModule.getName()); this.deploymentUnit = deploymentUnit; }
protected void bindApp(View view, Object proxy) throws NamingException { String name = getAppJNDIName(view.getBusinessInterface()); bind(bean.getModule().getApplication().getContext(), name, proxy); // bind to an additional JNDI name (as specified by 4.4.1 section of EJB3.10 // when the bean exposes just 1 view if (this.hasSingleView()) { bind(bean.getModule().getApplication().getContext(), this.getAppJNDIName(null), proxy); } }
public String getName() { return module.getName(); } };
@Override public Context getContext() { return this.javaEEComponent == null ? null : this.javaEEComponent.getContext(); }
@Override protected Context getJavaCompContext() { return javaEEModule.getContext(); }
@Override protected String getJavaContextDescription() { return javaEEModule.getName(); } }
public Context getEnc(final EJBContainer container) { return component.getContext(); }
public Context getContext() { return module.getContext(); }
/** * Get app jndi name. * * @param businessInterface the business interface * @return the name within the app name space */ protected String getAppJNDIName(Class<?> businessInterface) { JavaEEModule module = bean.getModule(); return module.getName() + "/" + getModuleJNDIName(businessInterface); }
public Context getEnc() { return component.getContext(); }