/** * return the name of the application to which the bean belongs * it will be the j2ee app name if the bean is part of a j2ee app * it will be the ejb module name if the bean is a stand-alone ejb module */ private String getApplicationName() { Application application = _ejbDescriptor.getApplication(); return application.getRegistrationName(); }
public Application getAppFromDescriptor() { Application app = null; if( descriptor instanceof BundleDescriptor ) { BundleDescriptor bundle = (BundleDescriptor) descriptor; app = bundle.getApplication(); } else if( descriptor instanceof EjbDescriptor ) { app = ((EjbDescriptor)descriptor).getApplication(); } return app; } }
private Application getAppFromDescriptor() { Application app = null; if( descriptor instanceof BundleDescriptor ) { BundleDescriptor bundle = (BundleDescriptor) descriptor; app = bundle.getApplication(); } else if( descriptor instanceof EjbDescriptor ) { app = ((EjbDescriptor)descriptor).getApplication(); } return app; } }
/** * return whether the bean is a "virtual" app - i.e. a stand-alone * ejb module */ private boolean isVirtualApplication() { Application application = _ejbDescriptor.getApplication(); return application.isVirtual(); }
final long getApplicationId() { return ejbDescriptor.getApplication().getUniqueId(); }
String getTimedObjectApplicationName() { EjbDescriptor ejbDesc = container_.getEjbDescriptor(); Application app = ejbDesc.getApplication(); return (app != null) ? app.getRegistrationName() : ""; }
String getTimedObjectApplicationName() { EjbDescriptor ejbDesc = container_.getEjbDescriptor(); Application app = ejbDesc.getApplication(); return (app != null) ? app.getRegistrationName() : ""; }
/** * ***************************************************************** */ protected void doConcreteContainerShutdown(boolean appBeingUndeployed) { cancelAllTimerTasks(); if( appBeingUndeployed && (ejbDescriptor.getApplication().getKeepStateResolved() == false)) { removeBeansOnUndeploy(); } else { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "StatefulSessionContainer.doConcreteContainerShutdown() called with --keepstate=" + ejbDescriptor.getApplication().getKeepStateResolved()); } passivateBeansOnShutdown(); } }
protected String getJavaGlobalJndiNamePrefix() { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptor ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
private String getJavaGlobalJndiNamePrefix(EjbDescriptor ejbDescriptor) { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptor ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuilder javaGlobalPrefix = new StringBuilder("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
CallFlowInfoImpl(BaseContainer container, EjbDescriptor descriptor, ComponentType compType) { this.container = container; this.ejbDescriptor = descriptor; this.appName = (ejbDescriptor.getApplication().isVirtual()) ? null : ejbDescriptor.getApplication().getRegistrationName(); String archiveuri = ejbDescriptor.getEjbBundleDescriptor() .getModuleDescriptor().getArchiveUri(); this.modName = com.sun.enterprise.util.io.FileUtils .makeFriendlyFilename(archiveuri); this.ejbName = ejbDescriptor.getName(); this.componentType = compType; }
/** * Called after all the components in the container's application * have deployed successfully. */ public void startApplication(boolean deploy) { super.startApplication(deploy); try { String timerLocalIntf = "com.sun.ejb.containers.TimerLocal"; TimerLocal timerLocal = (TimerLocal) createEJBLocalBusinessObjectImpl(timerLocalIntf). getClientObject(timerLocalIntf); //descriptor object representing this application or module Application application = ejbDescriptor.getApplication(); //registration name of the applicaton String appID = application.getRegistrationName(); // Create EJB Timer service. ejbTimerService = new EJBTimerService(appID, timerLocal); ejbContainerUtil.setEJBTimerService(ejbTimerService); } catch (Exception ex) { _logger.log(Level.WARNING, "ejb.timer_service_init_error", logParams); _logger.log(Level.WARNING, "", ex); throw new RuntimeException(ex.getMessage(), ex); } }
/** * Gets ejb pass-by-reference value. * @return Value of property passByReference if it is not null. Otherwise * returns value of passByReference property of Application if * it is not null. Default value is false. */ public boolean getPassByReference() { boolean passByReference = false; // default // if pass-by-reference defined for ejb if (this.isPassByReferenceDefined()) { passByReference = this.passByReference.booleanValue(); // if pass-by-reference undefined for ejb set to // application's pass-by-reference value if defined } else { ejbDescriptor = this.getEjbDescriptor(); if (ejbDescriptor != null) { Application application = ejbDescriptor.getApplication(); if (application != null) { if (application.isPassByReferenceDefined()) { passByReference = application.getPassByReference(); } } } } return passByReference; }
/** * Gets ejb pass-by-reference value. * @return Value of property passByReference if it is not null. Otherwise * returns value of passByReference property of Application if * it is not null. Default value is false. */ public boolean getPassByReference() { boolean passByReference = false; // default // if pass-by-reference defined for ejb if (this.isPassByReferenceDefined()) { passByReference = this.passByReference.booleanValue(); // if pass-by-reference undefined for ejb set to // application's pass-by-reference value if defined } else { ejbDescriptor = this.getEjbDescriptor(); if (ejbDescriptor != null) { Application application = ejbDescriptor.getApplication(); if (application != null) { if (application.isPassByReferenceDefined()) { passByReference = application.getPassByReference(); } } } } return passByReference; }
/** * Called after all the components in the container's application * have deployed successfully. */ public void startApplication(boolean deploy) { _logger.log(Level.FINE,"Application deployment successful : " + this); // By now all existing timers should have been restored. if( isTimedObject_ ) { // EJBTimerService should be accessed only if needed // not to cause it to be loaded if it's not used. EJBTimerService timerService = ejbContainerUtilImpl.getEJBTimerService(); if (timerService != null) { boolean deploy0 = deploy; //avoid modifying param if (deploy0 && ejbDescriptor.getApplication().getKeepStateResolved()) { deploy0 = false; _logger.log(Level.INFO, "keepstate is true and will not create new auto timers during deployment."); } scheduleIds = timerService.recoverAndCreateSchedules( getContainerId(), getApplicationId(), schedules, deploy0); } else { throw new RuntimeException("EJB Timer Service is not available"); } } setStartedState(); }
public EJBTimerServiceWrapper(EJBTimerService timerService, EJBContextImpl ejbContext) { timerService_ = timerService; ejbContext_ = ejbContext; BaseContainer container = (BaseContainer) ejbContext.getContainer(); containerId_ = container.getEjbDescriptor().getUniqueId(); applicationId_ = container.getEjbDescriptor().getApplication().getUniqueId(); entity_ = false; timedObjectPrimaryKey_ = null; }
private Application getApplicationFromEnv(JndiNameEnvironment env) { Application app = null; if (env instanceof EjbDescriptor) { // EJB component EjbDescriptor ejbEnv = (EjbDescriptor) env; app = ejbEnv.getApplication(); } else if ( env instanceof EjbBundleDescriptor ) { EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env; app = ejbBundle.getApplication(); } else if (env instanceof WebBundleDescriptor) { WebBundleDescriptor webEnv = (WebBundleDescriptor) env; app = webEnv.getApplication(); } else if (env instanceof ApplicationClientDescriptor) { ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env; app= appEnv.getApplication(); } else if ( env instanceof ManagedBeanDescriptor ) { ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env; app = mb.getBundle().getApplication(); } else if ( env instanceof Application ) { app = ((Application)env); } else { throw new IllegalArgumentException("IllegalJndiNameEnvironment : env"); } return app; }
public static Application getApplicationFromEnv(JndiNameEnvironment env) { Application app = null; if (env instanceof EjbDescriptor) { // EJB component EjbDescriptor ejbEnv = (EjbDescriptor) env; app = ejbEnv.getApplication(); } else if (env instanceof EjbBundleDescriptor) { EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env; app = ejbBundle.getApplication(); } else if (env instanceof WebBundleDescriptor) { WebBundleDescriptor webEnv = (WebBundleDescriptor) env; app = webEnv.getApplication(); } else if (env instanceof ApplicationClientDescriptor) { ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env; app = appEnv.getApplication(); } else if (env instanceof ManagedBeanDescriptor) { ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env; app = mb.getBundle().getApplication(); } else if (env instanceof Application) { app = ((Application) env); } else { throw new IllegalArgumentException("IllegalJndiNameEnvironment : env"); } return app; }
public EJBSecurityManager createManager(EjbDescriptor ejbDesc, boolean register) { String ctxId = EJBSecurityManager.getContextID(ejbDesc); String ejbName = ejbDesc.getName(); EJBSecurityManager manager = null; if (register) { manager = getManager(ctxId, ejbName, false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(ejbName); manager = new EJBSecurityManager(ejbDesc, this.invMgr, this); probeProvider.securityManagerCreationEndedEvent(ejbName); if (register) { String appName = ejbDesc.getApplication().getRegistrationName(); addManagerToApp(ctxId, ejbName, appName, manager); probeProvider.securityManagerCreationEvent(ejbName); } } catch (Exception ex) { _logger.log(Level.FINE, "[EJB-Security] FATAL Exception. Unable to create EJBSecurityManager: " + ex.getMessage()); throw new RuntimeException(ex); } } return manager; }
public static void testCreate(String timerId, EJBContext context, String ownerId, Date initialExpiration, long intervalDuration, Serializable info) throws CreateException { TimerLocal timerLocal = getEJBTimerService().getTimerLocal(); EjbDescriptor ejbDesc = ((EJBContextImpl) context).getContainer().getEjbDescriptor(); long containerId = ejbDesc.getUniqueId(); long applicationId = ejbDesc.getApplication().getUniqueId(); Object timedObjectPrimaryKey = (context instanceof EntityContext) ? ((EntityContext)context).getPrimaryKey() : null; TimerConfig timerConfig = new TimerConfig(); timerConfig.setInfo(info); timerLocal.createTimer(timerId, containerId, applicationId, ownerId, timedObjectPrimaryKey, initialExpiration, intervalDuration, null, timerConfig); return; }