/** * Creates a {@link TimerService} for this container. * {@link TimerService} creation is skipped for stateful session beans, since * stateful session beans do not support timerservice * * @see EJBContainer#create() */ @Override public void create() throws Exception { super.create(); // for non-stateful beans, create timer service if (this.isStatefulBean() == false) { // just create the timerservice. Restoring of // any timers, will be done in afterStart(), once the container has fully started // (to allow for timeout method invocations) this.timerService = this.createTimerService(); } }
@Deprecated public MethodInfo getMethodInfo(Method method) { return super.getMethodInfo(method); }
/** * Returns the {@link TimerService} associated with this container. * * @throws UnsupportedOperationException If this container corresponds to a stateful session bean */ // hmm, what exactly is this method for? @Override public TimerService getTimerService(Object pKey) { return this.getTimerService(); }
/** * Restores the timers after this container has fully started, thus * ensuring that any invocations on this container through the restored * timers are handled successfully * <p> * This method skips timerservice restoration of stateful session beans * </p> * * @see org.jboss.ejb3.EJBContainer#afterStart() */ @Override protected void afterStart() { super.afterStart(); // restore timerservice for non-stateful beans if (this.isStatefulBean() == false) { restoreTimerService(); } }
/** * Creates and returns a {@link TimerService}. Uses the {@link #timerServiceFactory} for creating the * timer service. * @return */ private TimerService createTimerService() { // get the TimedObjectInvoker TimedObjectInvoker timedObjectInvoker = this.getTimedObjectInvoker(); // if there's no TimedObjectInvoker, we can't do anything, so just // throw an exception if (timedObjectInvoker == null) { throw new IllegalStateException("Cannot create timerservice for EJB " + this.getEjbName() + " since there's no TimedObjectInvoker"); } // create and return the timerservice return this.timerServiceFactory.createTimerService(timedObjectInvoker); }
@Override protected void lockedStop() throws Exception { stopProxies(); super.lockedStop(); }
/** * Initialize the container invoker. Sets up a connection, a server session * pool and a connection consumer for the configured destination. * <p/> * Any JMSExceptions produced while initializing will be assumed to be * caused due to JMS Provider failure. * * @throws Exception Failed to initalize. */ @Override protected void lockedStart() throws Exception { super.lockedStart(); populateActivationSpec(); innerStart(); startProxies(); }
protected void initializePool() throws Exception { super.initializePool(); }
/** * Returns the {@link TimerService} associated with this container. * * @throws UnsupportedOperationException If this container corresponds to a stateful session bean */ @Override public TimerService getTimerService() { if (this.isStatefulBean()) { throw new UnsupportedOperationException("stateful bean doesn't support TimerService (EJB3 18.2#2)"); } return this.timerService; }
@Override public void instantiated() { super.instantiated(); proxyDeployer.initializeRemoteBindingMetadata(); proxyDeployer.initializeLocalBindingMetadata(); }
protected void lockedStop() throws Exception { try { Dispatcher.singleton.unregisterTarget(getObjectName().getCanonicalName()); } catch (Exception ignore) { log.debug("Dispatcher unregister target failed", ignore); } // Deregister with Remoting Dispatcher.singleton.unregisterTarget(this.getName()); // Unbind applicable JNDI Entries JndiSessionRegistrarBase jndiRegistrar = this.getJndiRegistrar(); if (jndiRegistrar != null) { jndiRegistrar.unbindEjb(this.getInitialContext(), this.getMetaData()); } super.lockedStop(); }
protected void lockedStart() throws Exception { super.lockedStart(); this.registerWithAopDispatcher(); // Obtain registrar JndiSessionRegistrarBase registrar = this.getJndiRegistrar(); // Bind all appropriate references/factories to Global JNDI for Client access, if a JNDI Registrar is present if (registrar != null) { String guid = Ejb3Registry.guid(this); registrar.bindEjb(this.getInitialContext(), this.getMetaData(), this.getClassloader(), this.getObjectName() .getCanonicalName(), guid, this.getAdvisor()); } else { log.debug("No " + JndiSessionRegistrarBase.class.getSimpleName() + " was found; bypassing binding of Proxies to " + this.getName() + " in Global JNDI."); } }